Add rofi theme scaffolding
Themes are structured in two parts: layout and colorschemes. Both can be set independently from each other. Layouts can make use of anchored color values (@background, @background-focus,.. look at colorscheme files for all available values). Colorscheme files then translate the values into actual colorcodes. That way, the colorscheme for all layouts can be changed with one setting, or independently of each other. Layouts try to specify some often used structures for rofi menus - right now there is a horizontal list and a fullscreen options selection (which can make use of icon fonts). Any global theme changes should be done in settings.rasi. Any global function changes can still be done in config.rasi. A rofi-powermenu has been added as an example of using the theming structure. The powermenu script loads rofi with the powermenu.rasi theme enabled. The powermenu theme loads the fullscreen options layout, which in turn loads the vertical list layout, which loads settings, which sets the correct colors. Idea and original structure from: https://gitlab.com/vahnrr/rofi-menus
This commit is contained in:
parent
264e095224
commit
199fbdae4d
7 changed files with 190 additions and 5 deletions
37
.config/rofi/modes/rofi-powermenu
Executable file
37
.config/rofi/modes/rofi-powermenu
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/sh
|
||||
|
||||
rofi_command="rofi -theme themes/powermenu.rasi"
|
||||
|
||||
### Options ###
|
||||
power_off=""
|
||||
reboot=""
|
||||
lock=""
|
||||
suspend_btn="鈴"
|
||||
logout_btn=""
|
||||
# Variable passed to rofi
|
||||
|
||||
chosen="$(printf "%s\n%s\n%s\n%s\n%s" "$power_off" "$reboot" "$lock" "$suspend_btn" "$logout_btn" | $rofi_command -dmenu -selected-row 2)"
|
||||
case $chosen in
|
||||
$power_off)
|
||||
printf "poweroff"
|
||||
# systemctl poweroff
|
||||
;;
|
||||
$reboot)
|
||||
printf "reboot"
|
||||
# systemctl reboot
|
||||
;;
|
||||
$lock)
|
||||
printf "lock"
|
||||
# light-locker-command -l
|
||||
;;
|
||||
$suspend_btn)
|
||||
printf "suspend"
|
||||
# mpc -q pause
|
||||
# amixer set Master mute
|
||||
# systemctl suspend
|
||||
;;
|
||||
$logout_btn)
|
||||
printf "logout_btn"
|
||||
# i3-msg exit
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue