From 6647209f708c09a2ab62ef3b5c77f9b4aa241c70 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 13 Jan 2022 14:28:47 -0700 Subject: Support for subdirectories in Library --- extras/HOME/.local/bin/library-view.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'extras') diff --git a/extras/HOME/.local/bin/library-view.sh b/extras/HOME/.local/bin/library-view.sh index 29925a8..b2c5dd5 100755 --- a/extras/HOME/.local/bin/library-view.sh +++ b/extras/HOME/.local/bin/library-view.sh @@ -13,10 +13,9 @@ fi cd ~/Library -files=(*.pdf) - -file_with_title="$(for file in "${files[@]}" ; do - echo "$file| $(echo "$file" | sed 's#\(^\|_\|\s\)\([a-z]\)#\1\U\2#g' | tr '_' ' ' | sed 's/.[^.]*$//')" +file_with_title="$(find . -name '*.pdf' | while read file ; do + echo "$file| $(echo "$file" | sed \ + 's#\(^\|_\|\s\)\([a-z]\)#\1\U\2#g;s/\.[^.]*$//;s#^\(.*\)/\([^/]*\)$#\2 (\1)#' | tr '_' ' ')" done)" selected=$(echo "$file_with_title" | (while read file ; do -- cgit From 913139d4b5fcf330fb67d4a9a4519d534131cb4f Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sun, 16 Jan 2022 15:37:07 -0700 Subject: add more emoticons. Fix emoticon script. --- extras/HOME/.local/bin/emoticon-select.sh | 3 +-- extras/HOME/.xmobarrc | 2 +- extras/HOME/.xmonad/emoticons.txt | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extras') diff --git a/extras/HOME/.local/bin/emoticon-select.sh b/extras/HOME/.local/bin/emoticon-select.sh index e1637d1..5674e44 100755 --- a/extras/HOME/.local/bin/emoticon-select.sh +++ b/extras/HOME/.local/bin/emoticon-select.sh @@ -11,7 +11,6 @@ else fi -selection="$("${menu[@]}" < $HOME/.xmonad/emoticons.txt)" -emoticon="$(echo ${selection/*-})" +emoticon="$("${menu[@]}" < $HOME/.xmonad/emoticons.txt | sed 's#^[^-]*-\s*##')" echo "$emoticon" | xclip -selection clipboard diff --git a/extras/HOME/.xmobarrc b/extras/HOME/.xmobarrc index 299877f..4e7aed3 100644 --- a/extras/HOME/.xmobarrc +++ b/extras/HOME/.xmobarrc @@ -57,7 +57,7 @@ Config "--normal", "#88ff88", "--high", "#ff8888" ] 10, - Run Mpris2 "spotifyd" [ + Run Mpris2 "spotify" [ "-t", "</fn>", "--nastring", "<fc=#404040> </fc>"] 20, Run Com ".xmonad/xmobar-weather" [] "weather" 9000, diff --git a/extras/HOME/.xmonad/emoticons.txt b/extras/HOME/.xmonad/emoticons.txt index 65289c4..f919a81 100644 --- a/extras/HOME/.xmonad/emoticons.txt +++ b/extras/HOME/.xmonad/emoticons.txt @@ -1,5 +1,6 @@ Bear - (''')(0.0)(''') Cry - ಥ_ಥ +Cry - ಥ︵ಥ Deal with it - (•_•) ( •_•)>⌐■-■ (⌐■_■) Deal with it. - (▀̿Ĺ̯▀̿ ̿) Disapprove - ಠ_ಠ -- cgit From 4f268190128b0e2bb56d57b99e808d1b0476eea6 Mon Sep 17 00:00:00 2001 From: Josh Rahm <joshuarahm@gmail.com> Date: Mon, 17 Jan 2022 23:12:46 -0700 Subject: Better media --- extras/HOME/.xmobarrc | 10 +++------- extras/HOME/.xmonad/xmobar-media | 9 +++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100755 extras/HOME/.xmonad/xmobar-media (limited to 'extras') diff --git a/extras/HOME/.xmobarrc b/extras/HOME/.xmobarrc index 4e7aed3..6d4ab64 100644 --- a/extras/HOME/.xmobarrc +++ b/extras/HOME/.xmobarrc @@ -29,16 +29,14 @@ Config , alignSep = "}{" , template = " %logo% <fc=#a0a0a0><fn=3>%uname%</fn></fc><fc=#404040> │\ - \</fc><fc=#a0a0a0> %date%</fc><fc=#404040> │ \ \</fc>%StdinReader%}\ \{ %cpu% %memory% <fc=#404040>\ \│</fc> %weather% <fc=#404040>│\ - \</fc> <fc=#a0a0a0>%mpris2%</fc> <fc=#404040>│ \ + \</fc> <fc=#a0a0a0>%media%</fc> <fc=#404040>│ \ \</fc>%bluetooth%%bat% <fc=#404040>│</fc> <fn=2><fc=#606060>%time%</fc></fn> " , commands = [ Run StdinReader, - Run Date "%H:%M:%S" "time" 10, - Run Date "<fn=3>%m/%d</fn>" "date" 10, + Run Date "%m/%d %H:%M:%S" "time" 10, Run Cpu [ "-t", "<fn=3><fc=#000000><bar></fc></fn>", "-L", "3", @@ -57,9 +55,7 @@ Config "--normal", "#88ff88", "--high", "#ff8888" ] 10, - Run Mpris2 "spotify" [ - "-t", "<fc=#1aa54b></fc> <fn=3><title></fn>", - "--nastring", "<fc=#404040> </fc>"] 20, + Run Com ".xmonad/xmobar-media" [] "media" 20, Run Com ".xmonad/xmobar-weather" [] "weather" 9000, Run Com ".xmonad/xmobar-logo" [] "logo" 0, Run Com "uname" ["-r"] "uname" 0, diff --git a/extras/HOME/.xmonad/xmobar-media b/extras/HOME/.xmonad/xmobar-media new file mode 100755 index 0000000..7232900 --- /dev/null +++ b/extras/HOME/.xmonad/xmobar-media @@ -0,0 +1,9 @@ +#!/bin/bash + +title="$(spotify-control getTitle)" + +if [[ "$?" -eq 0 ]] ; then + echo "<fc=#1aa54b></fc> <fn=3>$title</fn>" +else + echo "<fc=#404040> </fc>" +fi -- cgit From b810758e6a418db3eb6c5d1ab504273f01b7b00d Mon Sep 17 00:00:00 2001 From: Josh Rahm <rahm@google.com> Date: Fri, 18 Mar 2022 10:17:09 -0600 Subject: Minor fixes to weather and bluetooth scripts. --- extras/HOME/.xmonad/xmobar-bluetooth | 24 +++++++++++-------- extras/HOME/.xmonad/xmobar-weather | 46 ++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 33 deletions(-) (limited to 'extras') diff --git a/extras/HOME/.xmonad/xmobar-bluetooth b/extras/HOME/.xmonad/xmobar-bluetooth index 9b4f5cc..16a6d70 100755 --- a/extras/HOME/.xmonad/xmobar-bluetooth +++ b/extras/HOME/.xmonad/xmobar-bluetooth @@ -2,17 +2,21 @@ cur="" -bluetoothctl -- info | while read line ; do - key=${line%%: *} - value=${line//*: } +if [ -d /sys/class/bluetooth ] ; then - if [ "$key" == "Name" ] ; then - cur="$value" - fi + bluetoothctl -- info | while read line ; do + key=${line%%: *} + value=${line//*: } - if [ "$key" == "Connected" -a "$value" == "yes" ] ; then - exec echo "<fc=#4287f5></fc> <fc=#a0a0a0><fn=3>$cur</fn></fc> <fc=#404040>│</fc> " - fi -done + if [ "$key" == "Name" ] ; then + cur="$value" + fi + + if [ "$key" == "Connected" -a "$value" == "yes" ] ; then + exec echo "<fc=#4287f5></fc> <fc=#a0a0a0><fn=3>$cur</fn></fc> <fc=#404040>│</fc> " + fi + done + +fi exec echo "<fc=#404040></fc> <fc=#404040>│</fc> " diff --git a/extras/HOME/.xmonad/xmobar-weather b/extras/HOME/.xmonad/xmobar-weather index 6b5c409..0fee524 100755 --- a/extras/HOME/.xmonad/xmobar-weather +++ b/extras/HOME/.xmonad/xmobar-weather @@ -69,30 +69,30 @@ if ($current_str gt $sunrise_str and $current_str lt $sunset_str) { $dir=%directions{$wind_direction}; %conditions_day = ( - clear => "<fc=#ddcf04>", - sunny => "<fc=#ddcf04>", - mostly_clear => "<fc=#00a3c4>", - mostly_sunny => "<fc=#ddcf04>", - partly_sunny => "<fc=#ddcf04>", - fair => "<fc=#a0a0a0>🌑", - cloudy =>"<fc=#a0a0a0>摒", - overcast =>"<fc=#808080>", - partly_cloudy => "<fc=#a0a0a0>杖", - mostly_cloudy => "<fc=#808080>", - considerable_cloudiness => "<fc=#a0a0a0>ﭽ" ); + clear => "<fc=#ddcf04></fc>", + sunny => "<fc=#ddcf04></fc>", + mostly_clear => "<fc=#00a3c4></fc>", + mostly_sunny => "<fc=#ddcf04></fc>", + partly_sunny => "<fc=#ddcf04></fc>", + fair => "<fc=#a0a0a0>🌑</fc>", + cloudy =>"<fc=#a0a0a0>摒</fc>", + overcast =>"<fc=#808080></fc>", + partly_cloudy => "<fc=#a0a0a0>杖</fc>", + mostly_cloudy => "<fc=#808080></fc>", + considerable_cloudiness => "<fc=#a0a0a0>ﭽ</fc>" ); %conditions_night = ( - clear => "<fc=#00a3c4>", - sunny => "<fc=#00a3c4>", - mostly_clear => "<fc=#00a3c4>", - mostly_sunny => "<fc=#00a3c4>", - partly_sunny => "<fc=#00a3c4>", - fair => "<fc=#808080>🌑", - cloudy =>"<fc=#808080>摒", - overcast =>"<fc=#404040>", - partly_cloudy => "<fc=#a0a0a0>", - mostly_cloudy => "<fc=#808080>", - considerable_cloudiness => "<fc=#a0a0a0>ﭽ" ); + clear => "<fc=#00a3c4></fc>", + sunny => "<fc=#00a3c4></fc>", + mostly_clear => "<fc=#00a3c4></fc>", + mostly_sunny => "<fc=#00a3c4></fc>", + partly_sunny => "<fc=#00a3c4></fc>", + fair => "<fc=#808080>🌑</fc>", + cloudy =>"<fc=#808080>摒</fc>", + overcast =>"<fc=#404040></fc>", + partly_cloudy => "<fc=#a0a0a0></fc>", + mostly_cloudy => "<fc=#808080></fc>", + considerable_cloudiness => "<fc=#a0a0a0>ﭽ</fc>" ); if ($is_day) { $conditions = %conditions_day{$sky_conditions}; @@ -100,4 +100,4 @@ if ($is_day) { $conditions = %conditions_night{$sky_conditions}; } -printf("<fc=#a0a0a0><fn=3>$city</fn> <fn=3>$dir</fn> <fn=3>${wind_speed}</fn></fc> $conditions</fc><fn=3> <fc=#a0a0a0>%.0f°F</fc></fn>\n", $temp); +printf("<fc=#a0a0a0><fn=3>$city</fn> <fn=3>$dir</fn> <fn=3>${wind_speed}</fn></fc> $conditions<fn=3> <fc=#a0a0a0>%.0f°F</fc></fn>\n", $temp); -- cgit