remove log since it's not needed

This commit is contained in:
Simon Belmont 2025-04-16 21:01:07 -04:00
parent 24b6464d0b
commit ae9a611ea6
47 changed files with 0 additions and 8388 deletions

View file

@ -1,270 +0,0 @@
[{
"output": "DP-1",
"layer": "top",
"modules-left": ["hyprland/workspaces", "hyprland/mode"],
"modules-center": ["hyprland/window"],
"modules-right": ["mpris"],
"mpris": {
"format": "<span color=\"#bd93f9\">{player_icon}</span> <span color=\"#f8f8f2\">{dynamic}</span>",
"format-paused": "<span color=\"#bd93f9\">{status_icon}</span> <span color=\"#f8f8f2\">{dynamic}</span>",
"tooltip-format": "󰠃 {artist}:  {title} (󰀥 {album})",
"interval": 1,
"album-len": 0,
"player-icons": {
"default": "",
"mpv": ""
},
"status-icons": {
"paused": ""
},
// "ignored-players": ["firefox"]
},
"hyprland/window": {
"format": "<span color=\"#f8f8f2\">{title}</span> ",
"max-length": 60,
"icon": true,
"icon-size": 20,
"all-outputs" : true,
},
// "hyprland/workspaces": {
// "format": "{icon}",
// "on-click": "activate",
// "format-icons": {
// "1": "󰈹",
// "2": "󰼂",
// "3": "󰷈",
// "4": "󱇤",
// "5": "󱜀",
// "6": "",
// },
// "sort-by-number": true
//},
}, {
"output": "eDP-1",
"layer": "top",
"modules-left": ["hyprland/workspaces", "hyprland/mode"],
"modules-center": ["custom/gpu-usage", "cpu", "memory", "temperature", "network#wifi", "network#lan", "custom/vpn", "clock", "custom/weather", "idle_inhibitor", "custom/pacman", "battery", "battery#2", "bluetooth", "backlight", "disk", "disk#disk2", "disk#disk3", "disk#disk4"],
/* "modules-right": ["tray", "pulseaudio",], */
"modules-right": ["tray", "pulseaudio", "group/group-power"],
"hyprland/mode": {
"format": " 󰹶 {}"
},
"hyprland/workspaces": {
"format": "{icon}",
"on-click": "activate",
"format-icons": {
"1": "󰈹",
"2": "",
"3": "󰷈",
"4": "󱇤",
"5": "󰙵",
"6": "󰙵",
"7": "󰙵",
"8": "󰙵",
},
"sort-by-number": true
},
"custom/pacman": {
"format": "<span color=\"#8BE9FD\">󰣇 </span>{}",
"tooltip": false,
"interval": 60,
"exec": "checkupdates | wc -l",
"exec-if": "exit 0",
"signal": 8
},
"backlight": {
"device": "intel_backlight",
"format": "<span color=\"#f8f8f2\">{icon}</span> {percent}%",
"format-icons": ["", "󰃟", "󰃠"]
},
"battery": {
"bat": "BAT1",
"weighted-average": true,
"interval": 60,
"full-at": 84,
"states": {
"warning": 30,
"critical": 15
},
"format": "<span color=\"#bd93f9\">{icon}</span> {capacity}%",
"format-icons": ["", "", "", "", ""],
"max-length": 25
},
"battery#2": {
"bat": "BAT0",
"weighted-average": true,
"interval": 60,
"full-at": 84,
"states": {
"warning": 30,
"critical": 15
},
"format": "<span color=\"#bd93f9\">{icon}</span> {capacity}%",
"format-icons": ["", "", "", "", ""],
"max-length": 25
},
"group/group-power": {
"orientation": "inherit",
"drawer": {
"transition-duration": 500,
"children-class": "not-power",
"transition-left-to-right": false,
},
"modules": [
"custom/power",
"custom/lock",
"custom/reboot",
]
},
"custom/lock": {
"format": " 󰍁 ",
"tooltip": false,
"on-click": "hyprlock"
},
"custom/reboot": {
"format": " 󰜉 ",
"tooltip": false,
"on-click": "shutdown -r now"
},
"custom/power": {
"format": "  ",
"tooltip": false,
"on-click": "shutdown -h now"
},
"network#lan": {
"interface": "enp0s31f6",
"format": "",
"interval": 1,
"format-ethernet": "<span color=\"#50fa7b\"> </span>{ifname}",
"format-disconnected": "",
"max-length": 50,
"tooltip-format": "speed:  {bandwidthDownBytes} /  {bandwidthUpBytes}",
"on-click": "kitty --class nmnet --single-instance -e nmtui",
"on-click-right": "nm-connection-editor"
},
"network#wifi": {
"interface": "wlp3s0",
"format": "",
"interval": 1,
"format-wifi": "<span color=\"#50fa7b\"> </span>{essid} ({signalStrength}%) ",
"format-disconnected": "<span color=\"#F2F8F8\">󰖪</span>",
"max-length": 50,
"tooltip-format": "speed:  {bandwidthDownBytes} /  {bandwidthUpBytes}",
"on-click": "kitty --class nmnet --single-instance -e nmtui",
"on-click-right": "nm-connection-editor"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "<span color=\"#8694c0\"></span>",
"deactivated": "<span color=\"#8694c0\"></span>"
},
"on-click": "toggleRemote"
},
"tray": {
"icon-size": 20,
"spacing": 6
},
"clock": {
"format": "<span color=\"#FF92DF\">󱑏</span> {:%I:%M:%OS}",
"interval": 1,
"tooltip-format": "<big> {:%d/%m/%y}</big>",
// "format-alt": "{:%Y-%m-%d}"
"on-click": "gsimplecal"
},
"cpu": {
"interval": 10,
"format": "<span color=\"#cf7cac\">{icon}</span> {usage}%",
"format-icons": [""]
},
"memory": {
"format": "<span color=\"#8BE9FD\">{icon}</span> {percentage}%",
"format-icons": [""]
},
"temperature": {
// "thermal-zone": 2,
"hwmon-path": "/sys/class/hwmon/hwmon1/temp1_input",
// "critical-threshold": 80,
// "format-critical": "<span color=\"#ff5555\"></span> {temperatureC}°C",
"format": "<span color=\"#f1fa8c\"></span> {temperatureC}°C",
"tooltip": false,
},
"disk": {
"interval": 30,
"format": "<span color=\"#8694c0\"></span><span color=\"#ffb86c\">󰋊 </span>/: {percentage_used}%",
"path": "/"
},
"disk#disk2": {
"interval": 30,
"format": "<span color=\"#ba89ff\">󰋊 </span>~: {percentage_used}%",
"path": "/home/peter"
},
"disk#disk3": {
"interval": 30,
"format": "<span color=\"#ff79c6\">󰋊 </span>SSD: {percentage_used}%",
"path": "/mnt/SSD"
},
"disk#disk4": {
"interval": 30,
"format": "<span color=\"#3ac55d\">󰋊 </span>Backups: {percentage_used}%",
"path": "/mnt/Backups"
},
"pulseaudio": {
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}  {format_source}",
"format-bluetooth-muted": " {icon}  {format_source}",
"format-muted": "0% {icon}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "󰖀", "󰕾", ""]
},
"on-click": "pavucontrol"
},
"bluetooth": {
"format": "<span color=\"#6272a4\"></span> {status}",
"format-connected": "<span color=\"#6272a4\"></span> connected",
"format-connected-battery": "<span color=\"#6272a4\"></span> Connected {device_battery_percentage}%",
"on-click": "blueman-manager",
// "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}",
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%"
},
"custom/vpn": {
"format": "<span color=\"#ff5555\"></span> VPN",
"tooltip": false,
"exec": "echo '{\"class\": \"connected\"}'",
"exec-if": "test -d /proc/sys/net/ipv4/conf/tun0",
"return-type": "json",
"on-click": "kitty --class nmnet --single-instance -e nmtui",
"interval": 5
},
"custom/weather": {
"exec": "python ~/.config/waybar/scripts/weather.py",
"restart-interval": 300,
"format": "{}",
"return-type": "json",
"on-click": "xdg-open https://weather.com/en-IN/weather/today/l/e42bb25a58c2e689ec85e632d82e69d7e46c82defb9ad7a5551b6c3a70fbc282"
// "format-alt": "{alt}",
},
"custom/gpu-usage": {
"exec": "cat /sys/class/hwmon/hwmon1/device/gpu_busy_percent",
"format": "<span color=\"#8694c0\"></span><span color=\"#bd93f9\">󰍹 </span>{}%",
"return-type": "",
"interval": 1,
"tooltip": false
},
}]

