Skip to content

Commit

Permalink
Customise .desktop-entries shown by WSLg
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsputman committed Mar 8, 2024
1 parent ad9515c commit 1aaed5a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/rclone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ rclone sync ~/.bash_history onedrive:AppData/WSL/
rclone sync ~/.local/share/mcfly/history.db \
onedrive:AppData/WSL/.local/share/mcfly

# Backup custom Desktop-entries
rclone sync ~/.local/share/applications \
onedrive:AppData/WSL/.local/share/applications --max-depth 1 \
--include "/*.desktop"

# Backup (personal) Git configuration
rclone sync ~/ onedrive:AppData/WSL/ --max-depth 1 --skip-links \
--include "/.gitconfig*"
Expand Down
2 changes: 2 additions & 0 deletions static/windows/.wslgconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[system-distro-env]
WESTON_RDPRAIL_SHELL_APP_LIST_PATH=/home/thijs/.local/share/applications
19 changes: 19 additions & 0 deletions static/windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [`.wslconfig`](#wslconfig)
- [Caveats](#caveats)
- [`.wslgconfig`](#wslgconfig)
- [SSH](#ssh)
- [ProxyJump](#proxyjump)
- [Move WSL2's VHDX-files](#move-wsl2s-vhdx-files)
Expand Down Expand Up @@ -71,6 +72,24 @@ ConditionVirtualization=
ConditionVirtualization=wsl
```

## `.wslgconfig`

WSLg automatically creates application shortcuts in Windows' Start Menu based
upon `.desktop`-files. By default, it looks for these files in system-wide
locations (e.g. `/usr/share/applications`, and
`/var/lib/snapd/desktop/applications` for snaps).

The updated
[WSLg configuration](https://github.com/microsoft/wslg/issues/937#issuecomment-1421200151)
makes it also look in `~/.local/share/applications/`. Files there get priority
over the system-wide definitions.

To modify to a `.desktop`-entry, copy it into the user-specific location and
make changes there. To stop WSLg from creating a shortcut, add `NoDisplay=true`
to the file in question.

Changes (appear) to be picked up almost immediately by WSLg/Windows...

## SSH

Install [OpenSSH for Windows32](https://github.com/powershell/Win32-OpenSSH):
Expand Down

0 comments on commit 1aaed5a

Please sign in to comment.