From 53d84b7628134058bd4e33872614d2f7cfd6f1f9 Mon Sep 17 00:00:00 2001 From: 0xL30 <72350874+0xl30@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:19:00 +0530 Subject: [PATCH 1/3] Weather Source Update (Python File) --- config/hypr/UserScripts/Weather.py | 232 ++++++++++++++--------------- config/waybar/modules | 4 +- 2 files changed, 118 insertions(+), 118 deletions(-) diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index 154c158..413682e 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -1,122 +1,122 @@ #!/usr/bin/env python3 -# From https://raw.githubusercontent.com/rxyhn/dotfiles/main/home/rxyhn/modules/desktop/waybar/scripts/waybar-wttr.py -## ensure to insert city inside "" -city = "" +import subprocess +from pyquery import PyQuery # install using `pip install pyquery` import json -import requests -from datetime import datetime - -WEATHER_CODES = { - '113': '', - '116': '󰖕', - '119': '', - '122': '', - '143': '', - '176': '', - '179': '', - '182': '', - '185': '', - '200': '⛈️', - '227': '🌨️', - '230': '🌨️', - '248': '☁️ ', - '260': '☁️', - '263': '🌧️', - '266': '🌧️', - '281': '🌧️', - '284': '🌧️', - '293': '🌧️', - '296': '🌧️', - '299': '🌧️', - '302': '🌧️', - '305': '🌧️', - '308': '🌧️', - '311': '🌧️', - '314': '🌧️', - '317': '🌧️', - '320': '🌨️', - '323': '🌨️', - '326': '🌨️', - '329': '❄️', - '332': '❄️', - '335': '❄️', - '338': '❄️', - '350': '🌧️', - '353': '🌧️', - '356': '🌧️', - '359': '🌧️', - '362': '🌧️', - '365': '🌧️', - '368': '🌧️', - '371': '❄️', - '374': '🌨️', - '377': '🌨️', - '386': '🌨️', - '389': '🌨️', - '392': '🌧️', - '395': '❄️' -} - -data = {} - - -weather = requests.get(f"https://wttr.in/{city}?format=j1").json() - - -def format_time(time): - return time.replace("00", "").zfill(2) - - -def format_temp(temp): - return (hour['FeelsLikeC']+"°").ljust(3) -def format_chances(hour): - chances = { - "chanceoffog": "Fog", - "chanceoffrost": "Frost", - "chanceofovercast": "Overcast", - "chanceofrain": "Rain", - "chanceofsnow": "Snow", - "chanceofsunshine": "Sunshine", - "chanceofthunder": "Thunder", - "chanceofwindy": "Wind" - } - - conditions = [] - for event in chances.keys(): - if int(hour[event]) > 0: - conditions.append(chances[event]+" "+hour[event]+"%") - return ", ".join(conditions) - -tempint = int(weather['current_condition'][0]['FeelsLikeC']) -extrachar = '' -if tempint > 0 and tempint < 10: - extrachar = '+' - - -data['text'] = ' '+WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \ - " "+extrachar+weather['current_condition'][0]['FeelsLikeC']+"°" - -data['tooltip'] = f"{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°\n" -data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n" -data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n" -data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n" -for i, day in enumerate(weather['weather']): - data['tooltip'] += f"\n" - if i == 0: - data['tooltip'] += "Today, " - if i == 1: - data['tooltip'] += "Tomorrow, " - data['tooltip'] += f"{day['date']}\n" - data['tooltip'] += f"⬆️{day['maxtempC']}° ⬇️{day['mintempC']}° " - data['tooltip'] += f"🌅{day['astronomy'][0]['sunrise']} 🌇{day['astronomy'][0]['sunset']}\n" - for hour in day['hourly']: - if i == 0: - if int(format_time(hour['time'])) < datetime.now().hour-2: - continue - data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" - +# original code https://gist.github.com/Surendrajat/ff3876fd2166dd86fb71180f4e9342d7 +# weather icons +weather_icons = { + "sunnyDay": "", + "clearNight": "", + "cloudyFoggyDay": "", + "cloudyFoggyNight": "", + "rainyDay": "", + "rainyNight": "", + "snowyIcyDay": "", + "snowyIcyNight": "", + "severe": "", + "default": "", +} -print(json.dumps(data)) +# get location_id +# to get your own location_id, go to https://weather.com & search your location. +# once you choose your location, you can see the location_id in the URL(64 chars long hex string) +# like this: https://weather.com/en-IN/weather/today/l/c3e96d6cc4965fc54f88296b54449571c4107c73b9638c16aafc83575b4ddf2e +location_id = "c3e96d6cc4965fc54f88296b54449571c4107c73b9638c16aafc83575b4ddf2e" # TODO + +# get html page +url = "https://weather.com/en-IN/weather/today/l/" + location_id +html_data = PyQuery(url=url) + +# current temperature +temp = html_data("span[data-testid='TemperatureValue']").eq(0).text() +# print(temp) + +# current status phrase +status = html_data("div[data-testid='wxPhrase']").text() +status = f"{status[:16]}.." if len(status) > 17 else status +# print(status) + +# status code +status_code = html_data("#regionHeader").attr("class").split(" ")[2].split("-")[2] +# print(status_code) + +# status icon +icon = ( + weather_icons[status_code] + if status_code in weather_icons + else weather_icons["default"] +) +# print(icon) + +# temperature feels like +temp_feel = html_data( + "div[data-testid='FeelsLikeSection'] > span > span[data-testid='TemperatureValue']" +).text() +temp_feel_text = f"Feels like {temp_feel}c" +# print(temp_feel_text) + +# min-max temperature +temp_min = ( + html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']") + .eq(0) + .text() +) +temp_max = ( + html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']") + .eq(1) + .text() +) +temp_min_max = f" {temp_min}\t\t {temp_max}" +# print(temp_min_max) + +# wind speed +wind_speed = html_data("span[data-testid='Wind']").text().split("\n")[1] +wind_text = f"煮 {wind_speed}" +# print(wind_text) + +# humidity +humidity = html_data("span[data-testid='PercentageValue']").text() +humidity_text = f" {humidity}" +# print(humidity_text) + +# visibility +visbility = html_data("span[data-testid='VisibilityValue']").text() +visbility_text = f" {visbility}" +# print(visbility_text) + +# air quality index +air_quality_index = html_data("text[data-testid='DonutChartValue']").text() +# print(air_quality_index) + +# hourly rain prediction +prediction = html_data("section[aria-label='Hourly Forecast']")( + "div[data-testid='SegmentPrecipPercentage'] > span" +).text() +prediction = prediction.replace("Chance of Rain", "") +prediction = f"\n\n (hourly) {prediction}" if len(prediction) > 0 else prediction +# print(prediction) + +# tooltip text +tooltip_text = str.format( + "\t\t{}\t\t\n{}\n{}\n{}\n\n{}\n{}\n{}{}", + f'{temp}', + f" {icon}", + f"{status}", + f"{temp_feel_text}", + f"{temp_min_max}", + f"{wind_text}\t{humidity_text}", + f"{visbility_text}\tAQI {air_quality_index}", + f" {prediction}", +) + +# print waybar module data +out_data = { + "text": f"{icon} {temp}", + "alt": status, + "tooltip": tooltip_text, + "class": status_code, +} +print(json.dumps(out_data)) diff --git a/config/waybar/modules b/config/waybar/modules index 1165211..723f6b1 100644 --- a/config/waybar/modules +++ b/config/waybar/modules @@ -573,8 +573,8 @@ "format-alt-click": "click", "interval": 3600, "return-type": "json", - "exec": "~/.config/hypr/UserScripts/Weather.sh", - //"exec": "~/.config/hypr/UserScripts/Weather.py", + "exec": "~/.config/hypr/UserScripts/Weather.py", + //"exec": "~/.config/hypr/UserScripts/Weather.sh", "exec-if": "ping wttr.in -c1", "tooltip" : true, }, From c04bc33fdd0005c959ad5f44ca19ce94ae1a961c Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Fri, 3 May 2024 17:33:39 +0900 Subject: [PATCH 2/3] Update modules --- config/waybar/modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/waybar/modules b/config/waybar/modules index 723f6b1..b9b57e2 100644 --- a/config/waybar/modules +++ b/config/waybar/modules @@ -573,8 +573,8 @@ "format-alt-click": "click", "interval": 3600, "return-type": "json", - "exec": "~/.config/hypr/UserScripts/Weather.py", - //"exec": "~/.config/hypr/UserScripts/Weather.sh", + //"exec": "~/.config/hypr/UserScripts/Weather.py", + "exec": "~/.config/hypr/UserScripts/Weather.sh", "exec-if": "ping wttr.in -c1", "tooltip" : true, }, From a9b1cea6130baaeb8fa8a4cc3bb088c6b17885d6 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Fri, 3 May 2024 17:34:20 +0900 Subject: [PATCH 3/3] Delete config/waybar/modules --- config/waybar/modules | 730 ------------------------------------------ 1 file changed, 730 deletions(-) delete mode 100644 config/waybar/modules diff --git a/config/waybar/modules b/config/waybar/modules deleted file mode 100644 index b9b57e2..0000000 --- a/config/waybar/modules +++ /dev/null @@ -1,730 +0,0 @@ -//* ---- 💫 https://github.com/JaKooLit 💫 ---- *// - -{ -// HYPRLAND WORKSPACES. CHOOSE as desired and place on waybar configs -// CIRCLES Style -"hyprland/workspaces": { - "active-only": false, - "all-outputs": true, - "format": "{icon}", - "show-special": false, - "on-click": "activate", - "on-scroll-up": "hyprctl dispatch workspace e+1", - "on-scroll-down": "hyprctl dispatch workspace e-1", - "persistent-workspaces": { - "1": [], - "2": [], - "3": [], - "4": [], - "5": [], - }, - "format-icons": { - "active": "", - "default": "", - }, -}, - -// ROMAN Numerals style -"hyprland/workspaces#roman": { - "active-only":false, - "all-outputs": true, - "format": "{icon}", - "show-special": false, - "on-click": "activate", - "on-scroll-up": "hyprctl dispatch workspace e+1", - "on-scroll-down": "hyprctl dispatch workspace e-1", - "persistent-workspaces":{ - "1": [], - "2": [], - "3": [], - "4": [], - "5": [], - }, - "format-icons": { - "1": "I", - "2": "II", - "3": "III", - "4": "IV", - "5": "V", - "6": "VI", - "7": "VII", - "8": "VIII", - "9": "IX", - "10": "X", - - }, -}, - -// PACMAN Style - "hyprland/workspaces#pacman": { - "active-only":false, - "all-outputs": true, - "format": "{icon}", - "on-click": "activate", - "on-scroll-up": "hyprctl dispatch workspace e+1", - "on-scroll-down": "hyprctl dispatch workspace e-1", - "show-special": false, - "persistent-workspaces":{ - "1": [], - "2": [], - "3": [], - "4": [], - "5": [], - }, - "format": "{icon}", - "format-icons": { - "active": " 󰮯 ", - "default": "󰊠", - "persistent":"󰊠", - }, -}, - -"hyprland/workspaces#kanji": { - "disable-scroll": true, - "all-outputs": true, - "format": "{icon}", - "persistent-workspaces": { - "1": [], - "2": [], - "3": [], - "4": [], - "5": [], - }, - "format-icons": { - "1": "一", - "2": "二", - "3": "三", - "4": "四", - "5": "五", - "6": "六", - "7": "七", - "8": "八", - "9": "九", - "10": "十", - } -}, - -// NUMBERS and ICONS style -"hyprland/workspaces#4": { - "format": "{name}", - "format": " {name} {icon} ", - //"format": " {icon} ", - "show-special": false, - "on-click": "activate", - "on-scroll-up": "hyprctl dispatch workspace e+1", - "on-scroll-down": "hyprctl dispatch workspace e-1", - "all-outputs": true, - "sort-by-number": true, - "format-icons": { - "1": " ", - "2": " ", - "3": " ", - "4": " ", - "5": " ", - "6": " ", - "7": "", - "8": " ", - "9": "", - "10": "10", - "focused": "", - "default": "", - }, -}, - -// GROUP - -"group/motherboard": { - "orientation": "horizontal", - "modules": [ - "cpu", - "memory", - "temperature", - "disk", - ] -}, - -"group/laptop": { - "orientation": "horizontal", - "modules": [ - "backlight", - "battery", - ] -}, - -"group/audio": { - "orientation": "horizontal", - "modules": [ - "pulseaudio", - "pulseaudio#microphone", - ] -}, - -"backlight": { - "interval": 2, - "align": 0, - "rotate": 0, - //"format": "{icon} {percent}%", - "format-icons": [" ", " ", " ", "󰃝 ", "󰃞 ", "󰃟 ", "󰃠 "], - "format": "{icon}", - //"format-icons": ["","","","","","","","","","","","","","",""], - "tooltip-format": "backlight {percent}%", - "icon-size": 10, - "on-click": "", - "on-click-middle": "", - "on-click-right": "", - "on-update": "", - "on-scroll-up": "~/.config/hypr/scripts/Brightness.sh --inc", - "on-scroll-down": "~/.config/hypr/scripts/Brightness.sh --dec", - "smooth-scrolling-threshold": 1, -}, - -"battery": { - //"interval": 5, - "align": 0, - "rotate": 0, - //"bat": "BAT1", - //"adapter": "ACAD", - "full-at": 100, - "design-capacity": false, - "states": { - "good": 95, - "warning": 30, - "critical": 15 - }, - "format": "{icon} {capacity}%", - "format-charging": "{capacity}%", - "format-plugged": "󱘖 {capacity}%", - "format-alt-click": "click", - "format-full": "{icon} Full", - "format-alt": "{icon} {time}", - "format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], - "format-time": "{H}h {M}min", - "tooltip": true, - "tooltip-format": "{timeTo} {power}w", - "on-click-middle": "~/.config/hypr/scripts/ChangeBlur.sh", - "on-click-right": "~/.config/hypr/scripts/Wlogout.sh", -}, - -"bluetooth": { - "format": "", - "format-disabled": "󰂳", - "format-connected": "󰂱 {num_connections}", - "tooltip-format": " {device_alias}", - "tooltip-format-connected": "{device_enumerate}", - "tooltip-format-enumerate-connected": " {device_alias} 󰂄{device_battery_percentage}%", - "tooltip": true, - "on-click": "blueman-manager", -}, - -"clock": { - "interval": 1, - //"format": " {:%I:%M %p}", // AM PM format - "format": " {:%H:%M:%S}", - "format-alt": " {:%H:%M  %Y, %d %B, %A}", - "tooltip-format": "{calendar}", - "calendar": { - "mode" : "year", - "mode-mon-col" : 3, - "weeks-pos" : "right", - "on-scroll" : 1, - "format": { - "months": "{}", - "days": "{}", - "weeks": "W{}", - "weekdays": "{}", - "today": "{}" - } - } - }, - "actions": { - "on-click-right": "mode", - "on-click-forward": "tz_up", - "on-click-backward": "tz_down", - "on-scroll-up": "shift_up", - "on-scroll-down": "shift_down" -}, - -"cpu": { - "format": "{usage}% 󰍛", - "interval": 1, - "format-alt-click": "click", - "format-alt": "{icon0}{icon1}{icon2}{icon3} {usage:>2}% 󰍛", - "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], - "on-click-right": "gnome-system-monitor", -}, - -"disk": { - "interval": 30, - //"format": "󰋊", - "path": "/", - //"format-alt-click": "click", - "format": "{percentage_used}% 󰋊", - //"tooltip": true, - "tooltip-format": "{used} used out of {total} on {path} ({percentage_used}%)", -}, - -"hyprland/language": { - "format": "Lang: {}", - "format-en": "US", - "format-tr": "Korea", - "keyboard-name": "at-translated-set-2-keyboard", - "on-click": "hyprctl switchxkblayout $SET_KB next" -}, - -"hyprland/submap": { - "format": " {}", // Icon: expand-arrows-alt - "tooltip": false, -}, - -"hyprland/window": { - "format": "{}", - "max-length": 40, - "separate-outputs": true, - "offscreen-css" : true, - "offscreen-css-text": "(inactive)", - "rewrite": { - "(.*) — Mozilla Firefox": " $1", - "(.*) - fish": "> [$1]", - "(.*) - zsh": "> [$1]", - "(.*) - kitty": "> [$1]", - }, -}, - -"idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": " ", - "deactivated": " ", - } -}, - -"keyboard-state": { - //"numlock": true, - "capslock": true, - "format": { - "numlock": "N {icon}", - "capslock":"󰪛 {icon}", - }, - "format-icons": { - "locked": "", - "unlocked": "" - }, -}, - -"memory": { - "interval": 10, - "format": "{used:0.1f}G 󰾆", - "format-alt": "{percentage}% 󰾆", - "format-alt-click": "click", - "tooltip": true, - "tooltip-format": "{used:0.1f}GB/{total:0.1f}G", - "on-click-right": "kitty --title btop sh -c 'btop'" -}, - -"mpris": { - "interval": 10, - "format": "{player_icon} ", - "format-paused": "{status_icon} {dynamic}", - "on-click-middle": "playerctl play-pause", - "on-click": "playerctl previous", - "on-click-right": "playerctl next", - "scroll-step": 5.0, - "on-scroll-up": "~/.config/hypr/scripts/Volume.sh --inc", - "on-scroll-down": "~/.config/hypr/scripts/Volume.sh --dec", - "smooth-scrolling-threshold": 1, - "player-icons": { - "chromium": "", - "default": "", - "firefox": "", - "kdeconnect": "", - "mopidy": "", - "mpv": "󰐹", - "spotify": "", - "vlc": "󰕼", - }, - "status-icons": { - "paused": "󰐎", - "playing": "", - "stopped": "", - }, - // "ignored-players": ["firefox"] - "max-length": 30, -}, - -"network": { - "format": "{ifname}", - "format-wifi": "{icon}", - "format-ethernet": "󰌘", - "format-disconnected": "󰌙", - "tooltip-format": "{ipaddr}  {bandwidthUpBytes}  {bandwidthDownBytes}", - "format-linked": "󰈁 {ifname} (No IP)", - "tooltip-format-wifi": "{essid} {icon} {signalStrength}%", - "tooltip-format-ethernet": "{ifname} 󰌘", - "tooltip-format-disconnected": "󰌙 Disconnected", - "max-length": 50, - "format-icons": ["󰤯","󰤟","󰤢","󰤥","󰤨"] -}, - -"network#speed": { - "interval": 1, - "format": "{ifname}", - "format-wifi": "{icon}  {bandwidthUpBytes}  {bandwidthDownBytes}", - "format-ethernet": "󰌘  {bandwidthUpBytes}  {bandwidthDownBytes}", - "format-disconnected": "󰌙", - "tooltip-format": "{ipaddr}", - "format-linked": "󰈁 {ifname} (No IP)", - "tooltip-format-wifi": "{essid} {icon} {signalStrength}%", - "tooltip-format-ethernet": "{ifname} 󰌘", - "tooltip-format-disconnected": "󰌙 Disconnected", - "max-length": 50, - "format-icons": ["󰤯","󰤟","󰤢","󰤥","󰤨"] -}, - -"pulseaudio": { - "format": "{icon} {volume}%", - "format-bluetooth": "{icon} 󰂰 {volume}%", - "format-muted": "󰖁", - "format-icons": { - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", "", "󰕾", ""], - "ignored-sinks": ["Easy Effects Sink"], - }, - "scroll-step": 5.0, - "on-click": "~/.config/hypr/scripts/Volume.sh --toggle", - "on-click-right": "pavucontrol -t 3", - "on-scroll-up": "~/.config/hypr/scripts/Volume.sh --inc", - "on-scroll-down": "~/.config/hypr/scripts/Volume.sh --dec", - "tooltip-format": "{icon} {desc} | {volume}%", - "smooth-scrolling-threshold": 1, -}, - -"pulseaudio#microphone": { - "format": "{format_source}", - "format-source": " {volume}%", - "format-source-muted": "", - "on-click": "~/.config/hypr/scripts/Volume.sh --toggle-mic", - "on-click-right": "pavucontrol -t 4", - "on-scroll-up": "~/.config/hypr/scripts/Volume.sh --mic-inc", - "on-scroll-down": "~/.config/hypr/scripts/Volume.sh --mic-dec", - "tooltip-format": "{source_desc} | {source_volume}%", - "scroll-step": 5, -}, - -"temperature": { - "interval": 10, - "tooltip": true, - "hwmon-path": ["/sys/class/hwmon/hwmon1/temp1_input", "/sys/class/thermal/thermal_zone0/temp"], - //"thermal-zone": 0, - "critical-threshold": 82, - "format-critical": "{temperatureC}°C {icon}", - "format": "{temperatureC}°C {icon}", - "format-icons": ["󰈸"], - "on-click-right": "kitty --title nvtop sh -c 'nvtop'" -}, - -"tray": { - "icon-size": 15, - "spacing": 8, -}, - -"wireplumber": { - "format": "{icon} {volume} %", - "format-muted": " Mute", - "on-click": "~/.config/hypr/scripts/Volume.sh --toggle", - "on-click-right": "pavucontrol -t 3", - "on-scroll-up": "~/.config/hypr/scripts/Volume.sh --inc", - "on-scroll-down": "~/.config/hypr/scripts/Volume.sh --dec", - "format-icons": ["", "", "󰕾", ""], -}, - -"wlr/taskbar": { - "format": "{icon} {name} ", - "icon-size": 15, - "all-outputs": false, - "tooltip-format": "{title}", - "on-click": "activate", - "on-click-middle": "close", - "ignore-list": [ - "wofi", - "rofi", - ] -}, - -"custom/cycle_wall":{ - "format":" ", - "exec": "echo ; echo 󰸉 wallpaper select", - "on-click": "~/.config/hypr/scripts/WallpaperSelect.sh", - "on-click-right": "~/.config/hypr/scripts/Wallpaper.sh", - "on-click-middle": "~/.config/hypr/scripts/WaybarStyles.sh", - "interval" : 86400, // once every day - "tooltip": true, -}, - -"custom/keybinds": { - "format":"󰺁 HINT!", - "exec": "echo ; echo  Key Hints SUPER H", - "on-click": "~/.config/hypr/scripts/KeyHints.sh", - "interval" : 86400, // once every day - "tooltip": true, -}, - -"custom/keyboard": { - "exec": "cat ~/.cache/kb_layout", - "interval": 1, - "format": " {}", - "on-click": "~/.config/hypr/scripts/SwitchKeyboardLayout.sh", - }, - -"custom/light_dark": { - "format": "{}", - "exec": "echo ; echo 󰔎 Dark-Light switcher", - "on-click": "~/.config/hypr/scripts/DarkLight.sh", - "on-click-right": "~/.config/hypr/scripts/WaybarStyles.sh", - "on-click-middle": "~/.config/hypr/scripts/Wallpaper.sh", - "interval" : 86400, // once every day - "tooltip": true -}, - -"custom/lock": { - "format": "󰌾{}", - "exec": "echo ; echo 󰷛 screen lock", - "interval" : 86400, // once every day - "tooltip": true, - "on-click": "~/.config/hypr/scripts/LockScreen.sh", -}, - -"custom/menu": { - "format": "{}", - "exec": "echo ; echo 󱓟 app launcher", - "interval" : 86400, // once every day - "tooltip": true, - "on-click": "pkill rofi || rofi -show drun -modi run,drun,filebrowser,window", - "on-click-middle": "~/.config/hypr/scripts/WallpaperSelect.sh", - "on-click-right": "~/.config/hypr/scripts/WaybarLayout.sh", -}, - -// This is a custom cava visualizer -"custom/cava_mviz": { - "exec": "~/.config/hypr/scripts/WaybarCava.sh", - "format": "{}" -}, - -"custom/playerctl": { - "format": "{}", - "return-type": "json", - "max-length": 35, - "exec": "playerctl -a metadata --format '{\"text\": \"{{artist}} ~ {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F", - "on-click-middle": "playerctl play-pause", - "on-click": "playerctl previous", - "on-click-right": "playerctl next", - "scroll-step": 5.0, - "on-scroll-up": "~/.config/hypr/scripts/Volume.sh --inc", - "on-scroll-down": "~/.config/hypr/scripts/Volume.sh --dec", - "smooth-scrolling-threshold": 1, -}, - -"custom/power": { - "format": "⏻ ", - "exec": "echo ; echo 󰟡 power // blur", - "on-click": "~/.config/hypr/scripts/Wlogout.sh", - "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", - "interval" : 86400, // once every day - "tooltip": true, -}, - -"custom/swaync": { - "tooltip":true, - "format": "{icon} {}", - "format-icons": { - "notification": "", - "none": "", - "dnd-notification": "", - "dnd-none": "", - "inhibited-notification": "", - "inhibited-none": "", - "dnd-inhibited-notification": "", - "dnd-inhibited-none": "" - }, - "return-type": "json", - "exec-if": "which swaync-client", - "exec": "swaync-client -swb", - "on-click": "sleep 0.1 && swaync-client -t -sw", - "on-click-right": "swaync-client -d -sw", - "escape": true, -}, - -// NOTE:! This is only for Arch and Arch Based Distros -"custom/updater":{ - "format": " {}", - "exec": "checkupdates | wc -l", - "exec-if": "[[ $(checkupdates | wc -l) ]]", - "interval": 15, - "on-click": "kitty -T update paru -Syu || yay -Syu && notify-send 'The system has been updated'", -}, - -"custom/weather": { - "format": "{}", - "format-alt": "{alt}: {}", - "format-alt-click": "click", - "interval": 3600, - "return-type": "json", - //"exec": "~/.config/hypr/UserScripts/Weather.py", - "exec": "~/.config/hypr/UserScripts/Weather.sh", - "exec-if": "ping wttr.in -c1", - "tooltip" : true, -}, - - -// Separators -"custom/separator#dot": { - "format": "", - "interval": "once", - "tooltip": false -}, - -"custom/separator#dot-line": { - "format": "", - "interval": "once", - "tooltip": false -}, - -"custom/separator#line": { - "format": "|", - "interval": "once", - "tooltip": false -}, - -"custom/separator#blank": { - "format": "", - "interval": "once", - "tooltip": false -}, - -"custom/separator#blank_2": { - "format": " ", - "interval": "once", - "tooltip": false -}, - -"custom/separator#blank_3": { - "format": " ", - "interval": "once", - "tooltip": false -}, - -// Modules below are for vertical layout - -"backlight#vertical": { - "interval": 2, - "align": 0.35, - "rotate": 1, - "format": "{icon}", - //"format-icons": ["󰃞", "󰃟", "󰃠"], - "format-icons": ["","","","","","","","","","","","","","",""], - "on-click": "", - "on-click-middle": "", - "on-click-right": "", - "on-update": "", - "on-scroll-up": "~/.config/hypr/scripts/Brightness.sh --inc", - "on-scroll-down": "~/.config/hypr/scripts/Brightness.sh --dec", - "smooth-scrolling-threshold": 1, - "tooltip-format": "{percent}%", -}, - -"clock#vertical": { - "format": "{:\n%H\n%M\n%S\n\n \n%d\n%m\n%y}", - "interval": 1, - //"format": "{:\n%I\n%M\n%p\n\n \n%d\n%m\n%y}", - "tooltip": true, - "tooltip-format": "{calendar}", - "calendar": { - "mode": "year", - "mode-mon-col": 3, - "format": { - "today": "{}", - } - } -}, - -"cpu#vertical": { - "format": "󰍛\n{usage}%", - "interval": 1, - "on-click-right": "gnome-system-monitor", -}, - -"memory#vertical": { - "interval": 10, - "format": "󰾆\n{percentage}%", - "format-alt": "󰾆\n{used:0.1f}G", - "format-alt-click": "click", - "tooltip": true, - "tooltip-format": "{used:0.1f}GB/{total:0.1f}G", - "on-click-right": "kitty --title btop sh -c 'btop'", -}, - -"pulseaudio#vertical": { - "format": "{icon}", - "format-bluetooth": "󰂰", - "format-muted": "󰖁", - "format-icons": { - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", "", "󰕾", ""], - "tooltip-format": "{icon} {desc} | {volume}%", - "ignored-sinks": ["Easy Effects Sink"], - }, - "scroll-step": 5.0, - "on-click": "~/.config/hypr/scripts/Volume.sh --toggle", - "on-click-right": "pavucontrol -t 3", - "on-scroll-up": "~/.config/hypr/scripts/Volume.sh --inc", - "on-scroll-down": "~/.config/hypr/scripts/Volume.sh --dec", - "tooltip-format": "{icon} {desc} | {volume}%", - "smooth-scrolling-threshold": 1, -}, - -"pulseaudio#microphone_vertical": { - "format": "{format_source}", - "format-source": "󰍬", - "format-source-muted": "󰍭", - "on-click-right": "pavucontrol", - "on-click": "~/.config/hypr/scripts/Volume.sh --toggle-mic", - "on-scroll-up": "~/.config/hypr/scripts/Volume.sh --mic-inc", - "on-scroll-down": "~/.config/hypr/scripts/Volume.sh --mic-dec", - "max-volume": 100, - "tooltip": true, - "tooltip-format": "{source_desc} | {source_volume}%", -}, - -"temperature#vertical": { - "interval": 10, - "tooltip": true, - "hwmon-path": ["/sys/class/hwmon/hwmon1/temp1_input", "/sys/class/thermal/thermal_zone0/temp"], - //"thermal-zone": 0, - "critical-threshold": 80, - "format-critical": "{icon}\n{temperatureC}°C", - "format": " {icon}", - "format-icons": ["󰈸"], - "on-click-right": "kitty --title nvtop sh -c 'nvtop'" -}, - -"custom/power_vertical": { - "format": "⏻", - "exec": "echo ; echo 󰟡 power // blur", - "on-click": "~/.config/hypr/scripts/Wlogout.sh", - "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", - "interval" : 86400, // once every day - "tooltip": true, -}, - -} - -