View file

@ -1,125 +0,0 @@
#!/usr/bin/env python
import subprocess
from pyquery import PyQuery # install using `pip install pyquery`
import json
# weather icons
weather_icons = {
"sunnyDay": "󰖨",
"clearNight": "󰖔",
"cloudyFoggyDay": "󰖕",
"cloudyFoggyNight": "",
"rainyDay": "󰼳",
"rainyNight": "",
"snowyIcyDay": "󰼴",
"snowyIcyNight": "󰖘",
"severe": "󰢘",
"default": "",
}
# 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 = "e42bb25a58c2e689ec85e632d82e69d7e46c82defb9ad7a5551b6c3a70fbc282" # TODO
# location_id = "8139363e05edb302e2d8be35101e400084eadcecdfce5507e77d832ac0fa57ae"
# priv_env_cmd = 'cat $PRIV_ENV_FILE | grep weather_location | cut -d "=" -f 2'
# location_id = subprocess.run(
# priv_env_cmd, shell=True, capture_output=True).stdout.decode('utf8').strip()
# get html page
url_fetch = "https://weather.com/en-IN/weather/today/l/" + location_id
html_data = PyQuery(url=url_fetch)
# 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'<span size="xx-large">{temp}C 🇩🇴</span>',
f"<big>{icon}</big>",
f"<big>{status}</big>",
f"<small>{temp_feel_text}</small>",
f"<big>{temp_min_max}</big>",
f"{wind_text}\t{humidity_text}",
f"{visbility_text}\tAQI {air_quality_index}",
f"<i>{prediction}</i>",
)
# print waybar module data
out_data = {
"text": f"{icon} {temp}",
"alt": status,
"tooltip": tooltip_text,
"class": status_code,
}
print(json.dumps(out_data))

