Last active
          July 2, 2025 03:35 
        
      - 
      
 - 
        
Save specter119/4e84059f2f9cc9e515a9865d82a07d5c to your computer and use it in GitHub Desktop.  
    /usr/share/libalpm/hooks/90-wsl-shortcuts-control.hook for proventing wsl add too much desktop entry into host windows, /etc/wsl.d/desktop_whitelist is the file list, without .desktop suffix
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | [Trigger] | |
| Type = Path | |
| Operation = Install | |
| Operation = Upgrade | |
| Target = usr/share/applications/*.desktop | |
| [Action] | |
| Description = Control WSL application shortcuts by setting Terminal=true | |
| When = PostTransaction | |
| Exec = /bin/bash -c 'for f in /usr/share/applications/*.desktop; do app=$(basename "$f" .desktop); while read -r w; do [ "$w" = "$app" ] && continue 2; done < /etc/wsl.d/desktop_whitelist 2>/dev/null; sed -i "/^Terminal=false$/ s//Terminal=true/" "$f"; done' | |
| Depends = bash | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment