summaryrefslogtreecommitdiff
path: root/scripts/.local/bin
diff options
context:
space:
mode:
authorIvan K. Boikov <mail@ikboikov.net>2025-01-25 19:17:06 +0100
committerIvan K. Boikov <mail@ikboikov.net>2025-01-25 19:35:42 +0100
commit275beaa95ad47432f72cf6796930837c7441bfae (patch)
tree37209383cb4628a064f08271d908d7a2e46c93f9 /scripts/.local/bin
parent73c27aeea57cd78f77a5978144b0c8237ca38be8 (diff)
Less emoji-cringe
Diffstat (limited to 'scripts/.local/bin')
-rwxr-xr-xscripts/.local/bin/dmnt14
-rwxr-xr-xscripts/.local/bin/dumnt6
-rwxr-xr-xscripts/.local/bin/findfont1
-rwxr-xr-xscripts/.local/bin/ifinstalled2
4 files changed, 11 insertions, 12 deletions
diff --git a/scripts/.local/bin/dmnt b/scripts/.local/bin/dmnt
index 7175b6e..8183162 100755
--- a/scripts/.local/bin/dmnt
+++ b/scripts/.local/bin/dmnt
@@ -44,11 +44,11 @@ $normalparts" | sed "/^$/d;s/ *$//")"
test -n "$alldrives"
# Feed all found drives to dmenu and get user choice.
-chosen="$(echo "$alldrives" | $DMENU -l 16 -p "Mount which drive?" -i)"
+chosen="$(echo "$alldrives" | $DMENU -l 16 -p "Mount which drive" -i)"
# Function for prompting user for a mountpoint.
getmount(){
- mp="$(find /mnt /media /mount /home -maxdepth 1 -type d 2>/dev/null | $DMENU -i -p "Mount this drive where?")"
+ mp="$(find /mnt /media /mount /home -maxdepth 1 -type d 2>/dev/null | $DMENU -i -p "Set mount point")"
test -n "$mp"
if [ ! -d "$mp" ]; then
mkdiryn=$(printf "No\\nYes" | $DMENU -i -p "$mp does not exist. Create it?")
@@ -59,7 +59,7 @@ getmount(){
attemptmount(){
# Attempt to mount without a mountpoint, to see if drive is in fstab.
sudo -A mount "$1" || return 1
- notify-send "💾Drive Mounted." "$chosen mounted."
+ notify-send "Drive mounted" "$chosen"
exit
}
@@ -69,7 +69,7 @@ case "$chosen" in
chosen="${chosen:1}" # This is a bashism.
attemptmount "$chosen" || getmount
sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
- notify-send "💾Drive Mounted." "$chosen mounted to $mp."
+ notify-send "Drive mounted" "$chosen -> $mp."
;;
🔒*)
@@ -104,16 +104,16 @@ case "$chosen" in
sudo -A mount -o uid="$(id -u)",gid="$(id -g)" "/dev/mapper/usb$num" "$mp"
fi
- notify-send "🔓Decrypted drive Mounted." "$chosen decrypted and mounted to $mp."
+ notify-send "Drive mounted" "$chosen -> $mp"
;;
📱*)
- notify-send "❗Note" "Remember to allow file access on your phone now."
+ notify-send "Allow file access on your phone"
getmount
chosen="${chosen%%:*}"
chosen="${chosen:1}" # This is a bashism.
sudo -A simple-mtpfs -o allow_other --device "$chosen" "$mp"
- notify-send "🤖 Android Mounted." "Android device mounted to $mp."
+ notify-send "Android mounted" "$mp"
;;
esac
diff --git a/scripts/.local/bin/dumnt b/scripts/.local/bin/dumnt
index d190c9d..837aa59 100755
--- a/scripts/.local/bin/dumnt
+++ b/scripts/.local/bin/dumnt
@@ -26,7 +26,7 @@ if [ -n "$bprocs" ]; then
action=$(printf 'nothing\nlazy\nterminate\nkill' | "$DMENU" -i -p "$chosen is busy: (abort), (lazy) unmount or (terminate)/(kill) blocking processes")
case $action in
nothing)
- notify-send "Unmount of $chosen aborted" ""
+ notify-send "Unmount aborted" "$chosen"
exit 1;;
lazy) sudo -A umount -l "/${chosen#*/}";;
terminate) echo "$bPIDs" | while IFS="$(printf '\n')" read -r pid ; do kill "$pid"; done ;;
@@ -35,11 +35,11 @@ if [ -n "$bprocs" ]; then
fi
sudo -A umount "/${chosen#*/}"
-notify-send "Device unmounted." "$chosen has been unmounted."
+notify-send "Unmounted" "$chosen"
# Close the chosen drive if decrypted.
cryptid="$(echo "$lsblkoutput" | grep "/${chosen#*/}$")"
cryptid="${cryptid%% *}"
test -b /dev/mapper/"${cryptid##*/}"
sudo -A cryptsetup close "$cryptid"
-notify-send "🔒Device dencryption closed." "Drive is now securely locked again."
+notify-send "Encryption closed" "$chosen"
diff --git a/scripts/.local/bin/findfont b/scripts/.local/bin/findfont
index da2d611..ac8f180 100755
--- a/scripts/.local/bin/findfont
+++ b/scripts/.local/bin/findfont
@@ -2,4 +2,3 @@
param="$1"
char=${param:0:1}
printf '%x' \'"$char" | xargs -I{} fc-list ":charset={}"
-
diff --git a/scripts/.local/bin/ifinstalled b/scripts/.local/bin/ifinstalled
index b81081b..7b57603 100755
--- a/scripts/.local/bin/ifinstalled
+++ b/scripts/.local/bin/ifinstalled
@@ -8,6 +8,6 @@
for x in "$@"; do
#if ! which "$x" >/dev/null 2>&1 && ! pacman -Qq "$x" >/dev/null 2>&1; then
if ! which "$x" >/dev/null 2>&1 && ! apt -qq list "$x" >/dev/null 2>&1; then
- notify-send "📦 $x" "must be installed for this function." && exit 1 ;
+ notify-send "Missing $x" && exit 1 ;
fi
done