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" "$mainMod SHIFT, Q, exec, hyprlock"
", PRINT, exec, hyprshot -m region --clipboard-only" ", 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, h, movefocus, l"
"$mainMod, l, movefocus, r" "$mainMod, l, movefocus, r"
"$mainMod, k, movefocus, u" "$mainMod, k, movefocus, u"
@@ -193,6 +197,8 @@
kb_options = ""; kb_options = "";
kb_rules = ""; kb_rules = "";
numlock_by_default = true;
follow_mouse = 1; follow_mouse = 1;
touchpad = { touchpad = {

View File

@@ -21,10 +21,12 @@
modules-right = [ modules-right = [
"tray" "tray"
"custom/updates" # "custom/updates"
"hyprland/language" "keyboard-state#capslock"
"keyboard-state#numlock"
"pulseaudio" "pulseaudio"
"pulseaudio#microphone" "pulseaudio#microphone"
"network"
"clock" "clock"
"custom/weather" "custom/weather"
]; ];
@@ -42,11 +44,6 @@
}; };
}; };
"hyprland/language" = {
format = {};
format-en = "US";
};
"custom/weather" = { "custom/weather" = {
tooltip = true; tooltip = true;
format = {}; format = {};
@@ -62,7 +59,7 @@
clock = { clock = {
format = "{:%I:%M %p}"; 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 = { pulseaudio = {
@@ -93,9 +90,41 @@
on-scroll-down = "pamixer --default-source -d 5"; on-scroll-down = "pamixer --default-source -d 5";
scroll-step = 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 = '' style = ''
* { * {
border: none; border: none;
@@ -149,7 +178,6 @@
border-radius: 10px; border-radius: 10px;
} }
#language,
#custom-updates, #custom-updates,
#custom-caffeine, #custom-caffeine,
#custom-weather, #custom-weather,
@@ -159,6 +187,8 @@
#pulseaudio, #pulseaudio,
#network, #network,
#workspaces, #workspaces,
#keyboard-state.numlock,
#keyboard-state.capslock,
#tray, #tray,
#backlight { #backlight {
background: #1e1e2e; background: #1e1e2e;
@@ -188,12 +218,6 @@
margin-left: 10px; margin-left: 10px;
} }
#custom-language {
color: #f38ba8;
border-left: 0px;
border-right: 0px;
}
#custom-updates { #custom-updates {
color: #f5c2e7; color: #f5c2e7;
border-radius: 10px 0px 0px 10px; border-radius: 10px 0px 0px 10px;
@@ -208,30 +232,46 @@
} }
#clock { #clock {
color: #fab387; color: #f5a97f;
border-radius: 10px 0px 0px 10px; border-radius: 10px 0px 0px 10px;
margin-left: 5px; margin-left: 5px;
border-right: 0px; border-right: 0px;
} }
#network { #keyboard-state.capslock {
color: #f9e2af; color: #91d7e3;
border-left: 0px;
border-right: 0px;
border-radius: 10px 0px 0px 10px;
}
#keyboard-state.numlock {
color: #7dc4e4;
border-left: 0px; border-left: 0px;
border-right: 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 { #pulseaudio {
color: #89b4fa; color: #8aadf4;
border-left: 0px; border-left: 0px;
border-right: 0px; border-right: 0px;
} }
#pulseaudio.microphone { #pulseaudio.microphone {
color: #cba6f7; color: #c6a0f6;
border-radius: 0px 10px 10px 0px; border-radius: 0px 10px 10px 0px;
border-left: 0px; border-left: 0px;
border-right: 0px; border-right: 0px;
margin-right: 5px; padding-top: 5px;
} }
#battery { #battery {

View File

@@ -63,6 +63,9 @@ weather = requests.get("https://wttr.in/?format=j1").json()
def format_time(time): 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) return time.replace("00", "").zfill(2)
@@ -105,10 +108,10 @@ data["text"] = (
) )
data["tooltip"] = ( 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"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" data["tooltip"] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n"
for i, day in enumerate(weather["weather"]): for i, day in enumerate(weather["weather"]):
data["tooltip"] += f"\n<b>" data["tooltip"] += f"\n<b>"
@@ -116,14 +119,15 @@ for i, day in enumerate(weather["weather"]):
data["tooltip"] += "Today, " data["tooltip"] += "Today, "
if i == 1: if i == 1:
data["tooltip"] += "Tomorrow, " 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['maxtempF']}° ⬇️ {day['mintempF']}° "
data[ data[
"tooltip" "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"]: for hour in day["hourly"]:
if i == 0: 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 continue
data[ data[
"tooltip" "tooltip"

View File

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