diff --git a/.bashrc b/.bashrc index 1de8e06..e345c06 100755 --- a/.bashrc +++ b/.bashrc @@ -13,12 +13,11 @@ elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi -reminder_output=$(remind -h ~/.reminders) +reminder_output=$(remind -h ~/.config/remind/reminders) # Check if the reminder_output is not empty if [ -n "$reminder_output" ]; then - echo "Reminders:" - remind -h ~/.reminders + remind -h ~/.config/remind/reminders fi ####################################################### diff --git a/.config/waybar/config b/.config/waybar/config index 6a9e607..c9cedad 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -4,7 +4,7 @@ "height": 35, "modules-left": ["sway/workspaces"], "modules-center": ["clock"], - "modules-right": ["custom/l_end","custom/wlsunset","custom/padd","pulseaudio", "custom/padd","network", "custom/padd","battery", "tray", "custom/power","custom/padd"], + "modules-right": ["custom/l_end","custom/music","custom/padd","custom/weather","custom/padd","pulseaudio", "custom/padd","network", "custom/padd","battery","custom/padd","custom/wlsunset","custom/padd", "tray","custom/power","custom/padd"], "sway/workspaces": { "disable-scroll": true, "all-outputs": true, @@ -24,7 +24,16 @@ "format": "{:  %H:%M  %A %B %d}", "tooltip-format": "{calendar}" }, - + "custom/music": { + "exec": "~/.config/waybar/scripts/music.py", + "interval": 5, + "tooltip": false + }, + "custom/weather": { + "exec": "~/.config/waybar/scripts/weather.py", + "interval": 600, + "tooltip": true + }, "battery": { "interval": 30, "states": { @@ -67,7 +76,7 @@ }, "custom/power": { - "format": "⏻{}", + "format": "󰐥{}", //"exec": "echo ; echo  logout", "on-click": "wlogout -p layer-shell", "interval" : 86400, // once every day diff --git a/.config/waybar/scripts/music.py b/.config/waybar/scripts/music.py new file mode 100755 index 0000000..0d0830a --- /dev/null +++ b/.config/waybar/scripts/music.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import subprocess + + +def get_playerctl_metadata(field): + result = subprocess.run( + ["playerctl", "--player=strawberry", "metadata", field], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + ) + if result.returncode == 0: + return result.stdout.strip() + return None + + +artist = get_playerctl_metadata("artist") +title = get_playerctl_metadata("title") + +if artist and title: + print(f"󰝚 {artist} - {title}") diff --git a/.config/waybar/scripts/weather.py b/.config/waybar/scripts/weather.py new file mode 100755 index 0000000..b267038 --- /dev/null +++ b/.config/waybar/scripts/weather.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +import requests +import json +import sys + +API_KEY = "99631af2d6db903d1f689c7d2cb13764" +CITY_ID = "5809844" +UNITS = "metric" + + +def celsius_to_fahrenheit(celsius): + return (celsius * 9 / 5) + 32 + + +def get_weather_icon(description): + icons = { + "clear sky": "󰖙", + "few clouds": "", + "scattered clouds": "", + "broken clouds": "", + "shower rain": "", + "rain": "", + "thunderstorm": "", + "snow": "", + "mist": "󰖑", + "overcast clouds": "", + } + return icons.get(description, "❓") + + +try: + response = requests.get( + f"http://api.openweathermap.org/data/2.5/weather?id={CITY_ID}&units={UNITS}&appid={API_KEY}" + ) + response.raise_for_status() + weather_data = response.json() + + weather_desc = weather_data["weather"][0]["description"] + temp_c = weather_data["main"]["temp"] + temp_f = celsius_to_fahrenheit(temp_c) + weather_icon = get_weather_icon(weather_desc) + + print(f"{weather_icon} {temp_c:.1f}°C / {temp_f:.1f}°F") + +except requests.exceptions.RequestException as e: + print(f"Error: {e}") + print(json.dumps({"text": "", "tooltip": "Could not retrieve weather data"})) + sys.exit(1) + +except json.JSONDecodeError: + print("Error: Failed to parse JSON response") + print(response.content) + sys.exit(1) diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 9ec7e02..e4ef44c 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -1,92 +1,68 @@ -\* { +/* General styles */ +* { border: none; border-radius: 0; font-family: Iosevka, FontAwesome; font-size: 15px; min-height: 0; + color: #bebebe; } window#waybar { opacity: 0.7; background: #000000; - color: #bebebe; } +/* Specific module styles */ #workspaces button { - color: #bebebe; background: transparent; - padding: 0px 5px 0px 5px; - margin: 5px 10px 0 10px; -} -#workspaces button.focused { - color: white; - margin: 5px 10px 0 10px; } +#workspaces button.focused, #workspaces button.active { color: white; - margin: 5px 10px 0 10px; } -#workspaces button.urgent{ - margin: 5px 10px 0 10px; - padding: 0px 8px 0px 8px; +#workspaces button.urgent { animation-duration: 0.5s; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: alternate; border-radius: 7px; - } +} + #mode { font-family: "Iosevka"; - margin: 0px 15px 0px 15px; - padding: 0px 12px 0px 12px; color: black; background: white; } -#battery{ - color: #bebebe; - margin:7px 4px 0 4px; +#battery { border-radius: 5px; - padding: 0px 5px 0px 5px; - } +} #network { - color: #bebebe; - margin:7px 4px 4px 4px; - font-size: 16.5px; border-radius: 6px; - /* padding: 0px 5px 0px 5px; */ } -#custom-power { - color: #bebebe; - margin:7px 4px 0 4px; - font-size: 16.5px; - border-radius: 6px; - /*padding: 0px 0px 0px 0px;*/ -} +/* Animations */ @keyframes critical { to { - background: rgba(187,56,0, 1); - border-radius: 7px; - margin:7px 4px 0 4px; - padding: 3px 8px 2px 8px; + background: rgba(187,56,0, 1); + border-radius: 7px; } } + @keyframes urgent { to { - background: rgba(212,140,0, 1); - color: black; - border-radius: 7px; + background: rgba(212,140,0, 1); + color: black; + border-radius: 7px; } } #battery.critical:not(.charging) { - padding: 0px 6px 0px 6px; - color: #bebebe; animation-name: critical; animation-duration: 0.5s; animation-timing-function: linear; @@ -95,54 +71,36 @@ window#waybar { } #clock { - border: none; - color: #bebebe; font-family: Manjari; - font-size: 16.5px; - border-radius: 0; - padding: 3px 6px 2px 0px; } -#clock:hover { - box-shadow: inherit; - text-shadow: inherit; - background: inherit; +#custom-weather { + font-family: Manjari; } -#custom-wlsunset { - margin:7px 4px 0 4px; - color: #bebebe; - border: none; - border-radius: 0; - /* padding: 0px px 5px 0px; */ +#custom-music { + font-family: Manjari; } -#custom-wlsunset:hover { - box-shadow: inherit; - text-shadow: inherit; - background: inherit; -} +#custom-wlsunset {} #pulseaudio { background: transparent; - margin:7px 4px 0 4px; - font-size: 16.5px; - color: #bebebe; - /* border-radius: 5px; */ - /* padding: 0px 5px 0px 5px; */ +} + +#custom-power { + margin:0px 3px 0px 0px; + border-radius: 6px; } #tray { - margin: 7px 15px 3px 4px; + margin: 7px 10px 8px 4px; background: rgba(40,40,40, .65); border-radius: 6px; - padding: 5px 3px 5px 5px; + padding: 5px 5px 5px 5px; } #idle_inhibitor { - color: #bebebe; background: transparent; - margin: 7px 4px 0 4px; border-radius: 6px; - padding: 0px 5px 0px 5px; }