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.

prompt 1.6 KiB

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