Advertisement
smeech

Activate or start program single instance

Jun 8th, 2024 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | Source Code | 0 0
  1. #!/bin/sh
  2. # Starts single instance of program in command line
  3. # Usefully assigned to a system hotkey shortcut
  4. # Usage "wm application"
  5. # System calls may need full path
  6.  
  7. case "$1" in
  8.     ferdium)
  9.         run="/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=ferdium --file-forwarding org.ferdium.Ferdium @@u %U @@"
  10.         ;;
  11.     # Add more cases here for other programs
  12.     *)
  13.         # Default action if no match is found
  14.         run=$1
  15.         ;;
  16. esac
  17.  
  18. sh -c "wmctrl -x -a $1 || $run"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement