summaryrefslogtreecommitdiff
path: root/keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard')
-rwxr-xr-xkeyboard/dmenunametag30
-rwxr-xr-xkeyboard/dockfanctl10
-rwxr-xr-xkeyboard/sinkswitch15
-rwxr-xr-xkeyboard/volcon3
-rwxr-xr-xkeyboard/wgconnect40
5 files changed, 0 insertions, 98 deletions
diff --git a/keyboard/dmenunametag b/keyboard/dmenunametag
deleted file mode 100755
index 0458c79..0000000
--- a/keyboard/dmenunametag
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-numtags=9
-rcn="Remove Current Name"
-defnames="$rcn\nCode\nCompile\nTest\nDebug\nEdit"
-while !([ $tagnum -ge 1 2>/dev/null ] && [ $tagnum -le $numtags ]); do
- tagnum=$(seq $numtags | dmenu -p "Choose tag: ")
- [ "$tagnum" = "" ] && exit
-done
-name="$(echo -n "$defnames" | dmenu -p "Rename tag $tagnum to: ")"
-[ "$name" = "$rcn" ] \
- && nametag $tagnum r \
- || nametag $tagnum n "$name"
-
-# Force bar to update by setting the root name to itself since there is currently a bug in the window manager
-#xsetroot -name "$(xprop -root WM_NAME | sed -n 's/^WM_NAME(STRING) = \"\(.*\)\"/\1/p')"
-
-# Old mode
-#while [ "$action" != "Rename" ] && [ "$action" != "Remove" ]; do
-# action=$(echo -n "Rename\nRemove" | dmenu -p "Would you like to rename or remove this tag $tagnum's label? ")
-# [ "$action" = "" ] && exit
-#done
-#case $action in
-# Rename)
-# name="$(echo -n "$defnames" | dmenu -p "Rename tag $tagnum to: ")"
-# [ "$name" = "" ] && exit
-# nametag $tagnum n "$name"
-# ;;
-# Remove) nametag $tagnum r ;;
-# *) exit ;;
-#esac
diff --git a/keyboard/dockfanctl b/keyboard/dockfanctl
deleted file mode 100755
index f422b3e..0000000
--- a/keyboard/dockfanctl
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-hub=$(doas uhubctl | grep -B3 'Port 3: .* highspeed enable connect .* Lenovo USB2.0 Hub' | grep -o -m1 '[0-9][^ ]*' | head -n1)
-! [ "$hub" ] && exit 1
-
-echo $hub
-
-case $1 in
- off) doas uhubctl -a off -p 4 -l $hub ;;
- on) doas uhubctl -a on -p 4 -l $hub ;;
-esac
diff --git a/keyboard/sinkswitch b/keyboard/sinkswitch
deleted file mode 100755
index 3046498..0000000
--- a/keyboard/sinkswitch
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-[ $(hostname) != 'T495' ] && echo "Not T495. Exiting" && exit 1
-
-status="$(wpctl status)"
-
-headphones_sink=$(echo "$status" | grep -m1 'ThinkPad USB-C Dock Gen2 USB Audio Analog Stereo \[vol:' | grep -m1 -o '[0-9]*')
-speakers_sink=$( echo "$status" | grep -m1 'Raven/Raven2/Fenghuang HDMI/DP Audio Controller Digital Stereo (HDMI 2) \[vol:' | grep -m1 -o '[0-9]*')
-
-selected_sink=$(echo "$status" | grep -m1 '\*\s*[0-9]*' | grep -o '[0-9]*')
-
-case $selected_sink in
- $headphones_sink) wpctl set-default $speakers_sink && echo "Switched to speakers" ;;
- $speakers_sink) wpctl set-default $headphones_sink && echo "Switched to headphones" ;;
- *) echo "Cannot find correct sink. Exiting" && exit 1 ;;
-esac
diff --git a/keyboard/volcon b/keyboard/volcon
deleted file mode 100755
index 9940c67..0000000
--- a/keyboard/volcon
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-amixer -D pipewire sset Master $1 > /dev/null
-dwmsbup 10
diff --git a/keyboard/wgconnect b/keyboard/wgconnect
deleted file mode 100755
index de8f307..0000000
--- a/keyboard/wgconnect
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-# Connect to/disconnect from wireguard tunnel using dmenu
-
-sudo="${SUDO:-sudo}"
-pass="$(xsudo --get-pass)"
-
-ssudo() { echo "$pass" | $sudo $@ ; }
-
-dmenu_confirm_continue() {
- case "$(echo "yes\nno" | dmenu -p "$1")" in
- yes)
- ;;
- *) exit 0 ;;
- esac
-}
-
-curtun="$(ssudo wg show | sed 's/interface: //;q')"
-
-# Ask to disconnect from current interface
-if [ -n "$curtun" ]; then
- dmenu_confirm_continue "Currently connected to tunnel $curtun. Disconnect?"
-
- output="$(ssudo wg-quick down "$curtun" 2>&1)"
- notify-send "Disconnected from $curtun" "$output"
-
- dmenu_confirm_continue "Connect to another interface?"
-fi
-
-# Connect to new interface
-tundir=/etc/wireguard
-
-tun="$tundir/$(ssudo ls "$tundir" | grep "\.conf$" | dmenu -p "Connect to which tunnel?")"
-
-if ! ssudo cat $tun >/dev/null 2>/dev/null; then
- notify-send "Couldn't connect to tunnel $tun"
- exit 1
-fi
-
-output="$(ssudo wg-quick up "$tun" 2>&1)"
-notify-send "Connected to $tun" "$output"