aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2018-12-12 16:37:23 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2018-12-12 16:37:23 +0100
commiteec7698efec7169432787423bf94bfc7836761d5 (patch)
treeedf96a23099c1f93b753391b01aec82f8bb95d62
parent98c5d04bb264cc903b935897b2188d8f2be4c7a1 (diff)
downloadscripts-eec7698efec7169432787423bf94bfc7836761d5.tar.gz
scripts-eec7698efec7169432787423bf94bfc7836761d5.zip
brightness.sh now behaves different if not yet used.
-rwxr-xr-xbrightness.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/brightness.sh b/brightness.sh
index 946453c..5e4304b 100755
--- a/brightness.sh
+++ b/brightness.sh
@@ -3,6 +3,11 @@
brightness_file=/sys/class/backlight/intel_backlight/brightness
maxbrightness_file=/sys/class/backlight/intel_backlight/max_brightness
+permissions=$(ls -l $brightness_file | awk '{print $1}')
+if [ $permissions != "-rw-rw-rw-" ]; then
+ urxvt -title floating -geometry 32x1 -e sudo ~/scripts/brightFirst.sh
+fi
+
brightness=$(< $brightness_file)
maxbrightness=$(< $maxbrightness_file)
let target=$1+$brightness