waybar updates

This commit is contained in:
mjallen18
2024-08-15 18:20:06 -05:00
parent d86a1d34c1
commit 1bf2b400c7
4 changed files with 84 additions and 26 deletions

View File

@@ -30,6 +30,10 @@
"$mainMod SHIFT, Q, exec, hyprlock"
", PRINT, exec, hyprshot -m region --clipboard-only"
# alt-tab between workspaces on active monitor
"ALT, Tab, workspace, m+1"
"ALT SHIFT, Tab, workspace, m-1"
"$mainMod, h, movefocus, l"
"$mainMod, l, movefocus, r"
"$mainMod, k, movefocus, u"
@@ -193,6 +197,8 @@
kb_options = "";
kb_rules = "";
numlock_by_default = true;
follow_mouse = 1;
touchpad = {

View File

@@ -21,10 +21,12 @@
modules-right = [
"tray"
"custom/updates"
"hyprland/language"
# "custom/updates"
"keyboard-state#capslock"
"keyboard-state#numlock"
"pulseaudio"
"pulseaudio#microphone"
"network"
"clock"
"custom/weather"
];
@@ -42,11 +44,6 @@
};
};
"hyprland/language" = {
format = {};
format-en = "US";
};
"custom/weather" = {
tooltip = true;
format = {};
@@ -62,7 +59,7 @@
clock = {
format = "{:%I:%M %p}";
tooltip-format = "<big>{ =%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
pulseaudio = {
@@ -93,9 +90,41 @@
on-scroll-down = "pamixer --default-source -d 5";
scroll-step = 5;
};
network = {
interface = "wlp9s0";
format = "{ifname}";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ifname} ";
format-disconnected = ""; # An empty format will hide the module.
tooltip-format = "{ifname}";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
max-length = 50;
};
"keyboard-state#capslock" = {
capslock = true;
format = "{name} {icon}";
format-icons = {
locked = "";
unlocked = "";
};
};
"keyboard-state#numlock" = {
numlock = true;
format = "{name} {icon}";
format-icons = {
locked = "";
unlocked = "";
};
};
};
};
# https://catppuccin.com/palette
style = ''
* {
border: none;
@@ -149,7 +178,6 @@
border-radius: 10px;
}
#language,
#custom-updates,
#custom-caffeine,
#custom-weather,
@@ -159,6 +187,8 @@
#pulseaudio,
#network,
#workspaces,
#keyboard-state.numlock,
#keyboard-state.capslock,
#tray,
#backlight {
background: #1e1e2e;
@@ -188,12 +218,6 @@
margin-left: 10px;
}
#custom-language {
color: #f38ba8;
border-left: 0px;
border-right: 0px;
}
#custom-updates {
color: #f5c2e7;
border-radius: 10px 0px 0px 10px;
@@ -208,30 +232,46 @@
}
#clock {
color: #fab387;
color: #f5a97f;
border-radius: 10px 0px 0px 10px;
margin-left: 5px;
border-right: 0px;
}
#network {
color: #f9e2af;
#keyboard-state.capslock {
color: #91d7e3;
border-left: 0px;
border-right: 0px;
border-radius: 10px 0px 0px 10px;
}
#keyboard-state.numlock {
color: #7dc4e4;
border-left: 0px;
border-right: 0px;
}
#network {
color: #eed49f;
border-left: 0px;
border-right: 0px;
border-radius: 10px 10px 10px 10px;
margin-left: 5px;
padding-right: 15px;
}
#pulseaudio {
color: #89b4fa;
color: #8aadf4;
border-left: 0px;
border-right: 0px;
}
#pulseaudio.microphone {
color: #cba6f7;
color: #c6a0f6;
border-radius: 0px 10px 10px 0px;
border-left: 0px;
border-right: 0px;
margin-right: 5px;
padding-top: 5px;
}
#battery {

View File

@@ -63,6 +63,9 @@ weather = requests.get("https://wttr.in/?format=j1").json()
def format_time(time):
return datetime.strptime(format_24_time(time), "%H").strftime("%I %p")
def format_24_time(time):
return time.replace("00", "").zfill(2)
@@ -105,10 +108,10 @@ data["text"] = (
)
data["tooltip"] = (
f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°</b>\n"
f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_F']}°</b>\n"
)
data["tooltip"] += f"Feels like: {weather['current_condition'][0]['FeelsLikeF']}°\n"
data["tooltip"] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n"
data["tooltip"] += f"Wind: {weather['current_condition'][0]['windspeedMiles']}mph\n"
data["tooltip"] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n"
for i, day in enumerate(weather["weather"]):
data["tooltip"] += f"\n<b>"
@@ -116,14 +119,15 @@ for i, day in enumerate(weather["weather"]):
data["tooltip"] += "Today, "
if i == 1:
data["tooltip"] += "Tomorrow, "
data["tooltip"] += f"{day['date']}</b>\n"
date = datetime.strptime(day['date'], "%Y-%m-%d").strftime("%a %b %d %Y")
data["tooltip"] += f"{date}</b>\n"
data["tooltip"] += f"⬆️ {day['maxtempF']}° ⬇️ {day['mintempF']}° "
data[
"tooltip"
] += f"🌅 {day['astronomy'][0]['sunrise']} 🌇 {day['astronomy'][0]['sunset']}\n"
] += 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:
if int(format_24_time(hour["time"])) < datetime.now().hour - 2:
continue
data[
"tooltip"

View File

@@ -71,10 +71,18 @@
};
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-color-emoji
nerdfonts
meslo-lgs-nf
];
fonts.fontconfig.defaultFonts = {
emoji = [
"Noto Color Emoji"
];
};
nixpkgs.overlays = [
(self: super: {
waybar = super.waybar.overrideAttrs (oldAttrs: {