diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2021-11-06 00:50:47 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2021-11-06 00:50:47 -0600 |
| commit | d78c2c6f774f0b06b5914fcf99545a879ae8cc10 (patch) | |
| tree | c1f98bb9e4b545207901c089dd305f063060542e /extras/HOME | |
| parent | ea44b017950cbab49a68959190ab0a859d45e7b1 (diff) | |
| parent | 62eccced2d4a756b719dae9c25dc3859360608c2 (diff) | |
| download | rde-d78c2c6f774f0b06b5914fcf99545a879ae8cc10.tar.gz rde-d78c2c6f774f0b06b5914fcf99545a879ae8cc10.tar.bz2 rde-d78c2c6f774f0b06b5914fcf99545a879ae8cc10.zip | |
Merge branch 'master' of github.com:jrahm/xmonad-jrahm
Diffstat (limited to 'extras/HOME')
| -rw-r--r-- | extras/HOME/.config/compton.conf | 4 | ||||
| -rw-r--r-- | extras/HOME/.xmobarrc | 24 | ||||
| -rwxr-xr-x | extras/HOME/.xmonad/xmobar-weather | 101 |
3 files changed, 109 insertions, 20 deletions
diff --git a/extras/HOME/.config/compton.conf b/extras/HOME/.config/compton.conf index 828d949..c669100 100644 --- a/extras/HOME/.config/compton.conf +++ b/extras/HOME/.config/compton.conf @@ -13,8 +13,8 @@ shadow-red = 0.0; shadow-green = 0.0; shadow-blue = 0.0; -inactive-dim=0.1 -inactive-opacity=0.99 +inactive-dim=0.2 +inactive-opacity=0.98 shadow-exclude = [ # From the Ubuntu forums link ('screaminj3sus') diff --git a/extras/HOME/.xmobarrc b/extras/HOME/.xmobarrc index 52798af..e2a3e9f 100644 --- a/extras/HOME/.xmobarrc +++ b/extras/HOME/.xmobarrc @@ -1,12 +1,13 @@ Config - { font = "xft:Monofur Nerd Font:size=15" + { font = "xft:Monofur Nerd Font:size=12" , additionalFonts = [ "xft:Monofur bold Nerd Font:style=bold:size=12", "xft:Monofur Nerd Font:size=9", "xft:Monofur Nerd Font:size=9", "xft:Monofur Nerd Font:size=6", "xft:Monofur bold Nerd Font:size=15", - "xft:Monofur Nerd Font:style=bold:size=10" + "xft:Monofur Nerd Font:style=bold:size=10", + "xft:Noto Sans Mono CJK JP:style=bold:size=10" ] , borderColor = "black" , border = FullBM -1 @@ -14,7 +15,7 @@ Config , bgColor = "#000000" , fgColor = "white" , alpha = 220 -- default: 255 - , position = TopSize L 100 40 + , position = TopSize L 100 50 , textOffset = -1 -- default: -1 , iconOffset = -1 -- default: -1 , lowerOnStart = True @@ -31,7 +32,7 @@ Config \</fc><fc=#a0a0a0> %date%</fc><fc=#404040> │ \ \</fc>%StdinReader%}<fn=6><fc=#909090>%time%</fc></fn>\ \{ %cpu% %memory% <fc=#404040>\ - \│</fc> %KLMO% <fc=#404040>│\ + \│</fc> %weather% <fc=#404040>│\ \</fc> <fc=#a0a0a0>%mpris2%</fc> <fc=#404040>│ \ \</fc>%bluetooth%%bat% " , commands = [ @@ -56,23 +57,10 @@ Config "--normal", "#88ff88", "--high", "#ff8888" ] 10, - Run WeatherX "KLMO" - [ ("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>ﭽ")] - ["--template", "<skyConditionS></fc><fn=3><fc=#a0a0a0> \ - \<tempF>°F</fc></fn>"] 360000, Run Mpris2 "spotify" [ "-t", "<fc=#1aa54b></fc> <fn=3><title></fn>", "--nastring", "<fc=#404040> </fc>"] 20, + Run Com ".xmonad/xmobar-weather" [] "weather" 9000, Run Com ".xmonad/xmobar-logo" [] "logo" 0, Run Com "uname" ["-r"] "uname" 0, Run Com ".xmonad/xmobar-bluetooth" [] "bluetooth" 50, diff --git a/extras/HOME/.xmonad/xmobar-weather b/extras/HOME/.xmonad/xmobar-weather new file mode 100755 index 0000000..d9dc88b --- /dev/null +++ b/extras/HOME/.xmonad/xmobar-weather @@ -0,0 +1,101 @@ +#!/usr/bin/perl + +use LWP::Simple; +use Time::Local; +use POSIX; + +$content = get("https://ipinfo.io"); + +die "Unable to get IP info" unless defined $content; + +($city, $lat, $lon) = + ($content =~ m/.*"city":\s+"([^"]+)".*"loc":\s+"(-?[0-9.]+),(-?[0-9.]+).*"/ims); + +$content = get( + "https://api.sunrise-sunset.org/json?lat=$lat&lng=$lon&formatted=0"); + +die "Unable to get sunrise/sunset data" unless defined $content; + +$sunrise_str=$content; +$sunset_str=$content; +$sunrise_str =~ s#.*"sunrise":"([^"]*)".*#\1#; +$sunset_str =~ s#.*"sunset":"([^"]*)".*#\1#; +$current_str=strftime "%Y-%m-%dT%H:%M:%S+00:00", gmtime(); + +$content = get( + "https://tgftp.nws.noaa.gov/data/observations/metar/decoded/KLMO.TXT"); + +die "Unable to get weather data" unless defined $content; + +$sky_conditions = $content; +$sky_conditions =~ s#.*Sky conditions:\s+([^\n]+).*#\1#ims; +$sky_conditions =~ s#\s#_#g; + +$wind = $content; +$wind =~ s#.*Wind:\s+([^\n]+).*#\1#ims; +($wind_direction, $wind_speed) = + ($wind =~ m/from the ([A-Z]+).*at (\d+) MPH.*/g); + + +$temp = $content; +$temp =~ s#.*Temperature:\s+(-?[0-9.]+) F.*#\1#ims; + +if ($current_str gt $sunrise_str and $current_str lt $sunset_str) { + $is_day = 1; +} else { + $is_day = 0; +} + +%directions = ( + NE => "", + NNE => "", + ENE => "", + SE => "", + SSE => "", + ESE => "", + NW => "", + NNW => "", + WNW => "", + SW => "", + SSW => "", + WSW => "", + N => "", + S => "", + W => "", + E => "" ); + +$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>ﭽ" ); + +%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>ﭽ" ); + +if ($is_day) { + $conditions = %conditions_day{$sky_conditions}; +} else { + $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); |