Advertisement
constantin-net

rofi-shutdown-menu

Jul 22nd, 2021 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. rofi-shutdown-menu.sh
  2.  
  3. #!/bin/bash
  4.  
  5. icons_dir="$HOME/.config/awesome/icons2"
  6.  
  7. shutdown="$icons_dir/system-shutdown.svg";
  8. reboot="$icons_dir/system-reboot.svg";
  9. sleep="$icons_dir/system-suspend.svg";
  10. logout="$icons_dir/system-log-out.svg";
  11. lock="$icons_dir/system-lock-screen.svg";
  12. options="shutdown\0icon\x1f$shutdown\nreboot\0icon\x1f$reboot\nsleep\0icon\x1f$sleep\nlogout\0icon\x1f$logout\nlock\0icon\x1f$lock"
  13.  
  14. selected="$(echo -e $options | rofi-1.6.1 -font "Helvetica Neue, 18" -show-icons -theme .config/rofi/theme-shutdown.rasi -p " " -dmenu )"
  15.  
  16. case $selected in
  17. shutdown)
  18. systemctl poweroff
  19. ;;
  20. reboot)
  21. systemctl reboot
  22. ;;
  23. sleep)
  24. systemctl suspend
  25. ;;
  26. logout)
  27. echo "awesome.quit()" | awesome-client
  28. ;;
  29. lock)
  30. #slock
  31. scrot -m -z /tmp/screen.png
  32. convert /tmp/screen.png -scale 10% -scale 1000% /tmp/blur.png
  33. rm /tmp/screen.png
  34. i3lock -i /tmp/blur.png
  35. rm /tmp/blur.png
  36. xset dpms force off
  37. ;;
  38. esac
  39.  
  40.  
  41. /*
  42. * Rofi theme for fullscreen powermenu
  43. */
  44.  
  45. * {
  46. content-position: 25% 4% 25% 4%;
  47. space-between-options: 1%;
  48. /*option-inset-padding: 4.1% 2.6% 2.5% -4.1%;*/
  49. option-inset-padding: 1%;
  50.  
  51. window-bg-color: rgba(15, 15, 15, 0.7);
  52. title-text-color: rgba(141, 145, 148, 1);
  53. selected-bg-color: rgba(100, 100, 100, 0.4);
  54. unselected-bg-color: rgba(100, 100, 100, 0.05);
  55. selected-text-color: #FFFFFF;
  56. unselected-text-color: #FFFFFF;
  57.  
  58. }
  59.  
  60. #window {
  61. width: 100%;
  62. height: 100%;
  63. x-offset: 0%;
  64. y-offset: 0%;
  65. padding: @content-position;
  66. background-color: @window-bg-color;
  67. children: [ inputbar, horibox ];
  68. }
  69.  
  70. #inputbar {
  71. children: [ prompt ];
  72. margin: @title-margins;
  73. background-color: transparent;
  74. }
  75.  
  76. prompt {
  77. text-color: @selected-text-color;
  78. background-color: transparent;
  79. }
  80.  
  81. #horibox {
  82. background-color: transparent;
  83. children: [ listview ];
  84. }
  85.  
  86. #listview {
  87. layout: horizontal;
  88. background-color: transparent;
  89. spacing: @space-between-options;
  90. lines: 5;
  91. }
  92.  
  93. #element {
  94. text-color: @unselected-text-color;
  95. padding: 0px;
  96. border-radius: 50%;
  97. background-color: @unselected-bg-color;
  98. }
  99.  
  100. #element-icon {
  101. size: 96;
  102. padding: 0px;
  103. }
  104.  
  105. #element-text {
  106. horizontal-align: 0;
  107. padding: 2%;
  108. }
  109.  
  110. #element.selected {
  111. text-color: @selected-text-color;
  112. background-color: @selected-bg-color;
  113. padding: 0px;
  114. }
  115.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement