Add power menu to polybar
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
7bf11a5cdb
commit
6270596a5d
5 changed files with 50 additions and 10 deletions
|
@ -61,7 +61,6 @@ LINKED_FILES_HOME=(
|
||||||
SYSTEMD_SERVICES=(
|
SYSTEMD_SERVICES=(
|
||||||
"bumblebeed"
|
"bumblebeed"
|
||||||
"cronie"
|
"cronie"
|
||||||
"lightdm"
|
|
||||||
"wicd"
|
"wicd"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -102,4 +101,4 @@ print_header "Enabling systemd services"
|
||||||
for service in "${SYSTEMD_SERVICES[@]}"
|
for service in "${SYSTEMD_SERVICES[@]}"
|
||||||
do
|
do
|
||||||
enable_service "${service}"
|
enable_service "${service}"
|
||||||
done
|
done
|
||||||
|
|
|
@ -13,8 +13,8 @@ set $mod Mod4
|
||||||
set $alt Mod1
|
set $alt Mod1
|
||||||
|
|
||||||
# Monitors
|
# Monitors
|
||||||
set $output1 HDMI1
|
set $output1 HDMI-1
|
||||||
set $output2 eDP1
|
set $output2 eDP-1
|
||||||
|
|
||||||
# Workspaces
|
# Workspaces
|
||||||
set $workspace1 "1: "
|
set $workspace1 "1: "
|
||||||
|
@ -205,7 +205,7 @@ bindsym $mod+$alt+Right move workspace to output right
|
||||||
exec xrdb -merge $HOME/.Xresources
|
exec xrdb -merge $HOME/.Xresources
|
||||||
|
|
||||||
# Compton
|
# Compton
|
||||||
exec --no-startup-id compton
|
exec --no-startup-id compton -b
|
||||||
|
|
||||||
# Background-Image
|
# Background-Image
|
||||||
exec_always --no-startup-id feh --bg-fill $HOME/GoogleDrive/02_Media/Images/01_Wallpaper/Desktop/Fearsome_Awakening.png
|
exec_always --no-startup-id feh --bg-fill $HOME/GoogleDrive/02_Media/Images/01_Wallpaper/Desktop/Fearsome_Awakening.png
|
||||||
|
|
|
@ -14,7 +14,7 @@ background = #222D32
|
||||||
foreground = #A1B0B8
|
foreground = #A1B0B8
|
||||||
|
|
||||||
[bar/top]
|
[bar/top]
|
||||||
monitor = HDMI1
|
monitor = HDMI-1
|
||||||
width = 100%
|
width = 100%
|
||||||
height = 35
|
height = 35
|
||||||
offset-x = 0
|
offset-x = 0
|
||||||
|
@ -33,7 +33,7 @@ font-3 = siji:pixelsize=12;3
|
||||||
|
|
||||||
modules-left = i3
|
modules-left = i3
|
||||||
modules-center = xwindow
|
modules-center = xwindow
|
||||||
modules-right = battery volume backlight wlan date
|
modules-right = battery volume backlight wlan date power
|
||||||
separator = |
|
separator = |
|
||||||
|
|
||||||
#wm-restack = i3
|
#wm-restack = i3
|
||||||
|
@ -45,7 +45,7 @@ tray-position = right
|
||||||
|
|
||||||
[bar/top2]
|
[bar/top2]
|
||||||
inherit = bar/top
|
inherit = bar/top
|
||||||
monitor = eDP1
|
monitor = eDP-1
|
||||||
|
|
||||||
|
|
||||||
[module/i3]
|
[module/i3]
|
||||||
|
@ -139,7 +139,7 @@ format-connected = %{A1:wicd-client -n:}<ramp-signal> <label-connected>%{A}
|
||||||
format-connected-underline = #9f78e1
|
format-connected-underline = #9f78e1
|
||||||
label-connected = %essid%
|
label-connected = %essid%
|
||||||
|
|
||||||
format-disconnected =
|
format-disconnected = Disconnected
|
||||||
;format-disconnected = <label-disconnected>
|
;format-disconnected = <label-disconnected>
|
||||||
;format-disconnected-underline = ${self.format-connected-underline}
|
;format-disconnected-underline = ${self.format-connected-underline}
|
||||||
;label-disconnected = %ifname% disconnected
|
;label-disconnected = %ifname% disconnected
|
||||||
|
@ -175,3 +175,11 @@ label = %output%%
|
||||||
scroll-up = light -A 5
|
scroll-up = light -A 5
|
||||||
scroll-down = light -U 5
|
scroll-down = light -U 5
|
||||||
interval = 0.1
|
interval = 0.1
|
||||||
|
|
||||||
|
[module/power]
|
||||||
|
type = custom/script
|
||||||
|
exec = echo -e "\uf011"
|
||||||
|
format = <label>
|
||||||
|
label = %output%
|
||||||
|
interval = 5
|
||||||
|
click-left = $HOME/bin/power.sh
|
33
system/bin/power.sh
Executable file
33
system/bin/power.sh
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# SCRIPT NAME:
|
||||||
|
# power.sh
|
||||||
|
#
|
||||||
|
# AUTHOR:
|
||||||
|
# Severin Kaderli <severin.kaderli@gmail.com>
|
||||||
|
#
|
||||||
|
# DESCRIPTION:
|
||||||
|
# Displays a power menu using zenity.
|
||||||
|
#
|
||||||
|
# USAGE:
|
||||||
|
# ./power.sh
|
||||||
|
|
||||||
|
TEXT="Choose action"
|
||||||
|
WIDTH=400
|
||||||
|
HEIGHT=200
|
||||||
|
ACTIONS=(
|
||||||
|
"Reboot"
|
||||||
|
"Shutdown"
|
||||||
|
)
|
||||||
|
|
||||||
|
action=$(zenity --list --width="${WIDTH}" --height="${HEIGHT}" --text="${TEXT}" --column="Action" "${ACTIONS[@]}")
|
||||||
|
|
||||||
|
echo "$action"
|
||||||
|
if [ "${action}" == "Reboot" ]
|
||||||
|
then
|
||||||
|
systemctl reboot
|
||||||
|
elif [ "${action}" == "Shutdown" ]
|
||||||
|
then
|
||||||
|
systemctl poweroff
|
||||||
|
fi
|
||||||
|
|
|
@ -13,4 +13,4 @@
|
||||||
# USAGE:
|
# USAGE:
|
||||||
# ./resolution.sh
|
# ./resolution.sh
|
||||||
#xrandr --setprovideroutputsource modesetting NVIDIA-0
|
#xrandr --setprovideroutputsource modesetting NVIDIA-0
|
||||||
xrandr --output HDMI3 --off --output HDMI2 --off --output HDMI1 --mode 1280x1024 --pos 80x56 --rotate normal --output eDP1 --primary --mode 1920x1080 --pos 1360x0 --rotate normal --output DP3 --off --output DP2 --off --output DP1 --off
|
xrandr --output HDMI3 --off --output HDMI2 --off --output HDMI-1 --mode 1280x1024 --pos 80x56 --rotate normal --output eDP-1 --primary --mode 1920x1080 --pos 1360x0 --rotate normal --output DP3 --off --output DP2 --off --output DP1 --off
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue