summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-07 13:02:03 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-07 13:02:03 +0900
commit8b53277b492831109a1e1a8d7d4c5753d9d48fa2 (patch)
tree0c5c26837160f223a762aa9ef48cbff3149e6143
parent83487d66031d2576f7336de20f0900b7264a391b (diff)
modified bin/bookmarks, modified bin/dmenuconnections, modified bin/getkeys, modified bin/qndl, modified statusbar/sb-internet
-rwxr-xr-xar/.local/bin/bookmarks4
-rwxr-xr-xar/.local/bin/dmenuconnections4
-rwxr-xr-xar/.local/bin/getkeys7
-rwxr-xr-xar/.local/bin/qndl2
-rwxr-xr-xar/.local/bin/statusbar/sb-internet8
5 files changed, 12 insertions, 13 deletions
diff --git a/ar/.local/bin/bookmarks b/ar/.local/bin/bookmarks
index b24a4b9..80f6d64 100755
--- a/ar/.local/bin/bookmarks
+++ b/ar/.local/bin/bookmarks
@@ -120,9 +120,7 @@ openinbrowser() {
}
geturls() {
- [ -f ~/.local/share/thesiah/urls ] &&
- URLS=$(cat ~/.local/share/thesiah/snippets ~/.local/share/thesiah/urls) ||
- URLS=$(cat ~/.local/share/thesiah/snippets)
+ URLS=$(cat ~/.local/share/thesiah/snippets ~/.local/share/thesiah/urls)
CHOICE=$(echo "$URLS" | grep -v -e '^#' -e '^$' | awk -F'"' '{print $2}' | dmenu -i -l 50 -p "Choose a URL $1:")
[ -z "$CHOICE" ] && exit
URL=$(echo "$URLS" | grep -v -e '^#' -e '^$' | grep "\"$CHOICE\"" | awk '{print $1}')
diff --git a/ar/.local/bin/dmenuconnections b/ar/.local/bin/dmenuconnections
index cc39771..cf8e9cf 100755
--- a/ar/.local/bin/dmenuconnections
+++ b/ar/.local/bin/dmenuconnections
@@ -10,10 +10,10 @@
# networkmanager_dmenu (https://github.com/firecat53/networkmanager-dmenu)
# btmenu (https://github.com/cdown/btmenu)
-[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡"
+grep -q 'down' /sys/class/net/w*/operstate && wifiicon="❌"
[ -z "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "🛜", int($3 * 100 / 70) "%" }')
-wifi=$(printf "%s %s" "${wifiicon}" "$(cat /sys/class/net/w*/operstate | sed "s/down/❎/;s/up/🌐/")")
+wifi=$(printf "%s %s" "${wifiicon}" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)")
if [ -n "${wifi}" ]; then
choice=$(printf 'bluetooth\nnetwork\nwifi' | dmenu -i -p "${wifi}")
diff --git a/ar/.local/bin/getkeys b/ar/.local/bin/getkeys
index 79a7872..492b056 100755
--- a/ar/.local/bin/getkeys
+++ b/ar/.local/bin/getkeys
@@ -1,6 +1,7 @@
#!/bin/sh
# Print available keys from thesiah
-cat "${XDG_DATA_HOME:-${HOME}/.local/share}"/thesiah/keys/"$1" 2>/dev/null && exit
-echo "Run command with one of the following arguments for info about that program:"
-ls "${XDG_DATA_HOME:-${HOME}/.local/share}"/thesiah/keys
+[ -n "$1" ] && cat "${XDG_DATA_HOME:-${HOME}/.local/share}"/thesiah/keys/"$1" 2>/dev/null && exit
+keys_dir="${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/keys"
+selected_file=$(du -a "$keys_dir" | cut -f2- | sed "s|$keys_dir/||" | fzf)
+[ -n "$selected_file" ] && cat "$keys_dir/$selected_file"
diff --git a/ar/.local/bin/qndl b/ar/.local/bin/qndl
index 4444130..0a4e954 100755
--- a/ar/.local/bin/qndl
+++ b/ar/.local/bin/qndl
@@ -82,7 +82,7 @@ case $url in
playlisttitle=$(yt-dlp -s -O "%(playlist_title)s" "$url" | head -n 1 | sed 's/, /,/g;s/[\/:*?"<>| ]/-/g' | tr '[:upper:]' '[:lower:]') &&
subdest="$channel/$playlisttitle" &&
mkdir -p "$dest/$subdest" &&
- output="$dest/$subdest/%(playlist_index)02d_%(title)s [%(id)s].%(ext)s"
+ output="$dest/$subdest/%(playlist_index)02d. %(title)s [%(id)s].%(ext)s"
;;
esac
diff --git a/ar/.local/bin/statusbar/sb-internet b/ar/.local/bin/statusbar/sb-internet
index c9180b3..df43676 100755
--- a/ar/.local/bin/statusbar/sb-internet
+++ b/ar/.local/bin/statusbar/sb-internet
@@ -21,14 +21,14 @@ case $BLOCK_BUTTON in
esac
# Wifi
-if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ]; then
+if grep -q 'up' /sys/class/net/w*/operstate; then
wifiicon="$(awk '/^\s*w/ { print "🛜" int($3 * 100 / 70) "%" }' /proc/net/wireless)"
-elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ]; then
- [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="📡" || wifiicon="❌"
+elif grep -q 'down' /sys/class/net/w*/operstate; then
+ grep -q '0x1003' /sys/class/net/w*/flags && wifiicon="📡" || wifiicon="❌"
fi
# Ethernet
-[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="❎"
+grep -q 'up' /sys/class/net/e*/operstate && ethericon="🌐" || ethericon="❎"
# TUN
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="🛰️"