Add power menu to polybar

Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
Severin Kaderli 2018-12-24 19:16:28 +01:00
parent 7bf11a5cdb
commit 6270596a5d
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
5 changed files with 50 additions and 10 deletions

View file

@ -61,7 +61,6 @@ LINKED_FILES_HOME=(
SYSTEMD_SERVICES=(
"bumblebeed"
"cronie"
"lightdm"
"wicd"
)
@ -102,4 +101,4 @@ print_header "Enabling systemd services"
for service in "${SYSTEMD_SERVICES[@]}"
do
enable_service "${service}"
done
done

View file

@ -13,8 +13,8 @@ set $mod Mod4
set $alt Mod1
# Monitors
set $output1 HDMI1
set $output2 eDP1
set $output1 HDMI-1
set $output2 eDP-1
# Workspaces
set $workspace1 "1: "
@ -205,7 +205,7 @@ bindsym $mod+$alt+Right move workspace to output right
exec xrdb -merge $HOME/.Xresources
# Compton
exec --no-startup-id compton
exec --no-startup-id compton -b
# Background-Image
exec_always --no-startup-id feh --bg-fill $HOME/GoogleDrive/02_Media/Images/01_Wallpaper/Desktop/Fearsome_Awakening.png

View file

@ -14,7 +14,7 @@ background = #222D32
foreground = #A1B0B8
[bar/top]
monitor = HDMI1
monitor = HDMI-1
width = 100%
height = 35
offset-x = 0
@ -33,7 +33,7 @@ font-3 = siji:pixelsize=12;3
modules-left = i3
modules-center = xwindow
modules-right = battery volume backlight wlan date
modules-right = battery volume backlight wlan date power
separator = |
#wm-restack = i3
@ -45,7 +45,7 @@ tray-position = right
[bar/top2]
inherit = bar/top
monitor = eDP1
monitor = eDP-1
[module/i3]
@ -139,7 +139,7 @@ format-connected = %{A1:wicd-client -n:}<ramp-signal> <label-connected>%{A}
format-connected-underline = #9f78e1
label-connected = %essid%
format-disconnected =
format-disconnected = Disconnected
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
@ -175,3 +175,11 @@ label = %output%%
scroll-up = light -A 5
scroll-down = light -U 5
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
View 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

View file

@ -13,4 +13,4 @@
# USAGE:
# ./resolution.sh
#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