From ed776c9b0cfb959fe730a48d3d14913ba872e732 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Tue, 24 Nov 2020 08:13:22 +0100 Subject: [PATCH] Add power menu --- arch-config/.config/polybar/.gitkeep | 0 arch-config/.config/polybar/colors.ini | 0 arch-config/.config/polybar/i3config.ini | 2 +- arch-config/.config/polybar/modules/.gitkeep | 0 arch-config/.config/polybar/modules/battery.ini | 0 arch-config/.config/polybar/modules/date.ini | 0 arch-config/.config/polybar/modules/i3.ini | 0 arch-config/.config/polybar/modules/modules.ini | 12 ++++++++++++ arch-config/.config/polybar/modules/volume.ini | 0 arch-config/.config/polybar/modules/weather.ini | 0 arch-config/.config/polybar/modules/xwindow.ini | 0 arch-config/.config/polybar/scripts/.gitkeep | 0 arch-config/.config/polybar/scripts/powermenu | 14 ++++++++++++++ arch-config/.config/polybar/scripts/weather.py | 0 14 files changed, 27 insertions(+), 1 deletion(-) mode change 100644 => 100755 arch-config/.config/polybar/.gitkeep mode change 100644 => 100755 arch-config/.config/polybar/colors.ini mode change 100644 => 100755 arch-config/.config/polybar/i3config.ini mode change 100644 => 100755 arch-config/.config/polybar/modules/.gitkeep mode change 100644 => 100755 arch-config/.config/polybar/modules/battery.ini mode change 100644 => 100755 arch-config/.config/polybar/modules/date.ini mode change 100644 => 100755 arch-config/.config/polybar/modules/i3.ini mode change 100644 => 100755 arch-config/.config/polybar/modules/modules.ini mode change 100644 => 100755 arch-config/.config/polybar/modules/volume.ini mode change 100644 => 100755 arch-config/.config/polybar/modules/weather.ini mode change 100644 => 100755 arch-config/.config/polybar/modules/xwindow.ini mode change 100644 => 100755 arch-config/.config/polybar/scripts/.gitkeep create mode 100755 arch-config/.config/polybar/scripts/powermenu mode change 100644 => 100755 arch-config/.config/polybar/scripts/weather.py diff --git a/arch-config/.config/polybar/.gitkeep b/arch-config/.config/polybar/.gitkeep old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/colors.ini b/arch-config/.config/polybar/colors.ini old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/i3config.ini b/arch-config/.config/polybar/i3config.ini old mode 100644 new mode 100755 index b993834c..fa6c77ac --- a/arch-config/.config/polybar/i3config.ini +++ b/arch-config/.config/polybar/i3config.ini @@ -82,7 +82,7 @@ font-5 = Iosevka:style=bold:size=16;3 ;font-4 = Iosevka Nerd Font:style=Medium:size=7;3 -modules-left = full i3 full left-top right-bot full xwindow full left-top +modules-left = full sysmenu full i3 full left-top right-bot full xwindow full left-top modules-center = modules-right = right-top full date battery full left-bot right-top diff --git a/arch-config/.config/polybar/modules/.gitkeep b/arch-config/.config/polybar/modules/.gitkeep old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/modules/battery.ini b/arch-config/.config/polybar/modules/battery.ini old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/modules/date.ini b/arch-config/.config/polybar/modules/date.ini old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/modules/i3.ini b/arch-config/.config/polybar/modules/i3.ini old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/modules/modules.ini b/arch-config/.config/polybar/modules/modules.ini old mode 100644 new mode 100755 index 3b137a09..1d2eb537 --- a/arch-config/.config/polybar/modules/modules.ini +++ b/arch-config/.config/polybar/modules/modules.ini @@ -84,6 +84,18 @@ format-underline = #7D49B6 ################################################################################ +[module/sysmenu] +type = custom/text +content = " ▶ " +content-background = ${colors.modbackground} +content-foreground = ${colors.foreground} + +click-left = ~/.config/polybar/scripts/powermenu + + +################################################################################ + + [module/backlight] ;https://github.com/jaagr/polybar/wiki/Module:-backlight diff --git a/arch-config/.config/polybar/modules/volume.ini b/arch-config/.config/polybar/modules/volume.ini old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/modules/weather.ini b/arch-config/.config/polybar/modules/weather.ini old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/modules/xwindow.ini b/arch-config/.config/polybar/modules/xwindow.ini old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/scripts/.gitkeep b/arch-config/.config/polybar/scripts/.gitkeep old mode 100644 new mode 100755 diff --git a/arch-config/.config/polybar/scripts/powermenu b/arch-config/.config/polybar/scripts/powermenu new file mode 100755 index 00000000..f2853dbd --- /dev/null +++ b/arch-config/.config/polybar/scripts/powermenu @@ -0,0 +1,14 @@ +#!/bin/bash + +## Created By Aditya Shakya + +MENU="$(rofi -sep "|" -dmenu -i -p 'System' -location 7 -xoffset 5 -yoffset -31 -width 10 -hide-scrollbar -line-padding 4 -padding 20 -lines 6 <<< "Lock|Logout|Reboot|Shutdown|Suspend|Hibernate")" +#MENU="$(rofi -sep "|" -dmenu -i -p 'System' -location 3 -xoffset -10 -yoffset 32 -width 10 -hide-scrollbar -line-padding 4 -padding 20 -lines 4 <<< " Lock| Logout| Reboot| Shutdown|Suspend|Hibernate")" + case "$MENU" in + *Lock) betterlockscreen -l ;; + *Logout) i3-msg exit ;; + *Reboot) systemctl reboot ;; + *Shutdown) systemctl poweroff ;; + *Suspend) betterlockscreen -s ;; + *Hibernate) systemctl hibernate + esac diff --git a/arch-config/.config/polybar/scripts/weather.py b/arch-config/.config/polybar/scripts/weather.py old mode 100644 new mode 100755