parent
e23f439b65
commit
f9e580106e
5 changed files with 84 additions and 84 deletions
@ -1,23 +1,23 @@ |
|||||||
#!/usr/bin/env sh |
#!/usr/bin/env sh |
||||||
EDITOR=vis |
EDITOR=vis |
||||||
cd /home/$USER/ |
cd "/home/$USER/" || exit 1 |
||||||
|
|
||||||
handlefiles() { |
handlefiles() { |
||||||
echo "$1" | grep -iE ".(wav|webm|mp4|ogg|opus|m4a|flac|mov|avi)$" && st -e mpv "$@" && exit |
echo "$1" | grep -iE ".(wav|webm|mp4|ogg|opus|m4a|flac|mov|avi)$" && st -e mpv "$@" && exit |
||||||
echo "$1" | grep -iE ".(jpg|png|gif)$" && st -e sxiv "$@" && exit |
echo "$1" | grep -iE ".(jpg|png|gif)$" && st -e sxiv "$@" && exit |
||||||
st -e sh -ic "$EDITOR "$@"" && exit |
st -e sh -ic "$EDITOR $*" && exit |
||||||
} |
} |
||||||
|
|
||||||
while true; do |
while true; do |
||||||
CHOICES="$(echo -e 'Close Menu\n../\n*\n'"$(ls -1p)")" |
CHOICES="$(printf %b 'Close Menu\n../\n*\n'"$(ls -1p)")" |
||||||
DIR="$(basename "$(pwd)")" |
DIR="$(basename "$(pwd)")" |
||||||
PICKED="$( |
PICKED="$( |
||||||
echo "$CHOICES" | |
echo "$CHOICES" | |
||||||
dmenu -fn Terminus-18 -c -p "$DIR" -l 20 |
dmenu -fn Terminus-18 -c -p "$DIR" -l 20 |
||||||
)" |
)" |
||||||
|
|
||||||
echo "$PICKED" | grep "Close Menu" && exit 0 |
echo "$PICKED" | grep "Close Menu" && exit 0 |
||||||
[ -d "$PICKED" ] && cd "$PICKED" && continue |
[ -d "$PICKED" ] && cd "$PICKED" && continue |
||||||
echo "$PICKED" | grep -E '^[*]$' && handlefiles * |
echo "$PICKED" | grep -E '^[*]$' && handlefiles ./* |
||||||
[ -f "$PICKED" ] && handlefiles "$PICKED" |
[ -f "$PICKED" ] && handlefiles "$PICKED" |
||||||
done |
done |
||||||
|
@ -1,51 +1,51 @@ |
|||||||
#!/usr/bin/env sh |
#!/usr/bin/env sh |
||||||
timerrun() { |
timerrun() { |
||||||
TIME=$( |
TIME=$( |
||||||
echo "$@" | |
echo "$@" | |
||||||
sed 's#h#*60m#g'| |
sed 's#h#*60m#g'| |
||||||
sed 's#m#*60s#g'| |
sed 's#m#*60s#g'| |
||||||
sed 's#s#*1#g'| |
sed 's#s#*1#g'| |
||||||
sed 's# #+#g' | |
sed 's# #+#g' | |
||||||
bc |
bc |
||||||
) |
) |
||||||
|
|
||||||
date1=$((`date +%s` + $TIME)); |
DATE1=$(($(date +%s) + TIME)); |
||||||
while [ "$date1" -ge `date +%s` ]; do |
while [ "$DATE1" -ge "$(date +%s)" ]; do |
||||||
echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S) \r"; |
printf %b "$(date -u --date @$((DATE1 - $(date +%s))) +%H:%M:%S) \r"; |
||||||
sleep 0.1 |
sleep 0.1 |
||||||
done |
done |
||||||
echo "Done with $@" |
echo "Done with $*" |
||||||
|
|
||||||
while :; |
while :; |
||||||
do notify-send "Done with $@"; |
do notify-send "Done with $*"; |
||||||
sxmo_vibratepine 1000 |
sxmo_vibratepine 1000 |
||||||
sleep 0.5 |
sleep 0.5 |
||||||
done |
done |
||||||
} |
} |
||||||
|
|
||||||
menu() { |
menu() { |
||||||
pidof svkbd-sxmo || svkbd-sxmo & |
pidof svkbd-sxmo || svkbd-sxmo & |
||||||
TIMEINPUT="$( |
TIMEINPUT="$( |
||||||
echo -e " |
echo " |
||||||
1h |
1h |
||||||
10m |
10m |
||||||
9m |
9m |
||||||
8m |
8m |
||||||
7m |
7m |
||||||
6m |
6m |
||||||
5m |
5m |
||||||
4m |
4m |
||||||
3m |
3m |
||||||
2m |
2m |
||||||
1m |
1m |
||||||
30s |
30s |
||||||
Close Menu |
Close Menu |
||||||
" | awk 'NF' | awk '{$1=$1};1' | dmenu -p Timer -c -fn "Terminus-30" -l 20 |
" | awk 'NF' | awk '{$1=$1};1' | dmenu -p Timer -c -fn "Terminus-30" -l 20 |
||||||
)" |
)" |
||||||
pkill svkbd-sxmo |
pkill svkbd-sxmo |
||||||
[[ "Close Menu" == "$TIMEINPUT" ]] && exit 0 |
[ "Close Menu" = "$TIMEINPUT" ] && exit 0 |
||||||
|
st -f Monospace-50 -e "$0" timerrun "$TIMEINPUT" |
||||||
st -f Monospace-50 -e $0 timerrun $TIMEINPUT |
|
||||||
} |
} |
||||||
|
|
||||||
[ $# -gt 0 ] && $@ || menu |
# shellcheck disable=SC2068 |
||||||
|
if [ $# -gt 0 ]; then $@; else menu; fi |
@ -1,35 +1,35 @@ |
|||||||
#!/usr/bin/env sh |
#!/usr/bin/env sh |
||||||
menu() { |
menu() { |
||||||
pidof svkbd-sxmo || svkbd-sxmo & |
pidof svkbd-sxmo || svkbd-sxmo & |
||||||
SEARCHTERMS="$( |
SEARCHTERMS="$( |
||||||
echo "Search term" | |
echo "Search term" | |
||||||
dmenu -p "Yt Search" -c -l 10 -fn Terminus-20 |
dmenu -p "Yt Search" -c -l 10 -fn Terminus-20 |
||||||
)" |
)" |
||||||
pkill svkbd-sxmo |
pkill svkbd-sxmo |
||||||
|
|
||||||
IDIOTRESULTS="$(youtube-cli "$SEARCHTERMS")" |
IDIOTRESULTS="$(youtube-cli "$SEARCHTERMS")" |
||||||
RESULT="$( |
RESULT="$( |
||||||
echo "$IDIOTRESULTS" | |
echo "$IDIOTRESULTS" | |
||||||
grep -Ev '^(Channelid|Atom feed|Channel title|Published|Viewcount|Userid):' | |
grep -Ev '^(Channelid|Atom feed|Channel title|Published|Viewcount|Userid):' | |
||||||
sed -E 's/^(URL|Duration):\s+/\t/g' | |
sed -E 's/^(URL|Duration):\s+/\t/g' | |
||||||
tr -d '\n' | |
tr -d '\n' | |
||||||
sed 's/===/\n/g' | |
sed 's/===/\n/g' | |
||||||
gawk -F'\t' '{ print $3 " " $1 " " $2}' | |
gawk -F'\t' '{ print $3 " " $1 " " $2}' | |
||||||
dmenu -c -l 10 -fn Terminus-20 |
dmenu -c -l 10 -fn Terminus-20 |
||||||
)" |
)" |
||||||
|
|
||||||
[[ "CLOSE_MENU" == "$RESULT" ]] && exit 0 |
[ "CLOSE_MENU" = "$RESULT" ] && exit 0 |
||||||
URL=$(echo "$RESULT" | awk -F " " '{print $NF}') |
URL=$(echo "$RESULT" | awk -F " " '{print $NF}') |
||||||
} |
} |
||||||
|
|
||||||
video() { |
video() { |
||||||
menu |
menu |
||||||
st -e mpv -v --ytdl-format='[height<420]' "$URL" |
st -e mpv -v --ytdl-format='[height<420]' "$URL" |
||||||
} |
} |
||||||
|
|
||||||
audio() { |
audio() { |
||||||
menu |
menu |
||||||
st -e mpv -v --no-video "$URL" |
st -e mpv -v --no-video "$URL" |
||||||
} |
} |
||||||
|
|
||||||
$@ |
$1 |
||||||
|
Loading…
Reference in new issue