Linux

[2023-12-24 Sun] Directory structure

This is a note of the currently used directory structure in the workstation. It is not optimal.

Packages installed from source:

  • Git clone into ~/.local/src/, then symlink the binary inside ~/.local/bin.
  • Binaries are thrown around a bit - some are in ~/bin/, others are in ~/.local/bin. Best to put everything in ~/.local/bin.

XDG

To clean the home directory and make it XDG compliant, try xdg-ninja. See also this YouTube video.

To create a desktop entry for a program installed from source:

  • Create the file myapp.desktop in ~/.local/share/applications. Create the directory if it does not exist.
  • Added the following entry: [Desktop Entry] Version=1.0 Name=MyApp Exec=/path/to/executable %U Icon=/path/to/icon.png Type=Application Terminal=false Categories=Utility;
  • Run xdg-mime default myapp.desktop mime/type, and confirm the change with xdg-mime query default mime/type. E.g. to set sioyek as the default PDF viewer:

    xdg-mime default 'sioyek.desktop' application/pdf
    

Emacs 29.3 (Org mode 9.6.15)