View file

@ -1,348 +0,0 @@
* {
border: none;
border-radius: 10;
font-family: "Droid Sans Font, Font Awesome, Roboto, FreeSans, FreeSerif" ;
font-size: 16px;
min-height: 10px;
}
window#waybar {
background: transparent;
}
window#waybar.hidden {
opacity: 0.2;
}
#window {
margin-top: 6px;
padding-left: 10px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: transparent;
background: transparent;
}
#mode {
color: #ff5555;
}
#workspaces button {
margin-top: 6px;
margin-left: 8px;
padding-left: 8px;
padding-right: 8px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
background-color: transparent;
}
#workspaces button:hover {
box-shadow: inherit;
background-color: #282a36;
}
#workspaces button.active {
background-color: #ff79c6;
color: #282a36;
}
#network {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#pulseaudio {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #282a36;
background: #50fa7b;
}
#bluetooth {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#battery {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#battery.charging, #battery.plugged {
color: #f8f8f2;
background-color: #282a36;
}
#battery.critical:not(.charging) {
background-color: #282a36;
color: #f8f8f2;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes blink {
to {
background-color: #282a36;
color: #f8f8f2;
}
}
#backlight {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#clock {
margin-top: 6px;
margin-left: 6px;
padding-left: 8px;
padding-right: 3px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: transparent;
/*background: #1A1826;*/
}
#memory {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#cpu {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#tray {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #5d4185;
}
#disk {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#temperature {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#idle_inhibitor {
margin-top: 6px;
margin-left: 1px;
padding-left: 1px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
}
#idle_inhibitor.activated {
color: #50fa7b;
}
#custom-vpn {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#custom-weather {
margin-top: 6px;
margin-left: 3px;
padding-left: 3px;
padding-right: 8px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: transparent;
}
#custom-weather.severe {
color: #ff5555;
}
#custom-weather.sunnyDay {
color: #f1fa8c;
}
#custom-weather.clearNight {
color: #bd93f9;
}
#custom-weather.cloudyFoggyDay, #custom-weather.cloudyFoggyNight {
color: #9599b4;
}
#custom-weather.rainyDay, #custom-weather.rainyNight {
color: #8be9fd;
}
#custom-weather.showyIcyDay, #custom-weather.snowyIcyNight {
color: #8be9fd;
}
#custom-weather.default {
color: #f8f8f2;
}
#custom-gpu-usage {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #282a36;
}
#mpris {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 6px;
margin-right: 6px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #bd93f9;
background: #282a36;
}
#custom-scratchpad-indicator {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f8f2;
background: #6272a4;
}
#custom-power {
margin-top: 6px;
margin-left: 8px;
padding-left: 7px;
padding-right: 7px;
margin-bottom: 0px;
margin-right: 6px;
border-radius: 10px;
transition: none;
color: #282A36;
background: #FF5555;
}
#custom-lock {
margin-top: 6px;
margin-left: 8px;
padding-left: 7px;
padding-right: 7px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #282A36;
background: #FFB86C;
}
#custom-reboot {
margin-top: 6px;
margin-left: 8px;
padding-left: 7px;
padding-right: 7px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #282A36;
background: #8BE9FD;
}
#custom-pacman {
margin-top: 6px;
margin-left: 8px;
padding-left: 7px;
padding-right: 7px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #f8f2f2;
background: #282a36;
}