From 72acfd474bce084192b44a645b6a290eb6707ef7 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 23 Feb 2020 17:53:28 +0100 Subject: [PATCH] [wofi] replace rofi with wofi in sway --- sway/config | 6 +++--- wofi/config | 5 +++++ wofi/style.css | 27 +++++++++++++++++++++++++++ wofi/system.sh | 20 ++++++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 wofi/config create mode 100644 wofi/style.css create mode 100755 wofi/system.sh diff --git a/sway/config b/sway/config index c4724c9..a718ed8 100644 --- a/sway/config +++ b/sway/config @@ -147,9 +147,9 @@ bindsym $mod+y exec ~/.dotfiles/sway/lock.sh bindsym Scroll_Lock exec ~/.dotfiles/sway/lock.sh # start dmenu (a program launcher) -bindsym $mod+d exec rofi -show || albert toggle || albert -bindsym $mod+Shift+d exec ~/.dotfiles/rofi/system.sh -bindsym Alt+Space exec rofi -show +bindsym $mod+d exec wofi --show drun +bindsym $mod+Shift+d exec ~/.dotfiles/wofi/system.sh +bindsym Alt+Space exec wofi --show drun # gtk3 set $gnome-schema org.gnome.desktop.interface diff --git a/wofi/config b/wofi/config new file mode 100644 index 0000000..19bceb0 --- /dev/null +++ b/wofi/config @@ -0,0 +1,5 @@ +mode=run +colors=colors +filter_rate=100 +allow_images=true +allow_markup=true diff --git a/wofi/style.css b/wofi/style.css new file mode 100644 index 0000000..a285a2f --- /dev/null +++ b/wofi/style.css @@ -0,0 +1,27 @@ +/* https://cloudninja.pw/docs/wofi.html */ +window { + border: 2px solid black; + background-color: #333333; +} + +#input { + border: 2px solid black; + background-color: #555555; + font-size: 18px; + color: #fff +} + + +#outer-box { + margin: 10px; +} + +#scroll { + margin: 5px 0px; + font-size: 16px; + color: #ccc; +} + +#scroll label { + margin: 2px 0px; +} \ No newline at end of file diff --git a/wofi/system.sh b/wofi/system.sh new file mode 100755 index 0000000..9bb9e2b --- /dev/null +++ b/wofi/system.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +chosen=$(echo -e "[Cancel]\nLogout\nShutdown\nReboot\nSuspend\nHibernate\nHybrid-sleep\nSuspend-then-hibernate" | wofi --dmenu --insensitive) + +if [[ $chosen = "Logout" ]]; then + swaymsg exit + loginctl terminate-session "$(loginctl session-status | awk 'NR==1{print $1}')" +elif [[ $chosen = "Shutdown" ]]; then + systemctl poweroff +elif [[ $chosen = "Reboot" ]]; then + systemctl reboot +elif [[ $chosen = "Suspend" ]]; then + systemctl suspend +elif [[ $chosen = "Hibernate" ]]; then + systemctl hibernate +elif [[ $chosen = "Hybrid-sleep" ]]; then + systemctl hibernate +elif [[ $chosen = "Suspend-then-hibernate" ]]; then + systemctl suspend-then-hibernate +fi