diff --git a/bin/.bin/dmenu/rofi-shutdown b/bin/.bin/dmenu/rofi-shutdown index 40b330af..fd8b7f1a 100755 --- a/bin/.bin/dmenu/rofi-shutdown +++ b/bin/.bin/dmenu/rofi-shutdown @@ -1,6 +1,19 @@ #!/usr/bin/sh + +isPhone(){ + case "$(hostname)" in + *-phone) return 0 ;; + *) return 1 ;; + esac +} + if type -p rofi 2> /dev/null; then - alias selectcommand="rofi -dmenu -i -theme themes/power.rasi -me-select-entry '' -me-accept-entry MousePrimary" + if isPhone; then + theme="themes/power-phone.rasi" + else + theme="themes/power.rasi" + fi + alias selectcommand="rofi -dmenu -i -theme $theme -me-select-entry '' -me-accept-entry MousePrimary" shutdown="" reboot="" lock="" @@ -15,24 +28,33 @@ else logout="Logout" fi +hostname="$(hostname)" -selection=$( \ - echo -e "$shutdown\n$reboot\n$lock\n$logout\n$suspend" | selectcommand - ); -echo $selection; +if isPhone; then + selection="$(echo -e "$shutdown\n$reboot\n$lock\n$logout" | selectcommand)" +else + notify-send "Not phone" + selection="$(echo -e "$shutdown\n$reboot\n$lock\n$logout\n$suspend" | selectcommand)" +fi sleep .2 case $selection in $lock) - #i3exit lock + if isPhone; then + screenlock --suspend + else + i3exit lock + fi ;; $logout) pkill dwm ;; $suspend) systemctl suspend - #i3exit lock + if !isPhone; then + i3exit lock + fi ;; $reboot) systemctl reboot diff --git a/rofi/.config/rofi/themes/power-phone.rasi b/rofi/.config/rofi/themes/power-phone.rasi new file mode 100644 index 00000000..22ef9d78 --- /dev/null +++ b/rofi/.config/rofi/themes/power-phone.rasi @@ -0,0 +1,91 @@ +/* + * + * Author : Aditya Shakya + * Mail : adi1090x@gmail.com + * Github : @adi1090x + * Twitter : @adi1090x + * + */ + +configuration { + disable-history: false; + fullscreen: false; + hide-scrollbar: true; + sidebar-mode: false; +} + +@import "gruvbox-dark.rasi" + +* { + background-color: @background; + text-color: @foreground; +} + +window { + transparency: "real"; + border-radius: 12px; + width: 100px; + location: east; + x-offset: -15px; + y-offset: -200px; +} + +listview { + lines: 4; + margin: 8px; + spacing: 8px; + cycle: true; + dynamic: true; + layout: vertical; +} + +mainbox { + background-color: @background; + children: [ listview ]; +} + +element { + background-color: @background-light; + text-color: @foreground; + orientation: vertical; + border-radius: 12px; +} + +element-text { + font: "iosevka 45"; + expand: true; + horizontal-align: 0.5; + vertical-align: 0; + margin: 0px 10px 63px 10px; +} + +element normal.urgent, +element alternate.urgent { + background-color: @urgent; + text-color: @foreground; + border-radius: 10px; +} + +element normal.active, +element alternate.active { + background-color: @background-alt; + text-color: @foreground; +} + +element selected { + background-color: @accent; + text-color: @background; + border: 0px; + border-radius: 10px; + border-color: @border; +} + +element selected.urgent { + background-color: @urgent; + text-color: @foreground; +} + +element selected.active { + background-color: @background-alt; + color: @foreground; +} diff --git a/rofi/.config/rofi/themes/power.rasi b/rofi/.config/rofi/themes/power.rasi index 22ef9d78..a382652f 100644 --- a/rofi/.config/rofi/themes/power.rasi +++ b/rofi/.config/rofi/themes/power.rasi @@ -31,7 +31,7 @@ window { } listview { - lines: 4; + lines: 5; margin: 8px; spacing: 8px; cycle: true;