Add a luminosity script (polybar plugin not working)

master
Quentin Duchemin 2019-11-19 16:31:30 +01:00
parent 7ddc7cac46
commit 0bc1e6afda
Signed by: Chosto
GPG Key ID: 0547178FEEDE7D6B
4 changed files with 18 additions and 5 deletions

View File

@ -14,9 +14,13 @@ workspace 6 output HDMI-0
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -D hw:PCH -M sset Master 5%+
bindsym XF86AudioLowerVolume exec --no-startup-id aimxer -D hw:PCH -M sset Master 5%-
bindsym XF86AudioMute exec --no-startup-id amixer -D hw:PCH -M sset 'Master' toggle
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioPrev exec --no-startup-ip playerctl prev
bindsym XF86AudioNext exec --no-startup-id playerctl next
# Luminosity on laptop (not xorg-xbacklight but the compatible and working acpilight)
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10 -steps 200
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10 -steps 200
bindsym XF86KbdBrightnessDown exec --no-startup-id xbacklight -ctrl asus::kbd_backlight -dec 30
bindsym XF86KbdBrightnessUp exec --no-startup-id xbacklight -ctrl asus::kbd_backlight -inc 30
# set DPI along with .Xresources
exec xrandr --dpi 160

View File

@ -4,7 +4,12 @@ height = 54
wireless_interface = wlp2s0
top_left = powermenu system-uptime-pretty battery
top_center = xwindow
top_right = system-usb-udev pulseaudio date
top_right = system-usb-udev luminosity pulseaudio date
[module/luminosity]
type = custom/script
exec = ~/.config/polybar/scripts/luminosity.sh
interval = 1
[module/pulseaudio]
type = internal/pulseaudio

View File

@ -0,0 +1,4 @@
#!/bin/bash
lum=$(xbacklight -get)
echo "%{F#77dd77}☀️%{F#ddd} ${lum}%"