added screen brightness stuff
This commit is contained in:
parent
c20838a28c
commit
a9fbcf2674
5 changed files with 38 additions and 38 deletions
|
@ -9,6 +9,9 @@ pgrep -x sxhkd >/dev/null || sxhkd &
|
|||
# top bar
|
||||
$HOME/.config/polybar/launch.sh
|
||||
|
||||
# restore screen brightness
|
||||
brightnessctl --restore
|
||||
|
||||
# wallpaper
|
||||
nitrogen --set-zoom /media/pomp/data/Pictures/Wallpapers/cozy_blur.png
|
||||
|
||||
|
|
|
@ -34,6 +34,6 @@ font-1 = "feather:size=10;3"
|
|||
|
||||
modules-left = workspaces
|
||||
modules-center = date
|
||||
modules-right = alsa updates
|
||||
modules-right = brightness alsa updates
|
||||
|
||||
tray-position = right
|
||||
|
|
|
@ -1,45 +1,17 @@
|
|||
[module/brightness]
|
||||
;type = internal/xbacklight
|
||||
type = internal/backlight
|
||||
type = custom/script
|
||||
|
||||
; Use the following command to list available cards:
|
||||
; $ ls -1 /sys/class/backlight/
|
||||
;card = intel_backlight
|
||||
card = amdgpu_bl0
|
||||
exec = ~/.config/polybar/scripts/brightness.sh --restore
|
||||
|
||||
; Available tags:
|
||||
; <label> (default)
|
||||
; <ramp>
|
||||
; <bar>
|
||||
format = <ramp> <bar>
|
||||
click-left = ~/.config/polybar/scripts/brightness.sh --reset
|
||||
scroll-up = ~/.config/polybar/scripts/brightness.sh --inc
|
||||
scroll-down = ~/.config/polybar/scripts/brightness.sh --dec
|
||||
|
||||
format = <label>
|
||||
format-background = ${color.background-alt}
|
||||
format-foreground = ${color.foreground}
|
||||
format-overline = ${color.background}
|
||||
format-underline = ${color.background}
|
||||
format-padding = 2
|
||||
|
||||
; Available tokens:
|
||||
; %percentage% (default)
|
||||
label = %percentage%%
|
||||
|
||||
; Only applies if <ramp> is used
|
||||
ramp-0 =
|
||||
ramp-1 =
|
||||
ramp-2 =
|
||||
ramp-3 =
|
||||
ramp-4 =
|
||||
|
||||
; Only applies if <bar> is used
|
||||
bar-width = 10
|
||||
bar-gradient = false
|
||||
|
||||
bar-indicator = ${bar.indicator}
|
||||
bar-indicator-foreground = ${color.foreground}
|
||||
|
||||
bar-fill = ${bar.fill}
|
||||
bar-foreground-0 = ${color.foreground}
|
||||
bar-foreground-1 = ${color.foreground}
|
||||
bar-foreground-2 = ${color.foreground}
|
||||
|
||||
bar-empty = ${bar.empty}
|
||||
bar-empty-foreground = ${color.foreground}
|
||||
label = " %output%"
|
||||
|
|
25
home/pomp/.config/polybar/scripts/brightness.sh
Executable file
25
home/pomp/.config/polybar/scripts/brightness.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
case "$1" in
|
||||
--reset) brightnessctl s 50% &>/dev/null ;;
|
||||
|
||||
--restore) brightnessctl --restore &>/dev/null ;;
|
||||
|
||||
--inc) brightnessctl s +10% &>/dev/null ;;
|
||||
|
||||
--dec) brightnessctl s 10%- &>/dev/null ;;
|
||||
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
percentage=$((100 * $(brightnessctl get) / $(brightnessctl max)))
|
||||
|
||||
if ((percentage >= 90)); then
|
||||
echo ""
|
||||
elif ((percentage >= 60)); then
|
||||
echo ""
|
||||
elif ((percentage >= 30)); then
|
||||
echo ""
|
||||
elif ((percentage >= 0)); then
|
||||
echo ""
|
||||
fi
|
|
@ -7,7 +7,7 @@ name = "polybar"
|
|||
def setup():
|
||||
"""Top bar thingy"""
|
||||
|
||||
pamac_install(["polybar", "ttf-iosevka-nerd"])
|
||||
pamac_install(["polybar", "brightnessctl", "ttf-iosevka-nerd"])
|
||||
|
||||
# remove existing files
|
||||
remove_directory("~/.config/polybar")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue