thelinuxguy_np_001

script

Jun 22nd, 2022
4,851
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. #############____Binary__________
  2. ## save as a executable on any bin directory eg . ~/bin/powermenu
  3.  
  4. #!/bin/env bash
  5.  
  6. # Options for powermenu
  7. lock=""
  8. logout=""
  9. shutdown=""
  10. reboot=""
  11. sleep=""
  12.  
  13. # Get answer from user via rofi
  14. selected_option=$(echo "$lock
  15. $logout
  16. $sleep
  17. $reboot
  18. $shutdown" | rofi -dmenu\
  19. -i\
  20. -p "Power"\
  21. -theme "~/.config/bspwm/rofi/themes/dracula/powermenu.rasi")
  22. # Do something based on selected option
  23. if [ "$selected_option" == "$lock" ]
  24. then
  25. betterlockscreen --lock
  26. elif [ "$selected_option" == "$logout" ]
  27. then
  28. loginctl terminate-user `whoami`
  29. elif [ "$selected_option" == "$shutdown" ]
  30. then
  31. mpv ~/Music/alaram/shutdown.mp3 &
  32. doas systemctl poweroff
  33. elif [ "$selected_option" == "$reboot" ]
  34. then
  35. doas systemctl reboot
  36. elif [ "$selected_option" == "$sleep" ]
  37. then
  38. amixer set Master mute
  39. doas systemctl suspend
  40. else
  41. echo "No match"
  42. fi
  43.  
  44.  
  45.  
  46.  
  47.  
  48. #___________________________POWERMENU THEME __________________________________
  49.  
  50.  
  51. configuration {
  52. location: 0;
  53. font: "Font Awesome 6 Free:style=regular";
  54. }
  55.  
  56.  
  57. * {
  58. border: 0;
  59. margin: 0;
  60. padding: 0;
  61. spacing: 0;
  62. background: #1B1B27;
  63. background-alt: #282a36;
  64. line: #44475a;
  65. foreground: #f8f8f2;
  66. foreground-alt: #f8f8f2;
  67. Comment: #6272a4;
  68. selected: #ffb86c;
  69. Pink: #ff79c6;
  70. Purple: #bd93f9;
  71. background-color: @background;
  72. text-color: @purple;
  73. }
  74.  
  75.  
  76. window {
  77. background-color: @background;
  78. border: 2px;
  79. border-color: @line;
  80. border-radius: 50px;
  81. width: 490px;
  82. height: 130px;
  83. x-offset: -4;
  84. y-offset: 0;
  85. }
  86.  
  87. listview {
  88. background-color: @background;
  89. columns: 1;
  90. lines: 5;
  91. spacing: 50px;
  92. layout: horizontal;
  93. }
  94.  
  95. mainbox {
  96. background-color: @background;
  97. children: [ listview ];
  98. padding: 40px;
  99. }
  100.  
  101. element {
  102. background-color: @background;
  103. text-color: @line;
  104. orientation: horizontal;
  105. /*border-radius: 100%;*/
  106. /*padding: 8px 32px 8px 32px;*/
  107. }
  108.  
  109. element-text {
  110. background-color: inherit;
  111. text-color: inherit;
  112. font: "Font Awesome 6 Free 30";
  113. expand: false;
  114. horizontal-align: 0.5;
  115. vertical-align: 0.5;
  116. margin: 0px;
  117. }
  118.  
  119. element selected {
  120. background-color: @background;
  121. text-color: @purple;
  122. border: 0px;
  123. /*border-radius: 100%;*/
  124. border-color: @selected;
  125. }
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
Advertisement
Add Comment
Please, Sign In to add comment