From 6e11f434d71a49a6f3dd42d1471eaf7b46003717 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Wed, 4 Jan 2023 18:37:40 -0500 Subject: updating scripts --- .config/newsboat/urls | 1 + .config/xinitrc | 2 +- .local/bin/internet | 10 ++++++++++ .local/bin/prompt | 2 ++ .local/bin/weather | 2 +- 5 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 .local/bin/internet create mode 100755 .local/bin/prompt diff --git a/.config/newsboat/urls b/.config/newsboat/urls index ac37640..bb50b94 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -9,3 +9,4 @@ https://lukesmith.xyz/lindy.xml "Lindy Press" https://drewdevault.com/blog/index.xml "Drew DeVault" https://www.youtube.com/feeds/videos.xml?channel_id=FEwhat_to_watch "Rex Krueger" https://www.youtube.com/feeds/videos.xml?channel_id=FEwhat_to_watch "Rex Krueger" +https://jacobmcdonnell.com/articles/rss.xml diff --git a/.config/xinitrc b/.config/xinitrc index 451b5dd..4eef6ce 100755 --- a/.config/xinitrc +++ b/.config/xinitrc @@ -1,8 +1,8 @@ #!/bin/sh exec $HOME/.local/bin/setWall $HOME/Documents/Pictures/Wallpapers/ & exec /usr/bin/picom & -[ $wm == "/usr/local/bin/dwm" ] && exec /usr/local/bin/dwmblocks & exec /usr/bin/mpd /home/jmm/.config/mpd/mpd.conf & exec $HOME/.local/bin/keys & exec /usr/bin/pipewire & +[ $wm == "/usr/local/bin/dwm" ] && exec /usr/local/bin/dwmblocks & exec $wm diff --git a/.local/bin/internet b/.local/bin/internet new file mode 100755 index 0000000..70e48ec --- /dev/null +++ b/.local/bin/internet @@ -0,0 +1,10 @@ +#!/bin/sh + +[ "$(connmanctl services | grep "Wired" | awk -F' ' '{print $2}')" = "Wired" ] && CONNECTION="Wired" || CONNECTION="$(connmanctl services | grep '*' | awk -F' ' '{print $2}')" + +[ "$CONNECTION" = "Wired" ] && IP="$(ip address | grep dynamic | grep 192.168.)" || IP="$(ip address | grep wlo | grep 192.168. )" + +IP="${IP%/*}" +IP="${IP##* }" + +printf $CONNECTION diff --git a/.local/bin/prompt b/.local/bin/prompt new file mode 100755 index 0000000..52f8af3 --- /dev/null +++ b/.local/bin/prompt @@ -0,0 +1,2 @@ +#!/bin/sh +[ "$(printf "No\\nYes" | dmenu -i -p "$1" -nb darkred -sb red -sf white -nf gray )" = "Yes" ] && $2 diff --git a/.local/bin/weather b/.local/bin/weather index 000ba1b..a52a855 100755 --- a/.local/bin/weather +++ b/.local/bin/weather @@ -4,7 +4,7 @@ getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 curl -sf "wttr.in/Ocean+City" > "$HOME/.cache/weatherreport" || exit 1 ;} showweather() { printf "%s" "$(sed '16q;d' "$HOME/.cache/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" -sed '13q;d' "$HOME/.cache/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +sed '13q;d' "$HOME/.cache/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print "❄️",$1 "°","🌞",$2 "°"}' ;} [ "$(stat -c %y "$HOME/.cache/weatherreport" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && getforecast showweather -- cgit v1.2.3