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