commit 25f9ebf

hovercats  ·  2022-02-14 00:37:18 +0000 UTC
parent d53d327
add bri script
2 files changed,  +35, -2
M README
A bri
M README
+8, -2
 1@@ -18,5 +18,11 @@ Overview
 2     - Similarly to bmks, it probably works with fzf, rofi etc aswell.
 3 
 4   - dsearch
 5-    - search the web with dmenu
 6-    - only handles searchstrings currently
 7+    - Search the web with dmenu
 8+    - Only handles searchstrings currently
 9+
10+  - bri
11+    - Change screen brightness
12+    - Requires path to brightness file
13+      - Exists in /sys/class/backlight
14+      - Must have read/write access to said file
A bri
+27, -0
 1@@ -0,0 +1,27 @@
 2+#!/bin/sh -e
 3+
 4+# A simple script to change screen brightness.
 5+
 6+# Path to brightness file, which holds value of current brightness
 7+# This path may be different across systems, change it accordingly
 8+# You will also need read/write access to this file
 9+BRI_FILE='/sys/class/backlight/amdgpu_bl0/brightness'
10+CURR_BRI=$(cat "$BRI_FILE")
11+
12+increase () {
13+    echo "$CURR_BRI" + 10 | bc > "$BRI_FILE"
14+}
15+
16+decrease () {
17+    echo "$CURR_BRI" - 10 | bc > "$BRI_FILE"
18+}
19+
20+help () {
21+    echo "Useage:\nUse 'd' or 'i' to decrease or increase screen brightness"
22+}
23+
24+case $1 in
25+    i) increase  ;;
26+    d) decrease  ;;
27+    *) help ;;
28+esac