1
0
Fork 0

added screen brightness stuff

This commit is contained in:
Kim, Jimin 2022-03-17 23:43:32 +09:00
parent c20838a28c
commit a9fbcf2674
5 changed files with 38 additions and 38 deletions

View file

@ -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

View file

@ -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

View file

@ -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%"

View 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

View file

@ -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")