summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.Xresources48
-rwxr-xr-x.local/bin/backlightctl83
-rw-r--r--.local/share/yadm/archivebin0 -> 14160568 bytes
3 files changed, 131 insertions, 0 deletions
diff --git a/.Xresources b/.Xresources
new file mode 100644
index 0000000..c14fc72
--- /dev/null
+++ b/.Xresources
@@ -0,0 +1,48 @@
+! __ __
+! \ \/ /_ __ ___ ___ ___ _ _ _ __ ___ ___ ___
+! \ /| '__/ _ \/ __|/ _ \| | | | '__/ __/ _ \/ __|
+! / \| | | __/\__ \ (_) | |_| | | | (_| __/\__ \
+! /_/\_\_| \___||___/\___/ \__,_|_| \___\___||___/
+!
+!
+
+! X Resources: Generated with Hodler (http://github.com/matttproud/hodler)
+!black
+*color0: #111a1f
+*color8: #868b8d
+!red
+*color1: #8d7856
+*color9: #810002
+!green
+*color2: #798362
+*color10: #037500
+!yellow
+*color3: #9b9257
+*color11: #ebcb88
+!blue
+*color4: #63768a
+*color12: #63768a
+!magenta
+*color5: #b7416e
+*color13: #738c9c
+!cyan
+*color6: #6998b3
+*color14: #66aabb
+!white
+*color7: #c0c7ca
+*color15: #c0c7ca
+!other
+*background: #222d32
+*foreground: #acb3b5
+*cursorColor: #ebcb88
+! See "highlightColorMode" and "hm" options in XTerm manual page.
+*highlightTextColor: #2e333c
+*highlightColor: #161f2a
+! No support for cursor text coloring; would be #1e232b.
+! No support for bold coloring; would be #626a73.
+
+!other
+*.alpha: 0.80
+
+Sxiv.background: #111A1F
+Sxiv.foreground: #9B9257
diff --git a/.local/bin/backlightctl b/.local/bin/backlightctl
new file mode 100755
index 0000000..d3f6280
--- /dev/null
+++ b/.local/bin/backlightctl
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+# Get the correct sub-directory for your backlight device
+root_path="/sys/class/backlight/"
+device="$(find "$root_path" | tail -n 1)"
+
+max="$(cat "$device/max_brightness")"
+
+# What percentage to increase/decrease by when no argument is given
+default_step=10
+# What percentage to set to when no argument is given
+default_set=50
+
+to_percent() {
+ printf "%d" "$((100 * $1 / $max))"
+}
+
+to_value() {
+ printf "%d" "$((max * $1 / 100))"
+}
+
+get_status() {
+ cat "$device/brightness"
+}
+
+get_percent() {
+ to_percent "$(get_status)"
+}
+
+# Add $1 to current brightness. Adjust if out of bounds (0-$max)
+# $1 is converted to a value between 0-$max within this function
+get_total() {
+ value="$(to_value "$1")"
+ printf "%d" "$(($(get_status) + value))"
+}
+
+helpmsg="Usage: backlightctl -[FLAG] [PERCENTAGE]
+ -i, --increase: Increase brightness by n (default 10%)
+ -d, --decrease: Decrease brightness by n (default 10%)
+ -s, --set: Set brightness to specific value (default 50%)
+ -g --get: Get current brightness
+ -q, --quiet: Don't send any notification (for use in dwmblocks)
+ -h, --help: Print this help message
+"
+
+case "$1" in
+
+-i | --increase)
+ [ -z "$2" ] && step="$default_step" || step="$2"
+ get_total "$step" >"$device/brightness"
+ ;;
+
+-d | --decrease)
+ [ -z "$2" ] && step="$default_step" || step="$2"
+ get_total "-$step" >"$device/brightness"
+ ;;
+
+-s | --set)
+ [ -z "$2" ] && set="$default_set" || set="$2"
+ to_value "$set" >"$device/brightness"
+ ;;
+
+-g | --get)
+ printf "󰃠 %s\n" "$(get_status)%"
+ ;;
+
+-h | --help)
+ printf "%s" "$helpmsg"
+ ;;
+*)
+ printf "\033[31mInvalid option: $1\033[0m\n%s" "$helpmsg" && exit 1
+ ;;
+esac
+
+# Send notification
+case "$@" in
+*-q* | *--quiet*)
+ exit 0
+ ;;
+*)
+ notify-send.sh -t 1000 --replace-file /tmp/bl-notif -a "󰃠 Brightness:" "$(get_percent)%"
+ ;;
+esac
diff --git a/.local/share/yadm/archive b/.local/share/yadm/archive
new file mode 100644
index 0000000..6ac24c8
--- /dev/null
+++ b/.local/share/yadm/archive
Binary files differ