From 5203fdc11fe3718ea7a85de6c1dc43e93cbe7ebe Mon Sep 17 00:00:00 2001 From: amolinae06 Date: Wed, 16 Apr 2025 23:03:27 -0600 Subject: [PATCH] updated scripts --- .local/bin/bluetooth | 54 ++++++++++++++++++++++++++++++++++++++++++++ .local/bin/fsss | 4 ++++ .local/bin/nvim | 22 ++++++++++++++++++ .local/bin/rgnss | 2 ++ 4 files changed, 82 insertions(+) create mode 100755 .local/bin/bluetooth create mode 100755 .local/bin/fsss create mode 100755 .local/bin/nvim create mode 100755 .local/bin/rgnss diff --git a/.local/bin/bluetooth b/.local/bin/bluetooth new file mode 100755 index 0000000..239964a --- /dev/null +++ b/.local/bin/bluetooth @@ -0,0 +1,54 @@ +#!/bin/sh -x + +checkstate() { + if [ "$(bluetoothctl show | grep "Powered: yes")" ]; then + echo "󰂯 ON" + else + echo "󰂲 OFF" + fi +} + +switchstate() { + case "$(checkstate | fuzzel -d)" in + "󰂯 ON") + bluetoothctl power off + notify-send "Bluetooth" "Bluetooth is disabled" + ;; + "󰂲 OFF") + echo "Bluetooth is enabled" + bluetoothctl power on + notify-send "Bluetooth" "Bluetooth is enabled" + ;; + *) exit ;; + esac +} + +checkstate() { + if [ "$(bluetoothctl show | grep "Powered: yes")" ]; then + echo "󰂯 ON" + else + echo "󰂲 OFF" + fi +} + +switchstate() { + case "$(checkstate | fuzzel -d)" in + "󰂯 ON") + bluetoothctl power off + notify-send "Bluetooth" "Bluetooth is disabled" + ;; + "󰂲 OFF") + echo "Bluetooth is enabled" + bluetoothctl power on + notify-send "Bluetooth" "Bluetooth is enabled" + ;; + *) exit ;; + esac +} + +case $(printf "%s\n" "󰂯 Connect Device" "󰂳 Change State" | fuzzel -d) in + "󰂯 Connect Device") + echo menu ;; + "󰂳 Change State") switchstate ;; + *) exit ;; +esac diff --git a/.local/bin/fsss b/.local/bin/fsss new file mode 100755 index 0000000..47d80ca --- /dev/null +++ b/.local/bin/fsss @@ -0,0 +1,4 @@ +#!/bin/sh + +# takes a fullscreen screenshot and sends notification afterwards +grim - | wl-copy && notify-send "grim" "screenshot copied to clipboard" diff --git a/.local/bin/nvim b/.local/bin/nvim new file mode 100755 index 0000000..5dc4566 --- /dev/null +++ b/.local/bin/nvim @@ -0,0 +1,22 @@ +#!/bin/sh + +ROOT=""$HOME"/Documents/Miscellaneous/archroot" + +bwrap \ + --dev-bind /dev /dev \ + --tmpfs /tmp \ + --proc /proc \ + --bind "$ROOT"/lib /lib \ + --bind "$ROOT"/lib64 /lib64 \ + --bind "$ROOT"/usr/lib /usr/lib \ + --bind "$ROOT"/usr/lib64 /usr/lib64 \ + --bind "$ROOT"/usr/bin /usr/bin \ + --bind "$ROOT"/bin /bin \ + --bind "$ROOT"/usr/share /usr/share \ + --bind "$ROOT"/etc /etc \ + --ro-bind "$ROOT"/etc/resolv.conf /etc/resolv.conf \ + --bind "$HOME" "$HOME" \ + --setenv "$XDG_RUNTIME_DIR" "$XDG_RUNTIME_DIR" \ + --bind "$XDG_RUNTIME_DIR" "$XDG_RUNTIME_DIR" \ + /usr/bin/nvim "$@" + diff --git a/.local/bin/rgnss b/.local/bin/rgnss new file mode 100755 index 0000000..9fe9405 --- /dev/null +++ b/.local/bin/rgnss @@ -0,0 +1,2 @@ +#!/bin/sh -x +grim -g "$(slurp