|
|
|
@ -4,10 +4,11 @@ |
|
|
|
|
menu() { |
|
|
|
|
pidof svkbd-sxmo || svkbd-sxmo & |
|
|
|
|
SUBREDDIT="$( |
|
|
|
|
printf %b "$(echo "$SXMO_SUBREDDITS" | tr " " '\n')" | |
|
|
|
|
printf %b "Close Menu\n$(echo "$SXMO_SUBREDDITS" | tr " " '\n')" | |
|
|
|
|
dmenu -p "Subreddit:" -c -l 10 -fn Terminus-20 |
|
|
|
|
)" |
|
|
|
|
pkill svkbd-sxmo |
|
|
|
|
[ "Close Menu" = "$SUBREDDIT" ] && exit 0 |
|
|
|
|
|
|
|
|
|
REDDITRESULTS="$( |
|
|
|
|
reddit-cli "$SUBREDDIT" | |
|
|
|
@ -16,16 +17,16 @@ menu() { |
|
|
|
|
tr -d '\n' | |
|
|
|
|
sed 's/===/\n/g' | |
|
|
|
|
sed 's/^\t//g' | |
|
|
|
|
sort -rk3,3 | |
|
|
|
|
sort -t$'\t' -rnk4 | |
|
|
|
|
awk -F'\t' '{ printf "↑%4s", $3; print " " $4 " " $1 " " $2 }' |
|
|
|
|
)" |
|
|
|
|
|
|
|
|
|
RESULT="$( |
|
|
|
|
echo "$REDDITRESULTS" | |
|
|
|
|
printf %b "Close Menu\n$REDDITRESULTS" | |
|
|
|
|
dmenu -c -l 10 -fn Terminus-20 |
|
|
|
|
)" |
|
|
|
|
|
|
|
|
|
[ "CLOSE_MENU" = "$RESULT" ] && exit 0 |
|
|
|
|
[ "Close Menu" = "$RESULT" ] && exit 0 |
|
|
|
|
URL=$(echo "$RESULT" | awk -F " " '{print $NF}') |
|
|
|
|
|
|
|
|
|
$BROWSER "$URL" |
|
|
|
|