From: Siraaj Khandkar Date: Fri, 27 Jul 2018 15:19:20 +0000 (-0400) Subject: Move screen device name to a global constant X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=b251c507360abd695a98727fdfacfa4678084b36;p=khatus.git Move screen device name to a global constant --- diff --git a/bin/khatus_show b/bin/khatus_show index d558264..dd59b14 100755 --- a/bin/khatus_show +++ b/bin/khatus_show @@ -8,6 +8,7 @@ STATUS_FILE__WIFI=$STATUS_DIR/wifi STATUS_FILE__ENERGY_NOTIFIED_BELLOW_HALF=$STATUS_DIR/notified_energy_bellow_half DISK_IO_DEVICE='dm-1' DISK_SPACE_DEVICE='/dev/mapper/kubuntu--vg-root' +SCREEN_DEVICE='acpi_video0' load=$(awk '{printf("%4.2f", $1)}' /proc/loadavg) @@ -277,8 +278,8 @@ volume_pactl=$( volume="($volume_pactl)" screen_brightness=$( - max=$(cat /sys/class/backlight/acpi_video0/max_brightness) - cur=$(cat /sys/class/backlight/acpi_video0/brightness) + max=$(cat /sys/class/backlight/"$SCREEN_DEVICE"/max_brightness) + cur=$(cat /sys/class/backlight/"$SCREEN_DEVICE"/brightness) awk -v max=$max -v cur=$cur 'BEGIN {printf("%d%%", cur/max*100)}' )