.desktop files (II): desktop shorcuts and X sessions
You can create a .desktop file to add a shortcut in your Desktop. You can also add X session options to your login graphical screen.
Desktop shortcuts
Just create a .desktop file in your Desktop folder:
# $HOME/Desktop/thunar.desktop
[Desktop Entry]
Name=Thunar
Comment=File Manager
Type=Application
Exec=/usr/bin/thunar
Then, mark it as executable (chmod +x $HOME/Desktop/thunar.desktop
). You can add an icon (Icon=/path/to/icon
). Icon path can be an absolute path or simply a filename if the icon file is inside $XDG_DATA_DIRS/icons
or /usr/share/pixmaps
.
X sessions
When you install a desktop environment or a window manager, it usually shows automatically in your login screen as an option. But if this does not happen, you can create a .desktop file inside /usr/share/xsessions
(you need superuser privileges).
# /usr/share/xsessions/xfce-custom.desktop
[Desktop Entry]
Name=Custom XFCE
Comment=Run XFCE desktop environment
Type=Application
Exec=startxfce4
Then, logout to see the new session option.
Note for lightDM: if you see a wrench icon next to X session selection instead of the DE icon, check if the icon file (usually under /usr/share/icons/hicolor/scalable/
) has a filename like this: <sessionname>_badge-symbolic
and the .desktop
file has a name like this: <sessionname>.desktop
. Change one of the filenames to match.
For instance:
/usr/share/icons/hicolor/scalable/places/kde_badge-symbolic.svg
/usr/share/xsessions/kde.desktop
If you have any suggestion, feel free to contact me via social media or email.
Latest tutorials and articles:
Featured content: