aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/backlight13
-rwxr-xr-xbin/xorg_autolock25
2 files changed, 9 insertions, 29 deletions
diff --git a/bin/backlight b/bin/backlight
index ac8a466..be0dadf 100755
--- a/bin/backlight
+++ b/bin/backlight
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
-# set backlight through sysfs
+#
+# Sets backlight through /sys/class/backlight/intel_backlight/brightness
+# Note: This requires the file to be user-writable!
+# Changes can be applied either by (positive or negative) relative increment
+# [-i] or as an absolute value [-s] (in percentage).
set -euo pipefail
@@ -70,8 +74,8 @@ set_brightness() {
}
print_help() {
- echo -e "Usage:\n $0 -d <decrement_by_x_percent> \n or $0 -i <increment_by_x_percent>"
- exit 1
+ echo -e "Usage: $0 [-i <increment_in_percent>] [-s <brightness_in_percent>]"
+ exit 0
}
if [ ${#@} -gt 0 ]; then
@@ -93,7 +97,8 @@ if [ ${#@} -gt 0 ]; then
esac
done
else
- print_help
+ echo "$current_brightness_percentage"
+ exit 0
fi
set_brightness
diff --git a/bin/xorg_autolock b/bin/xorg_autolock
deleted file mode 100755
index 181548e..0000000
--- a/bin/xorg_autolock
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-lock=${XDG_RUNTIME_DIR}/xorg_autolock.lock
-lock_block=${XDG_RUNTIME_DIR}/xorg_autolock_block
-lock_cmd="$HOME/bin/xorg_lock"
-lockafter=600000
-
-rm -f "${lock}" "${lock_block}"
-
-while true; do
- if [ ! -f "${lock}" ] && [ ! -f "${lock_block}" ];then
- if [ -x "/usr/bin/xssstate" ]; then
- if [ "$(xssstate -i)" -ge $lockafter ] && [ -x "$lock_cmd" ]; then
- $lock_cmd
- fi
- else
- echo "xssstate is note installed!"
- exit 1
- fi
- fi
-
- sleep 1
-done