My scripts for startup, dmenu, and the command line
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

84 lignes
1.7 KiB

  1. #!/bin/sh
  2. #Finish vpn and networking stuff after ini script is finished, then make sure printf in case goes to stderror which is shown in bar
  3. launch() {
  4. app=$(printf "Notes
  5. Files
  6. Editor
  7. Terminal
  8. Multiplexer
  9. LBRY
  10. Chat
  11. Music
  12. Browser
  13. Email
  14. Processes" |
  15. dmenu -i -p "Launcher")
  16. case $app in
  17. Notes) st -e vim "+cd ~/Notes/text" "+CtrlP";;
  18. Files) st -e nnn;;
  19. Editor) st -e vim;;
  20. Terminal) st;;
  21. Multiplexer) st -e tmux $*;;
  22. LBRY) lbry;;
  23. Chat) element-desktop;;
  24. Music) st -e ncmpcpp;;
  25. Browser) brave-browser;;
  26. Email) brave-browser mail.protonmail.com/login;;
  27. Processes) st -e htop;;
  28. esac
  29. }
  30. action() {
  31. action=$(printf "Play Music
  32. Pause Music
  33. Toggle Music
  34. Select VPN
  35. Disable VPN
  36. Enable VPN
  37. VPN Status
  38. Rebind Keys
  39. Disable Bar
  40. Enable Bar" |
  41. dmenu -i -p "Actions")
  42. case $action in
  43. 'Play Music') mpc play ;;
  44. 'Pause Music') mpc pause ;;
  45. 'Toggle Music') mpc toggle ;;
  46. 'Rebind Keys') setup-xbindkeys;;
  47. 'Disable Bar') tmux set -g status off;;
  48. 'Enable Bar') tmux set -g status on;;
  49. esac
  50. }
  51. screenshot() {
  52. method=$(printf "clipboard
  53. file
  54. both" |
  55. dmenu -i -p "Screenshot")
  56. if test $method = "file"; then
  57. scrot --note "-f 'LiterationSans Nerd Font Book/11' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'"\
  58. -s ~/Pictures/screenshots/screenshot-%Y-%m-%d_$wx$h.png
  59. fi
  60. }
  61. if test $method = "clipboard"; then
  62. scrot --note "-f 'LiterationSans Nerd Font Book/11' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'"\
  63. -s ~/Pictures/screenshots/screenshot-%Y-%m-%d_$wx$h.png\
  64. -e "xclip $f; rm $f"
  65. fi
  66. if test $method = "both"; then
  67. scrot --note "-f 'LiterationSans Nerd Font Book/11' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'"\
  68. -s ~/Pictures/screenshots/screenshot-%Y-%m-%d_$wx$h.png\
  69. -e "xclip $f;"
  70. fi
  71. case $1 in
  72. launch) launch;;
  73. action) action;;
  74. *) printf "Invalid argument";;
  75. esac