Compare commits

...

3 Commits

Author SHA1 Message Date
cb2305496e
add 'arf' alias 2023-04-22 12:01:54 -04:00
0cc16426f2
sorter.sh: make it POSIX-compliant 2023-04-22 11:56:13 -04:00
1f4782b975
.xinitrc: fix accidental comment
oops i left this in while debugging
2023-04-22 10:46:01 -04:00
3 changed files with 26 additions and 2 deletions

View File

@ -22,3 +22,6 @@ function genlop; doas -u portage /usr/bin/genlop; end
function loginctl; doas /bin/loginctl; end
function pyenv; source ~/dox/proj/ref/venv/bin/activate.fish; end
# bootleg meme feed
function arf; cd ~/med/memes/arf; mpv --no-resume-playback (ls | shuf); end

View File

@ -1,6 +1,27 @@
#!/bin/sh
# Categorize files in the quarantine directory
# read -n 1 isn't POSIX-compliant so we implement something
# https://unix.stackexchange.com/questions/464930/can-i-read-a-single-character-from-stdin-in-posix-shell
readc() {
# return a single character from input
# if tty
if [ -t 0 ]; then
# save settings
saved_settings="$(stty -g)"
# make it so we get the character even if no enter press
stty -icanon
fi
dd bs=1 count=1 2>/dev/null
if [ -t 0 ]; then
# restore settings
stty "$saved_settings"
fi
}
view() {
mpv --no-resume-playback "$1"
}
@ -61,7 +82,7 @@ while read -r FILE; do
printf "send to: %s\n" "$DESTPATH"
printf "\nh view again, j set directory, k set name, l confirm, L confirm and preserve information\n q exit, s skip, d move to trash\n"
printf "\n> "
read -n 1 ANS < /dev/tty
ANS="$(readc </dev/tty)"
case "$ANS" in
q ) exit;;
h ) view "$FILE";;

View File

@ -16,7 +16,7 @@ wallpaper
xss-lock -- slock &
dunst &
xrdb .Xresources
# gentoo-pipewire-launcher &
gentoo-pipewire-launcher &
# DBus
export NO_AT_BRIDGE=1