summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-01-13 17:52:36 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-01-13 17:52:36 -0500
commitbf434758d9c60c323d571bc1e2e329edaad06fa3 (patch)
treec7cdaaba012b4560d49aaadc5e588c9563348214
parenta0cab8cd1a13e665ee83efecf37fa8cf87bf2c46 (diff)
More debloating
-rwxr-xr-x.local/bin/dmenuprint11
-rwxr-xr-x.local/bin/makestereo9
-rwxr-xr-x.local/bin/mountmenu61
-rwxr-xr-x.local/bin/showcolors14
-rwxr-xr-x.local/bin/tmux-vlc17
-rwxr-xr-x.local/bin/todotable23
-rwxr-xr-x.local/bin/umountmenu42
7 files changed, 3 insertions, 174 deletions
diff --git a/.local/bin/dmenuprint b/.local/bin/dmenuprint
index cfcd179..469c8a3 100755
--- a/.local/bin/dmenuprint
+++ b/.local/bin/dmenuprint
@@ -4,12 +4,7 @@ choice="$(lpstat -p -d | sed 's/.*default.*//g;
s/[^ ]* //;
s/is\sidle.//g
s/.*disabled.*//g' |
- dmenu -p "Which printer?" |
- sed 's/\s.*//g' )"
+ dmenu -p "Which printer?" |
+ sed 's/\s.*//g')"
-lpr -P $choice "$@"
-
-# printer Canon_iP110_series is idle. enabled since Tue 10 Nov 2020 04:22:34 PM
-# printer HP_OfficeJet_Pro_9010 is idle. enabled since Wed 09 Dec 2020 01:57:06 AM
-# printer HP_OfficeJet_Pro_9010_fax is idle. enabled since Tue 27 Oct 2020 08:40:56 PM
-# system default destination: HP_OfficeJet_Pro_9010
+lpr -P "$choice" "$@"
diff --git a/.local/bin/makestereo b/.local/bin/makestereo
deleted file mode 100755
index f43a696..0000000
--- a/.local/bin/makestereo
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-file=$(readlink -f "$1")
-dir=$(dirname "$file")
-base="${file##*/}"
-ext="${base##*.}"
-
-ffmpeg -i $file -af "pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR" "$dir/stereo-$base.$ext"
-
diff --git a/.local/bin/mountmenu b/.local/bin/mountmenu
deleted file mode 100755
index 6a48c0e..0000000
--- a/.local/bin/mountmenu
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-# Gives a dmenu prompt to mount unmounted drives.
-# If they're in /etc/fstab, they'll be mounted automatically.
-# Otherwise, you'll be prompted to give a mountpoint from already existsing directories.
-# If you input a novel directory, it will prompt you to create that directory.
-
-getmount() { \
- [ -z "$chosen" ] && exit 1
- mp="$(find $1 | dmenu -i -l 20 -p "Type in mount point")"
- [ "$mp" = "" ] && exit 1
- if [ ! -d "$mp" ]; then
- mkdiryn=$(printf "No\\nYes" | dmenu -i -l 2 -p "$mp does not exist. Create it?")
- [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
- fi
- }
-
-mountusb() { \
- chosen="$(echo "$usbdrives" | dmenu -i -l 20 -p "Mount which drive?" | awk '{print $1}')"
- sudo -A mount "$chosen" && notify-send -i "$HOME/.fonts/svg/usb.svg" -a "USB mounting" "$chosen mounted." && exit 0
- alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/games|\/home$|SWAP/&&length($3)>1{printf "-not \( -path *%s -prune \) \ \n",$3}')
- getmount "/mnt /mount $HOME/Drives/Usb1 $HOME/Drives/Usb2 $HOME/Drives/Usb3 -type d $alreadymounted"
- partitiontype="$(lsblk -no "fstype" "$chosen")"
- case "$partitiontype" in
- "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;;
- *) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" 741 "$mp";;
- esac
- notify-send -i "$HOME/.fonts/svg/usb.svg" -a "USB mounting" "$chosen mounted to $mp."
- }
-
-mountandroid() { \
- chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1)
- getmount "$HOME -maxdepth 3 -type d"
- simple-mtpfs --device "$chosen" "$mp"
- notify-send -i "$HOME/.fonts/svg/android.svg" -a "Android Mounting
- Android device mounted to $mp."
- }
-
-asktype() { \
- case $(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?") in
- USB) mountusb ;;
- Android) mountandroid ;;
- esac
- }
-
-anddrives=$(simple-mtpfs -l 2>/dev/null)
-usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3}' | sed 's/^.*1M.*$//; /^$/d')"
-echo $usbdrives
-
-if [ -z "$usbdrives" ]; then
- [ -z "$anddrives" ] && notify-send -i "~/.fonts/svg/usb.svg" -a "USB Mounting" "No USB drive or Android device detected" && exit
- echo "Android device(s) detected."
- mountandroid
-else
- if [ -z "$anddrives" ]; then
- echo "USB drive(s) detected."
- mountusb
- else
- echo "Mountable USB drive(s) and Android device(s) detected."
- asktype
- fi
-fi
diff --git a/.local/bin/showcolors b/.local/bin/showcolors
deleted file mode 100755
index b88357c..0000000
--- a/.local/bin/showcolors
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-txt=" "
-
-# Showoff bright backgrounds
-for i in $(seq 100 109); do
- echo "\033[${i}m$txt\033[0m"
-done
-
-# Showoff bright backgrounds
-for i in $(seq 40 49); do
- echo "\033[${i}m$txt\033[0m"
-done
-
diff --git a/.local/bin/tmux-vlc b/.local/bin/tmux-vlc
deleted file mode 100755
index a25c3e6..0000000
--- a/.local/bin/tmux-vlc
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-# This script ensures that i3 will spawn a youtube tui.
-session="Podcast"
-url=$1
-
-# Check if the session exists, discarding output
-# We can check $? for the exit status (zero for success, non-zero for failure)
-tmux has-session -t $session 2>/dev/null
-
-if [ $? != 0 ]; then
- # Set up your session
- tmux new-session -d -s "$session" vlc -I ncurses "$url"
-fi
-
-# Attach to created session
-tmux attach-session -t $session
-
diff --git a/.local/bin/todotable b/.local/bin/todotable
deleted file mode 100755
index 6609a1f..0000000
--- a/.local/bin/todotable
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-file=$(readlink -f "$1")
-dir=$(dirname "$file")
-base="${file%.*}"
-
-contents="$1"
-shift
-for i in "$@"; do
- output=$output"\n"$(cat "$contents" | grep -n "$i" | sed 's/\([0-9]*\):.*'"$i"'.\(.*\)$/-\ \*\*'"$i"':\*\*\ \2\ (line \1)/g'
- )
-done
-
-
-if [ "$#" -eq $(printf $output | wc -l ) ];
-then
- rm "$base"-tdtable.pdf
- exit 0
-else
- echo -e '---\ntitle: Checklist:\n.PP'"$output" | groffdown | refer -PS -e "-p$REFERBIB" | groff -me -ms -kejpt -T pdf > "$base"-tdtable.pdf
-fi
-# Uncomment for debugging:
-# echo -e '---\ntitle: TODOs\n.PP'"$output" > "$base"-tdtable.gd
diff --git a/.local/bin/umountmenu b/.local/bin/umountmenu
deleted file mode 100755
index 39940a3..0000000
--- a/.local/bin/umountmenu
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-# A dmenu prompt to unmount drives.
-# Provides you with mounted partitions, select one to unmount.
-# Drives mounted at /, /boot, /games and /home will not be options to unmount.
-
-unmountusb() {
- [ -z "$drives" ] && exit
- chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}')
- [ -z "$chosen" ] && exit
- sudo -A umount "$chosen" && notify-send -i "$HOME/.fonts/svg/usb.svg" -a "USB Mounting" "$chosen unmounted."
- }
-
-unmountandroid() { \
- chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
- [ -z "$chosen" ] && exit
- sudo -A umount -l "$chosen" && notify-send -i "$HOME/.fonts/svg/android.svg" -a "Android unmounting
- $chosen unmounted."
- }
-
-asktype() { \
- case "$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" in
- USB) unmountusb ;;
- Android) unmountandroid ;;
- esac
- }
-
-drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$2=="part"&&$4!~/\/boot|\/games|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
-
-if ! grep simple-mtpfs /etc/mtab; then
- [ -z "$drives" ] && notify-send -i "~/.fonts/svg/usb.svg" -a "USB Mounting" "No drives to unmount." && exit
- echo "Unmountable USB drive detected."
- unmountusb
-else
- if [ -z "$drives" ]
- then
- echo "Unmountable Android device detected."
- unmountandroid
- else
- echo "Unmountable USB drive(s) and Android device(s) detected."
- asktype
- fi
-fi