summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbl-save8
-rwxr-xr-xportprocess14
2 files changed, 22 insertions, 0 deletions
diff --git a/bl-save b/bl-save
new file mode 100755
index 0000000..2262892
--- /dev/null
+++ b/bl-save
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+LIST="$(brightnessctl -l)"
+SCREEN="$(echo "$LIST" | grep "class 'backlight'" | cut -d"'" -f2)"
+KEYBOARD="$(echo "$LIST" | grep 'kbd_backlight' | cut -d"'" -f2)"
+
+brightnessctl -sd "${SCREEN}"
+brightnessctl -sd "${KEYBOARD}"
diff --git a/portprocess b/portprocess
new file mode 100755
index 0000000..f422ed7
--- /dev/null
+++ b/portprocess
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+error () {
+ printf "%s\n" "$@"
+ exit 1
+}
+
+[ -z "$1" ] && error "Please provide a port to check!"
+
+PID="$(sudo fuser "$1/tcp" 2>&1 | awk '{print $2}')"
+[ -n "$PID" ] || error "No program using port $1!"
+
+BINPATH="$(\ps "$PID" | awk '{print $5}')"
+basename "$BINPATH"