From 7e77b603ade5982f17c2bdf622f4059bf001fcb8 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 18 Apr 2024 10:30:15 +0100 Subject: (Scripts)~datetime script uses different icon --- Scripts/.local/scripts/status/datetime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Scripts') diff --git a/Scripts/.local/scripts/status/datetime b/Scripts/.local/scripts/status/datetime index c688bb5..65ebe14 100755 --- a/Scripts/.local/scripts/status/datetime +++ b/Scripts/.local/scripts/status/datetime @@ -1,2 +1,2 @@ #!/usr/bin/env bash -echo " $(date +'%A %d %b %R')" +echo " $(date +'%A %d %b %R')" -- cgit v1.2.3-13-gbd6f From c76475e427c788ae24e12e283cb07607f89c6526 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 19 Apr 2024 04:39:42 +0530 Subject: (Emacs/*)~cleaning up --- Scripts/.local/scripts/status/memory | 2 +- Scripts/.local/scripts/status/volume | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Scripts') diff --git a/Scripts/.local/scripts/status/memory b/Scripts/.local/scripts/status/memory index fae4dea..2d1c328 100755 --- a/Scripts/.local/scripts/status/memory +++ b/Scripts/.local/scripts/status/memory @@ -11,4 +11,4 @@ then emacs="N/A" fi -echo "⾎ $(printf "%dMB" $used) $value% ->  $emacs" +echo "⾝ $(printf "%dMB" $used) $value% -> $emacs" diff --git a/Scripts/.local/scripts/status/volume b/Scripts/.local/scripts/status/volume index eedd657..4355094 100755 --- a/Scripts/.local/scripts/status/volume +++ b/Scripts/.local/scripts/status/volume @@ -1,2 +1,2 @@ #!/usr/bin/env bash -echo "" $(pamixer --get-volume-human) +echo " $(pamixer --get-volume-human)" -- cgit v1.2.3-13-gbd6f From 95edd754ca0b924f26a2e9b3db69e560877dd719 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 23 Apr 2024 16:55:29 +0530 Subject: (Scripts)+labelled_terminals This script creates n labelled terminals, where n is passed in as a command line argument. This makes demonstrating and understanding differing layouts in say DWM or some other window manager easier as we can directly see how the stack changes based on operations. --- Scripts/.local/scripts/labelled_terminals | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 Scripts/.local/scripts/labelled_terminals (limited to 'Scripts') diff --git a/Scripts/.local/scripts/labelled_terminals b/Scripts/.local/scripts/labelled_terminals new file mode 100755 index 0000000..2f72a95 --- /dev/null +++ b/Scripts/.local/scripts/labelled_terminals @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +for v in $(seq 1 $1) +do + $TERMINAL -e sh -c "figlet ${v} && echo \"Press any key to exit...\" && read" & + sleep 0.5 +done -- cgit v1.2.3-13-gbd6f From e172610a69e13be9cb058464b9c66b888e866d27 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 23 Apr 2024 16:58:01 +0530 Subject: (Scripts)+scripts to grab/open links and copy output for st --- Scripts/.local/scripts/st-scripts/link-grab.sh | 23 +++++++++++++++++++++++ Scripts/.local/scripts/st-scripts/output-copy.sh | 13 +++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 Scripts/.local/scripts/st-scripts/link-grab.sh create mode 100755 Scripts/.local/scripts/st-scripts/output-copy.sh (limited to 'Scripts') diff --git a/Scripts/.local/scripts/st-scripts/link-grab.sh b/Scripts/.local/scripts/st-scripts/link-grab.sh new file mode 100755 index 0000000..e8eee52 --- /dev/null +++ b/Scripts/.local/scripts/st-scripts/link-grab.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# From https://github.com/LukeSmithxyz/st + +urlregex="(((http|https|gopher|gemini|ftp|ftps|git)://|www\\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)" + +urls="$(sed 's/.*│//g' | tr -d '\n' | # First remove linebreaks and mutt sidebars: + grep -aEo "$urlregex" | # grep only urls as defined above. + uniq | # Ignore neighboring duplicates. + sed "s/\(\.\|,\|;\|\!\\|\?\)$//; + s/^www./http:\/\/www\./")" # xdg-open will not detect url without http + +[ -z "$urls" ] && exit 1 + +while getopts "hoc" o +do + case "${o}" in + h) printf "Optional arguments for custom use:\\n -c: copy\\n -o: xdg-open\\n -h: Show this message\\n" && exit 1 ;; + o) chosen="$(echo "$urls" | dmenu -i -p 'Follow which url?' -l 10)" + setsid xdg-open "$chosen" >/dev/null 2>&1 & ;; + c) echo "$urls" | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard ;; + *) printf "Invalid option: -%s\\n" "$OPTARG" && exit 1 ;; + esac +done diff --git a/Scripts/.local/scripts/st-scripts/output-copy.sh b/Scripts/.local/scripts/st-scripts/output-copy.sh new file mode 100755 index 0000000..6ce52ee --- /dev/null +++ b/Scripts/.local/scripts/st-scripts/output-copy.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# From https://github.com/LukeSmithxyz/st + +# By Jaywalker and Luke + +tmpfile=$(mktemp /tmp/st-cmd-output.XXXXXX) +trap 'rm "$tmpfile"' 0 1 15 +sed -n "w $tmpfile" +sed -i 's/\x0//g' "$tmpfile" +ps1="$(grep "\S" "$tmpfile" | tail -n 1 | sed 's/^\s*//' | cut -d' ' -f1)" +chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')" +eps1="$(echo "$ps1" | sed 's/[^^]/[&]/g; s/\^/\\^/g')" +awk "/^$chosen$/{p=1;print;next} p&&/$eps1/{p=0};p" "$tmpfile" | xclip -selection clipboard -- cgit v1.2.3-13-gbd6f From ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 23 Apr 2024 17:06:01 +0530 Subject: (Scripts/status)~bluetooth-status now prints battery info if found --- Scripts/.local/scripts/status/bluetooth-status | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Scripts') diff --git a/Scripts/.local/scripts/status/bluetooth-status b/Scripts/.local/scripts/status/bluetooth-status index c34694c..6de5422 100755 --- a/Scripts/.local/scripts/status/bluetooth-status +++ b/Scripts/.local/scripts/status/bluetooth-status @@ -1,9 +1,15 @@ #!/usr/bin/env sh name=$(bluetoothctl info | grep "Name" | sed 's/.*Name: //') +battery=$(bluetoothctl info | grep "Battery" | sed 's/.*(//;s/)//') if [ ! "$name" ] then echo "" else - echo "" $name; + echo -n "" $name; + if [ "$battery" ] + then + echo -n " ($battery%)" + fi + echo "" fi -- cgit v1.2.3-13-gbd6f From 2450e47882750f1a46911f99503a068df84c2181 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 8 May 2024 01:17:29 +0530 Subject: (Scripts|Emacs/app)~ported eshell banner to a script Instead of doing it all in Emacs lisp (which while pretty fun to write, is not fun to execute outside of Emacs), I wrote a shell script which generates the same banners, then just linked +eshell/banner-message to it. --- Scripts/.local/scripts/cowfortune | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 Scripts/.local/scripts/cowfortune (limited to 'Scripts') diff --git a/Scripts/.local/scripts/cowfortune b/Scripts/.local/scripts/cowfortune new file mode 100755 index 0000000..d78a950 --- /dev/null +++ b/Scripts/.local/scripts/cowfortune @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +cow=$(echo -e "default\ncower\nmoofasa\nmoose\nmutilated\nsatanic\nsheep\nsmall\ntux\nvader" | shuf | head -1) + +fortune | cowsay -f $cow -- cgit v1.2.3-13-gbd6f From 25b0bc9d4fe7a1845138af363071d3cae26161d9 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 8 May 2024 01:31:35 +0530 Subject: (Scripts)-some obsolete scripts --- Scripts/.local/scripts/folder_size | 3 --- Scripts/.local/scripts/launch_music | 4 ---- Scripts/.local/scripts/launch_polybar | 3 --- 3 files changed, 10 deletions(-) delete mode 100755 Scripts/.local/scripts/folder_size delete mode 100755 Scripts/.local/scripts/launch_music delete mode 100755 Scripts/.local/scripts/launch_polybar (limited to 'Scripts') diff --git a/Scripts/.local/scripts/folder_size b/Scripts/.local/scripts/folder_size deleted file mode 100755 index fe136c6..0000000 --- a/Scripts/.local/scripts/folder_size +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/sh - -du -BM -d $1 | sort -n diff --git a/Scripts/.local/scripts/launch_music b/Scripts/.local/scripts/launch_music deleted file mode 100755 index 44cdad8..0000000 --- a/Scripts/.local/scripts/launch_music +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$($TERMINAL -c 'media-term' -t 'NCM' -e ncmpcpp) & -$($TERMINAL -c 'media-term' -t 'VIS' -e vis) diff --git a/Scripts/.local/scripts/launch_polybar b/Scripts/.local/scripts/launch_polybar deleted file mode 100755 index 536873a..0000000 --- a/Scripts/.local/scripts/launch_polybar +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -killall polybar; -polybar custom-bar; -- cgit v1.2.3-13-gbd6f From b8dc2696dc59b0b5f95a6226dbcb7c5aa0d208c2 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 8 May 2024 01:31:46 +0530 Subject: (Scripts)~list_packages now uses less --- Scripts/.local/scripts/list_packages | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Scripts') diff --git a/Scripts/.local/scripts/list_packages b/Scripts/.local/scripts/list_packages index 48d655d..886292a 100755 --- a/Scripts/.local/scripts/list_packages +++ b/Scripts/.local/scripts/list_packages @@ -1,2 +1,3 @@ -#/usr/bin/env bash -pacman -Qs | fzf +#!/usr/bin/env bash + +pacman -Qs | less -- cgit v1.2.3-13-gbd6f From 6e2696e47e9d112501e6bfa7bac389ad2f9b97b4 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 13 May 2024 17:03:40 +0530 Subject: (Scripts)~if no emacs server then use just general emacs --- Scripts/.local/scripts/eselect | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Scripts') diff --git a/Scripts/.local/scripts/eselect b/Scripts/.local/scripts/eselect index 0f2d682..7bd4016 100755 --- a/Scripts/.local/scripts/eselect +++ b/Scripts/.local/scripts/eselect @@ -9,11 +9,11 @@ case "$(printf "new\nstop\nrestart\neshell\nmail" | dmenu -p "eserver: ")" in notify-send "eselect: Halted Emacs server";; "new") notify-send "eselect: Launching Emacs"; - emacsclient -c;; + emacsclient -c -a emacs;; "eshell") notify-send "eselect: Launching Eshell"; - emacsclient -c --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))';; + emacsclient -c -a emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))';; "mail") notify-send "eselect: Launching notmuch"; - emacsclient -c --eval '(let ((b (or (get-buffer "*notmuch-hello*") (progn (notmuch) (get-buffer "*notmuch-hello*"))))) (switch-to-buffer b))';; + emacsclient -c -a emacs --eval '(let ((b (or (get-buffer "*notmuch-hello*") (progn (notmuch) (get-buffer "*notmuch-hello*"))))) (switch-to-buffer b))';; esac -- cgit v1.2.3-13-gbd6f