so many sops

This commit is contained in:
mjallen18
2025-03-17 21:34:52 -05:00
parent 7741fc575f
commit 32eadb044d
53 changed files with 801 additions and 591 deletions

View File

@@ -0,0 +1,13 @@
{ ... }:
{
specialisation.cosmic.configuration = {
services = {
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
# disable plasma
displayManager.sddm.enable = false;
desktopManager.plasma6.enable = false;
};
};
}

View File

@@ -0,0 +1,16 @@
let configDir = ./config;
in
{
home.file = {
".config/wallpapers".source = "${configDir}/wallpapers";
".config/kitty/macchiato.conf".source = "${configDir}/kitty/macchiato.conf";
".config/kitty/nord.conf".source = "${configDir}/kitty/nord.conf";
".config/wlogout".source = "${configDir}/wlogout"; #
".config/waybar/scripts".source = "${configDir}/waybar/scripts";
".config/waybar/macchiato.css".source = "${configDir}/waybar/macchiato.css";
".config/waybar/nord.css".source = "${configDir}/waybar/nord.css";
".config/btop/themes".source = "${configDir}/btop/themes";
".config/nwg-drawer".source = "${configDir}/nwg-drawer";
".config/nwg-panel".source = "${configDir}/nwg-panel";
};
}

View File

@@ -0,0 +1,73 @@
{ pkgs, ... }:
{
programs.btop = {
enable = true;
settings = {
color_theme = "/home/matt/.config/btop/themes/nord.theme";
theme_background = true;
truecolor = true;
force_tty = false;
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty";
vim_keys = true;
rounded_corners = true;
graph_symbol = "braille";
graph_symbol_cpu = "default";
graph_symbol_mem = "default";
graph_symbol_net = "default";
graph_symbol_proc = "default";
shown_boxes = "cpu mem net proc";
update_ms = 2000;
proc_sorting = "cpu lazy";
proc_reversed = false;
proc_tree = false;
proc_colors = true;
proc_gradient = true;
proc_per_core = false;
proc_mem_bytes = true;
proc_cpu_graphs = true;
proc_info_smaps = false;
proc_left = false;
proc_filter_kernel = false;
cpu_graph_upper = "total";
cpu_graph_lower = "total";
cpu_invert_lower = true;
cpu_single_graph = false;
cpu_bottom = false;
show_uptime = true;
check_temp = true;
cpu_sensor = "Auto";
show_coretemp = true;
cpu_core_map = "";
temp_scale = "celsius";
base_10_sizes = false;
show_cpu_freq = true;
clock_format = "%X";
background_update = true;
custom_cpu_name = "";
disks_filter = "";
mem_graphs = true;
mem_below_net = false;
zfs_arc_cached = true;
show_swap = true;
swap_disk = true;
show_disks = true;
only_physical = true;
use_fstab = true;
zfs_hide_datasets = false;
disk_free_priv = false;
show_io_stat = true;
io_mode = false;
io_graph_combined = false;
io_graph_speeds = "";
net_download = 100;
net_upload = 100;
net_auto = true;
net_sync = true;
net_iface = "";
show_battery = true;
selected_battery = "Auto";
log_level = "WARNING";
};
};
}

View File

@@ -0,0 +1,42 @@
theme[main_bg]="#24273A"
theme[main_fg]="#CAD3F5"
theme[title]="#CAD3F5"
theme[hi_fg]="#8AADF4"
theme[selected_bg]="#494D64"
theme[selected_fg]="#8AADF4"
theme[inactive_fg]="#8087A2"
theme[graph_text]="#F4DBD6"
theme[meter_bg]="#494D64"
theme[proc_misc]="#F4DBD6"
theme[cpu_box]="#7DC4E4"
theme[mem_box]="#A6DA95"
theme[net_box]="#C6A0F6"
theme[proc_box]="#F0C6C6"
theme[div_line]="#6E738D"
theme[temp_start]="#EED49F"
theme[temp_mid]="#F5A97F"
theme[temp_end]="#ED8796"
theme[cpu_start]="#7DC4E4"
theme[cpu_mid]="#91D7E3"
theme[cpu_end]="#8BD5CA"
theme[free_start]="#8BD5CA"
theme[free_mid]="#8BD5CA"
theme[free_end]="#A6DA95"
theme[cached_start]="#F5BDE6"
theme[cached_mid]="#F5BDE6"
theme[cached_end]="#C6A0F6"
theme[available_start]="#F4DBD6"
theme[available_mid]="#F0C6C6"
theme[available_end]="#F0C6C6"
theme[used_start]="#F5A97F"
theme[used_mid]="#F5A97F"
theme[used_end]="#ED8796"
theme[download_start]="#B7BDF8"
theme[download_mid]="#B7BDF8"
theme[download_end]="#C6A0F6"
theme[upload_start]="#B7BDF8"
theme[upload_mid]="#B7BDF8"
theme[upload_end]="#C6A0F6"
theme[process_start]="#7DC4E4"
theme[process_mid]="#91D7E3"
theme[process_end]="#8BD5CA"

View File

@@ -0,0 +1,42 @@
theme[main_bg]="#2e3440"
theme[main_fg]="#eceff4"
theme[title]="#eceff4"
theme[hi_fg]="#8fbcbb"
theme[selected_bg]="#3b4252"
theme[selected_fg]="#8fbcbb"
theme[inactive_fg]="#434c5e"
theme[graph_text]="#eceff4"
theme[meter_bg]="#3b4252"
theme[proc_misc]="#eceff4"
theme[cpu_box]="#b48ead"
theme[mem_box]="#a3be8c"
theme[net_box]="#d08770"
theme[proc_box]="#bf616a"
theme[div_line]="#3b4252"
theme[temp_start]="#a3be8c"
theme[temp_mid]="#ebcb8b"
theme[temp_end]="#bf616a"
theme[cpu_start]="#b48ead"
theme[cpu_mid]="#d08770"
theme[cpu_end]="#bf616a"
theme[free_start]="#a3be8c"
theme[free_mid]="#ebcb8b"
theme[free_end]="#d08770"
theme[cached_start]="#a3be8c"
theme[cached_mid]="#ebcb8b"
theme[cached_end]="#d08770"
theme[available_start]="#eceff4"
theme[available_mid]="#bf616a"
theme[available_end]="#bf616a"
theme[used_start]="#a3be8c"
theme[used_mid]="#ebcb8b"
theme[used_end]="#bf616a"
theme[download_start]="#88c0d0"
theme[download_mid]="#88c0d0"
theme[download_end]="#d08770"
theme[upload_start]="#8fbcbb"
theme[upload_mid]="#8fbcbb"
theme[upload_end]="#d08770"
theme[process_start]="#b48ead"
theme[process_mid]="#d08770"
theme[process_end]="#bf616a"

View File

@@ -0,0 +1,283 @@
let
drawer = "nwg-drawer -fm nautilus -term kitty -mb 10 -mt 10 -ml 10 -mr 10 -pbuseicontheme -i Colloid-nord-dark";
in
{
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = true;
settings = {
"$mod" = "SUPER";
# Mouse
# mouse_[up|down] - scroll wheel
# middle_mouse - 274
# thumb_up - 276
# thumb_down - 275
# l -> locked, will also work when an input inhibitor (e.g. a lockscreen) is active.
# r -> release, will trigger on release of a key.
# e -> repeat, will repeat when held.
# n -> non-consuming, key/mouse events will be passed to the active window in addition to triggering the dispatcher.
# m -> mouse, see below.
# t -> transparent, cannot be shadowed by other binds.
# i -> ignore mods, will ignore modifiers.
# s -> separate, will arbitrarily combine keys between each mod/key, see [Keysym combos](#keysym-combos) above.
# d -> has description, will allow you to write a description for your bind.
# p -> bypasses the app's requests to inhibit keybinds.
# https://wiki.hyprland.org/Configuring/Binds/
# https://wiki.hyprland.org/Configuring/Binds/#mouse-buttons
bind = [
"$mod, Return, exec, kitty"
"$mod, Q, killactive, "
"$mod, M, exec, wlogout --protocol layer-shell"
"$mod, E, exec, nautilus"
"$mod, V, togglefloating, "
"$mod, D, exec, ${drawer}"
"$mod, P, pseudo, " # dwindle
"$mod, S, togglesplit, " # dwindle
"$mod SHIFT, Q, exec, hyprlock"
", PRINT, exec, hyprshot -m region --clipboard-only"
"$mod,F,exec,hyprctl dispatch fullscreen active"
"$mod SHIFT, E, exec, smile"
"$mod, mouse:276, movecurrentworkspacetomonitor, DP-1"
"$mod, mouse:275, movecurrentworkspacetomonitor, DP-2"
# alt-tab between workspaces on active monitor
"ALT, Tab, workspace, m+1"
"ALT SHIFT, Tab, workspace, m-1"
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod SHIFT, 1, movetoworkspace, 1"
"$mod SHIFT, 2, movetoworkspace, 2"
"$mod SHIFT, 3, movetoworkspace, 3"
"$mod SHIFT, 4, movetoworkspace, 4"
"$mod SHIFT, 5, movetoworkspace, 5"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, discord"
"$mod CTRL, l, resizeactive, 10 0"
"$mod CTRL, h, resizeactive, -10 0"
"$mod CTRL, k, resizeactive, 0 -10"
"$mod CTRL, j, resizeactive, 0 10"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, j, movewindow, d"
"$mod, b, exec, firefox"
];
bindm = [
# Move/resize windows with mod + LMB/RMB and dragging
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
# middle mouse will grab a window, mod + middle mouse will close it
"$mod SHIFT, mouse:274, movewindow"
];
bindel = [
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
", XF86AudioNext, exec, playerctl next"
];
monitor = [
"DP-1,3840x2160@240.00000,0x0,1"
"DP-2,3840x2160@59.99700,3840x0,1"
];
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 1;
"col.active_border" = "rgb(8aadf4) rgb(24273A) rgb(24273A) rgb(8aadf4) 45deg";
"col.inactive_border" = "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg";
layout = "dwindle";
allow_tearing = true;
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 2;
passes = 2;
new_optimizations = true;
xray = false;
};
drop_shadow = "yes";
shadow_range = 4;
shadow_render_power = "3";
"col.shadow" = "rgba(1a1a1aee)";
};
animations = {
enabled = "yes";
bezier = [
"overshot, 0.05, 0.9, 0.1, 1.05"
"smoothOut, 0.36, 0, 0.66, -0.56"
"smoothIn, 0.25, 1, 0.5, 1"
];
animation = [
"windows, 1, 5, overshot, slide"
"windowsOut, 1, 4, smoothOut, slide"
"windowsMove, 1, 4, default"
"border, 1, 10, default"
"fade, 1, 10, smoothIn"
"fadeDim, 1, 10, smoothIn"
"workspaces, 1, 6, default"
];
};
dwindle = {
pseudotile = "yes";
preserve_split = "yes";
};
gestures = {
workspace_swipe = "off";
};
misc = {
force_default_wallpaper = 0;
};
workspace = [
"name:firefox, monitor:DP-2, default:false, special, firefox"
"name:discord, monitor:DP-2, default:true, special, vesktop, spotify"
"name:steam, monitor:DP-1, default:false, special, steam"
];
windowrule = [
"float, file_progress"
"float, confirm"
"float, dialog"
"float, download"
"float, notification"
"float, error"
"float, splash"
"float, confirmreset"
"float, title:Open File"
"float, title:branchdialog"
"float, pavucontrol"
"move onscreen cursor 0% 0%, pavucontrol"
"float, file-roller"
"fullscreen, wlogout"
"float, title:wlogout"
"fullscreen, title:wlogout"
"idleinhibit stayfocused, mpv"
];
windowrulev2 = [
"float, title:^(Media viewer)$"
"float, class:^(it.mijorus.smile)$,title:^(Smile)$"
"float, class:^(.blueman-manager-wrapped)$,title:^(Bluetooth Devices)$"
# Picture in picture windows
# "float, class:pavucontrol,title:pavucontrol" # ?????
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
# discord/vesktop
"workspace: name:discord, class:^(vesktop)$"
"float, class:^(vesktop)$,title:^(Discord Popout)$"
"pin, class:^(vesktop)$,title:^(Discord Popout)$"
# Steam
"float, class:^([Ss]team)$, title:^((?![Ss]team).*)$"
"workspace name:steam silent, class:^([Ss]team)$, title:^([Ss]team)$"
"tile, class:^([Ss]team)$, title:^([Ss]team)$"
"float, class:^(steam)$,title:^(Friends List)$"
# Code
# "pin, class:^(code)$,title:^(Save As)$"
"float, class:^(code)$,title:^(Save As)$"
"float, class:^(xdg-desktop-portal-gtk)$,title:^(Open Workspace from File)$"
# Game Tearing??? https://wiki.hyprland.org/Configuring/Tearing/
"immediate, class:gamescope"
# todo properly fix this shit instead of using gamescope
# vmware
"tag +horizonrdp, class:Remote Desktop Connection,title:BBar"
"tag +horizonrdp, class:Remote Desktop Connection,title:Remote Desktop Connection"
"noanim, tag:horizonrdp"
"noblur, tag:horizonrdp"
"norounding, tag:horizonrdp"
"noshadow, tag:horizonrdp"
"immediate, tag:horizonrdp"
"allowsinput, tag:horizonrdp"
"noborder, tag:horizonrdp"
"nodim, tag:horizonrdp"
"nomaxsize, tag:horizonrdp"
"float, class:Vmware-view,title:VMware Horizon Client"
"float, class:Remote Desktop Connection,title:^(Remote Desktop Connection)$"
"float, class:Remote Desktop Connection,title:^(5cd238b4x0)$"
"float, class:Credential Manager UI Host,title:Windows Security"
];
input = {
kb_layout = "us";
kb_variant = "";
kb_model = "";
kb_options = "";
kb_rules = "";
numlock_by_default = true;
follow_mouse = 1;
touchpad = {
natural_scroll = "no";
};
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
};
};
extraConfig = ''
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = nwg-look -a
exec-once = nm-applet
exec-once = blueberry-tray
exec-once = [silent] firefox
exec-once = [silent] vesktop
exec-once = [silent] spotify
exec-once = [silent] steam
'';
};
}

View File

@@ -0,0 +1,26 @@
{ pkgs, ... }:
{
programs.kitty = {
enable = true;
shellIntegration.enableZshIntegration = true;
font = {
name = "jetbrains mono nerd font";
package = pkgs.nerdfonts;
size = 12;
};
settings = {
include = "~/.config/kitty/nord.conf";
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
mouse_hide_wait = "2.0";
cursor_shape = "block";
url_color = "#88c0d0";
url_style = "dotted";
confirm_os_window_close = "0";
background_opacity = "0.8";
};
};
}

View File

@@ -0,0 +1,80 @@
# vim:ft=kitty
## name: Catppuccin Kitty Macchiato
## author: Catppuccin Org
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/themes/macchiato.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #CAD3F5
background #24273A
selection_foreground #24273A
selection_background #F4DBD6
# Cursor colors
cursor #F4DBD6
cursor_text_color #24273A
# URL underline color when hovering with mouse
url_color #F4DBD6
# Kitty window border colors
active_border_color #B7BDF8
inactive_border_color #6E738D
bell_border_color #EED49F
# OS Window titlebar colors
wayland_titlebar_color #24273A
macos_titlebar_color #24273A
# Tab bar colors
active_tab_foreground #181926
active_tab_background #C6A0F6
inactive_tab_foreground #CAD3F5
inactive_tab_background #1E2030
tab_bar_background #181926
# Colors for marks (marked text in the terminal)
mark1_foreground #24273A
mark1_background #B7BDF8
mark2_foreground #24273A
mark2_background #C6A0F6
mark3_foreground #24273A
mark3_background #7DC4E4
# The 16 terminal colors
# black
color0 #494D64
color8 #5B6078
# red
color1 #ED8796
color9 #ED8796
# green
color2 #A6DA95
color10 #A6DA95
# yellow
color3 #EED49F
color11 #EED49F
# blue
color4 #8AADF4
color12 #8AADF4
# magenta
color5 #F5BDE6
color13 #F5BDE6
# cyan
color6 #8BD5CA
color14 #8BD5CA
# white
color7 #B8C0E0
color15 #A5ADCB

View File

@@ -0,0 +1,72 @@
# vim:ft=kitty
# The basic colors
foreground #eceff4
background #2e3440
selection_foreground #2e3440
selection_background #b48ead
# Cursor colors
cursor #b48ead
cursor_text_color #2e3440
# URL underline color when hovering with mouse
url_color #b48ead
# Kitty window border colors
active_border_color #5e81ac
inactive_border_color #3b4252
bell_border_color #ebcb8b
# OS Window titlebar colors
wayland_titlebar_color #2e3440
macos_titlebar_color #2e3440
# Tab bar colors
active_tab_foreground #4c566a
active_tab_background #b48ead
inactive_tab_foreground #eceff4
inactive_tab_background #3b4252
tab_bar_background #4c566a
# Colors for marks (marked text in the terminal)
mark1_foreground #2e3440
mark1_background #5e81ac
mark2_foreground #2e3440
mark2_background #b48ead
mark3_foreground #2e3440
mark3_background #7DC4E4
# The 16 terminal colors
# black
color0 #2e3440
color8 #3b4252
# red
color1 #bf616a
color9 #bf616a
# green
color2 #a3be8c
color10 #a3be8c
# yellow
color3 #ebcb8b
color11 #ebcb8b
# blue
color4 #5e81ac
color12 #5e81ac
# magenta
color5 #b48ead
color13 #b48ead
# cyan
color6 #88c0d0
color14 #88c0d0
# white
color7 #e5e9f0
color15 #d8dee9

View File

@@ -0,0 +1,21 @@
{
services.mako = {
enable = true;
font = "monospace 12";
icons = false;
width = 500;
height = 110;
layer = "overlay";
borderRadius = 15;
borderSize = 2;
maxIconSize = 64;
defaultTimeout = 5000;
sort = "-time";
ignoreTimeout = true;
backgroundColor = "#24273a";
textColor = "#cad3f5";
borderColor = "#8aadf4";
progressColor = "over #363a4f";
};
}

View File

@@ -0,0 +1,34 @@
window {
background-color: rgba (36, 47, 79, 0.95);
color: #eeeeee
}
/* search entry */
entry {
background-color: rgba (0, 0, 0, 0.2)
}
button, image {
background: none;
border: none
}
button:hover {
background-color: rgba (255, 255, 255, 0.1)
}
/* in case you wanted to give category buttons a different look */
#category-button {
margin: 0 10px 0 10px
}
#pinned-box {
padding-bottom: 5px;
border-bottom: 1px dotted gray
}
#files-box {
padding: 5px;
border: 1px dotted gray;
border-radius: 15px
}

View File

@@ -0,0 +1,8 @@
{
"\\.pdf$": "firefox",
"\\.svg$": "inkscape",
"\\.(jpg|png|tiff|gif)$": "swayimg",
"\\.(mp3|ogg|flac|wav|wma)$": "audacious",
"\\.(avi|mp4|mkv|mov|wav)$": "mpv",
"\\.(doc|docx|xls|xlsx)$": "libreoffice"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

View File

@@ -0,0 +1,363 @@
{
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
# https://www.nerdfonts.com/cheat-sheet
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
layer = "bottom";
position = "top";
mod = "dock";
exclusive = true;
passthrough = false;
gtk-layer-shell = true;
height = 0;
modules-left = [ "hyprland/workspaces" ];
modules-center = [ "hyprland/window" ];
modules-right = [
"tray"
# "custom/updates"
"custom/lights"
"temperature"
"temperature#gpu"
"keyboard-state#capslock"
"keyboard-state#numlock"
"pulseaudio"
"pulseaudio#microphone"
"clock"
"custom/weather"
];
"hyprland/window" = {
separate-outputs = true;
format = { };
};
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = true;
on-click = "activate";
persistent_workspaces = {
"*" = 1;
};
};
"custom/weather" = {
tooltip = true;
format = { };
interval = 30;
exec = "waybar-weather";
return-type = "json";
};
# "custom/updates" = {
# tooltip = true;
# format = { };
# interval = 30;
# exec = "waybar-updates";
# return-type = "json";
# };
"custom/lights" = {
tooltip = false;
format = "󱉓";
# interval = 30;
on-click = "nix-shell /home/matt/.config/waybar/scripts/hass.nix --run \"python /home/matt/.config/waybar/scripts/hass.py --toggle_light light.bedroom_lights\"";
# return-type = "json";
};
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon4/temp1_input";
critical-threshold = 90;
format-critical = "{temperatureC}°C {icon}";
format = "{temperatureC}°C {icon}";
format-icons = [
"" # fa-temperature-empty
"" # fa-temperature-quarter
"" # fa-temperature-half
"" # fa-temperature-three-quarters
"" # fa-temperature-full
"" # fa-temperature-high
];
tooltip-format = "CPU: {temperatureC}°C";
};
"temperature#gpu" = {
hwmon-path = "/sys/class/hwmon/hwmon0/temp1_input";
critical-threshold = 100;
format-critical = "{temperatureC}°C {icon}";
format = "{temperatureC}°C {icon}";
format-icons = [
"" # fa-temperature-empty
"" # fa-temperature-quarter
"" # fa-temperature-half
"" # fa-temperature-three-quarters
"" # fa-temperature-full
"" # fa-temperature-high
];
on-click = "lact";
tooltip-format = "GPU: {temperatureC}°C";
};
tray = {
icon-size = 16;
spacing = 10;
};
clock = {
format = "{:%I:%M %p}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
pulseaudio = {
format = "{icon} {volume}%";
tooltip = false;
format-muted = " Muted";
on-click = "pamixer -t";
on-click-right = "pavucontrol -t 1";
on-scroll-up = "pamixer -i 5";
on-scroll-down = "pamixer -d 5";
scroll-step = 5;
format-icons = {
headphone = "󰋋";
headphone-muted = "󰟎";
hands-free = "󰋋";
headset = "󰋋";
phone = "";
portable = "󰋋";
car = "";
default = [
""
""
""
""
];
};
};
"pulseaudio#microphone" = {
format = "{format_source}";
format-source = "";
format-source-muted = "";
on-click = "pamixer --default-source -t";
on-click-right = "pavucontrol -t 2";
on-scroll-up = "pamixer --default-source -i 5";
on-scroll-down = "pamixer --default-source -d 5";
scroll-step = 5;
};
"keyboard-state#capslock" = {
capslock = true;
icon-size = 20;
format = "{icon}";
format-icons = {
locked = "󰪛";
unlocked = " ";
};
};
"keyboard-state#numlock" = {
numlock = true;
icon-size = 60;
format = "{icon}";
format-icons = {
locked = "󰎣";
unlocked = " ";
};
};
};
};
# https://catppuccin.com/palette
style = ''
@define-color nord0 #2e3440;
@define-color nord1 #3b4252;
@define-color nord2 #434c5e;
@define-color nord3 #4c566a;
@define-color nord4 #d8dee9;
@define-color nord5 #e5e9f0;
@define-color nord6 #eceff4;
@define-color nord7 #8fbcbb;
@define-color nord8 #88c0d0;
@define-color nord9 #81a1c1;
@define-color nord10 #5e81ac;
@define-color nord11 #bf616a;
@define-color nord12 #d08770;
@define-color nord13 #ebcb8b;
@define-color nord14 #a3be8c;
@define-color nord15 #b48ead;
/*@import "nord.css";*/
* {
font-family:
Jetbrains Mono Nerd Font,
monospace;
font-size: 14px;
min-height: 0;
}
#waybar {
background: transparent;
color: @nord6;
margin: 5px 5px;
}
#workspaces {
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem;
background-color: @nord0;
opacity: 0.6;
margin-left: 1rem;
}
#workspaces button {
color: @nord10;
border-radius: 1rem;
padding: 0.4rem;
}
#workspaces button.active {
color: @nord8;
border-radius: 1rem;
}
#workspaces button:hover {
color: @nord7;
border-radius: 1rem;
}
#workspaces button.focused {
color: @nord6;
background: @nord13;
border-radius: 1rem;
}
#workspaces button.urgent {
color: @nord0;
background: @nord6;
border-radius: 1rem;
}
#tooltip {
background: @nord0;
border-radius: 1rem;
border-width: 1rem;
border-style: solid;
border-color: @nord0;
}
#window {
color: @nord15;
background-color: @nord0;
opacity: 0.6;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem;
margin-left: 6rem;
margin-right: 6rem;
}
#custom-weather {
color: @nord10;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0rem 1rem 1rem 0rem;
margin-right: 1rem;
}
#clock {
color: @nord9;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 1rem;
}
/* ------------- */
#pulseaudio.microphone {
color: @nord8;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0rem 1rem 1rem 0rem;
}
#pulseaudio {
color: @nord7;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0;
}
#keyboard-state.numlock {
color: @nord8;
background-color: @nord0;
padding: 0.5rem;
margin: 5px 0;
border-radius: 0;
font-size: 10rem;
}
#keyboard-state.capslock {
color: @nord9;
background-color: @nord0;
padding: 0.5rem;
margin: 5px 0;
border-radius: 0;
font-size: 18px;
}
#temperature.gpu {
color: @nord10;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0;
}
#temperature {
color: @nord9;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0;
}
#custom-updates {
color: @nord8;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 1rem;
}
#custom-lights {
color: @nord8;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem 0rem 0rem 1rem;
}
/* ------------- */
#tray {
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
margin-right: 1rem;
border-radius: 1rem;
}
'';
};
}

View File

@@ -0,0 +1,26 @@
@define-color rosewater #f4dbd6;
@define-color flamingo #f0c6c6;
@define-color pink #f5bde6;
@define-color mauve #c6a0f6;
@define-color red #ed8796;
@define-color maroon #ee99a0;
@define-color peach #f5a97f;
@define-color yellow #eed49f;
@define-color green #a6da95;
@define-color teal #8bd5ca;
@define-color sky #91d7e3;
@define-color sapphire #7dc4e4;
@define-color blue #8aadf4;
@define-color lavender #b7bdf8;
@define-color text #cad3f5;
@define-color subtext1 #b8c0e0;
@define-color subtext0 #a5adcb;
@define-color overlay2 #939ab7;
@define-color overlay1 #8087a2;
@define-color overlay0 #6e738d;
@define-color surface2 #5b6078;
@define-color surface1 #494d64;
@define-color surface0 #363a4f;
@define-color base #24273a;
@define-color mantle #1e2030;
@define-color crust #181926;

View File

@@ -0,0 +1,16 @@
@define-color nord0 #2e3440;
@define-color nord1 #3b4252;
@define-color nord2 #434c5e;
@define-color nord3 #4c566a;
@define-color nord4 #d8dee9;
@define-color nord5 #e5e9f0;
@define-color nord6 #eceff4;
@define-color nord7 #8fbcbb;
@define-color nord8 #88c0d0;
@define-color nord9 #81a1c1;
@define-color nord10 #5e81ac;
@define-color nord11 #bf616a;
@define-color nord12 #d08770;
@define-color nord13 #ebcb8b;
@define-color nord14 #a3be8c;
@define-color nord15 #b48ead;

View File

@@ -0,0 +1,18 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# The Nix packages provided in the environment
packages = [
pkgs.python312
pkgs.python3Packages.pip
# Whatever other packages are required
];
shellHook = ''
export TMPDIR=/tmp
export VENV_DIR=/tmp/lights
mkdir $VENV_DIR
python -m venv $VENV_DIR/.venv
source $VENV_DIR/.venv/bin/activate
pip install homeassistant-api
'';
}

View File

@@ -0,0 +1,42 @@
import os
import argparse
import time
from homeassistant_api import Client
hass_url = 'https://hass.mjallen.dev/api'
parser = argparse.ArgumentParser(prog='hass python wrapper')
parser.add_argument('--toggle_light')
args = parser.parse_args()
def loadKey():
token_path = ""
for folder in range(1,100):
if os.path.exists("/run/secrets.d/" + str(folder) + "/desktop/hass_token"):
token_path = "/run/secrets.d/" + str(folder) + "/desktop/hass_token"
break
with open(token_path, "r") as key_file:
key = key_file.readline()
return key
def toggle_light(client, light):
lights = client.get_domain("light")
lights.toggle(entity_id=light)
time.sleep(0.5)
light_entity = client.get_entity(entity_id=light)
state = light_entity.get_state()
if state.state == 'on':
return "󰛨"
else:
return "󰹏"
def main():
token = loadKey()
with Client(hass_url, token) as client:
if args.toggle_light is not None:
status = toggle_light(client=client, light=args.toggle_light)
print("{ text: \"" + status + "\" }")
main()

View File

@@ -0,0 +1,90 @@
#!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3
import os
import json
import subprocess
import re
from datetime import datetime
import time
tmp_path = '/tmp/waybar-scripts/updates'
json_cache = tmp_path + "/data.json"
git_repo = 'git@github.com:mjallen18/nix-config.git'
def cache_json(data):
with open(json_cache, mode="w") as cache:
json.dump(data, cache)
def create_folders():
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)
os.chdir(tmp_path)
def clone_repo():
reset_repo()
if os.path.exists(tmp_path) and len(os.listdir(tmp_path)) == 0:
subprocess.run(["git", "clone", git_repo, tmp_path])
def check_for_flake_updates():
return subprocess.run(["sudo", "nix", "flake", "update", "-I", tmp_path, tmp_path], capture_output=True, text=True)
def reset_repo():
if os.path.exists(tmp_path) and not len(os.listdir(tmp_path)) == 0:
subprocess.run(["git", "reset", "--hard"])
subprocess.run(["git", "pull"])
def parse_output(output):
updates_dict = {}
updates = re.findall(r"(• Updated input '(.+)':((\n|\r|\n)(.+\((\d\d\d\d-\d\d-\d\d\)))){2})", output)
for update in updates:
input = re.findall(r"'(.+)':", update[0])[0].strip()
dates = re.findall(r"(\d{4}-\d{2}-\d{2})", update[0])
updates_dict[input] = dates
return updates_dict
def check():
data = {}
# print("create folders")
create_folders()
# print("clone repo")
clone_repo()
# print("checking for updates")
updates = check_for_flake_updates()
updates_dict = parse_output(updates.stderr)
if len(updates_dict.keys()) > 0:
data["text"] = ("󰏕")
else:
data["text"] = (u"\u00A0")
if len(updates_dict.keys()) <= 0:
data["tooltip"] = ("flake inputs up to date")
else:
data["tooltip"] = ("flake input updates:\n\n")
for input in updates_dict.keys():
data["tooltip"] += "<b>{}</b>\n".format(input)
data["tooltip"] += "Old Ref: {0}{1}\n\n".format(updates_dict[input][0].strip(), updates_dict[input][1].strip())
cache_json(data)
print(json.dumps(data))
def read_cache():
with open(json_cache, mode="r") as cache:
print(json.dumps(json.load(cache)))
def main():
now = int(datetime.now().strftime("%H"))
if os.path.exists(json_cache):
mtime = int(time.localtime(os.stat(json_cache).st_ctime).tm_hour)
else:
mtime = now + 1
if (now % 2 == 0 and mtime < now) or not os.path.exists(json_cache):
check()
else:
read_cache()
main()

View File

@@ -0,0 +1,379 @@
#!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3 python3Packages.requests
import json
from datetime import datetime
import requests
WWO_CODE = {
"113": "Sunny",
"116": "PartlyCloudy",
"119": "Cloudy",
"122": "VeryCloudy",
"143": "Fog",
"176": "LightShowers",
"179": "LightSleetShowers",
"182": "LightSleet",
"185": "LightSleet",
"200": "ThunderyShowers",
"227": "LightSnow",
"230": "HeavySnow",
"248": "Fog",
"260": "Fog",
"263": "LightShowers",
"266": "LightRain",
"281": "LightSleet",
"284": "LightSleet",
"293": "LightRain",
"296": "LightRain",
"299": "HeavyShowers",
"302": "HeavyRain",
"305": "HeavyShowers",
"308": "HeavyRain",
"311": "LightSleet",
"314": "LightSleet",
"317": "LightSleet",
"320": "LightSnow",
"323": "LightSnowShowers",
"326": "LightSnowShowers",
"329": "HeavySnow",
"332": "HeavySnow",
"335": "HeavySnowShowers",
"338": "HeavySnow",
"350": "LightSleet",
"353": "LightShowers",
"356": "HeavyShowers",
"359": "HeavyRain",
"362": "LightSleetShowers",
"365": "LightSleetShowers",
"368": "LightSnowShowers",
"371": "HeavySnowShowers",
"374": "LightSleetShowers",
"377": "LightSleet",
"386": "ThunderyShowers",
"389": "ThunderyHeavyRain",
"392": "ThunderySnowShowers",
"395": "HeavySnowShowers",
}
WEATHER_SYMBOL_EMOJI = {
"Unknown": "",
"Cloudy": "☁️",
"Fog": "🌫",
"HeavyRain": "🌧",
"HeavyShowers": "🌧",
"HeavySnow": "❄️",
"HeavySnowShowers": "❄️",
"LightRain": "🌦",
"LightShowers": "🌦",
"LightSleet": "🌧",
"LightSleetShowers": "🌧",
"LightSnow": "🌨",
"LightSnowShowers": "🌨",
"PartlyCloudy": "⛅️",
"Sunny": "☀️",
"ThunderyHeavyRain": "🌩",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "☁️",
}
WEATHER_SYMBOL = {
"Unknown": "",
"Cloudy": "☁️",
"Fog": "🌫",
"HeavyRain": "🌧",
"HeavyShowers": "🌧",
"HeavySnow": "❄️",
"HeavySnowShowers": "❄️",
"LightRain": "🌦",
"LightShowers": "🌦",
"LightSleet": "🌧",
"LightSleetShowers": "🌧",
"LightSnow": "🌨",
"LightSnowShowers": "🌨",
"PartlyCloudy": "⛅️",
"Sunny": "☀️",
"ThunderyHeavyRain": "🌩",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "☁️",
}
WEATHER_CODES = {key: WEATHER_SYMBOL[value] for key, value in WWO_CODE.items()}
WIND_DIRECTION = [
"", "", "", "", "", "", "", "",
]
MOON_PHASES = (
"🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"
)
WEATHER_SYMBOL_WI_DAY = {
"Unknown": "",
"Cloudy": "",
"Fog": "",
"HeavyRain": "",
"HeavyShowers": "",
"HeavySnow": "",
"HeavySnowShowers": "",
"LightRain": "",
"LightShowers": "",
"LightSleet": "",
"LightSleetShowers": "",
"LightSnow": "",
"LightSnowShowers": "",
"PartlyCloudy": "",
"Sunny": "",
"ThunderyHeavyRain": "",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "",
}
WEATHER_CODES_WI_DAY = {key: WEATHER_SYMBOL_WI_DAY[value] for key, value in WWO_CODE.items()}
WEATHER_SYMBOL_WI_NIGHT = {
"Unknown": "",
"Cloudy": "",
"Fog": "",
"HeavyRain": "",
"HeavyShowers": "",
"HeavySnow": "",
"HeavySnowShowers": "",
"LightRain": "",
"LightShowers": "",
"LightSleet": "",
"LightSleetShowers": "",
"LightSnow": "",
"LightSnowShowers": "",
"PartlyCloudy": "",
"Sunny": "",
"ThunderyHeavyRain": "",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "",
}
WEATHER_CODES_WI_NIGHT = {key: WEATHER_SYMBOL_WI_NIGHT[value] for key, value in WWO_CODE.items()}
WIND_DIRECTION_WI = [
"", "", "", "", "", "", "", "",
]
WIND_SCALE_WI = [
"", "", "", "", "", "", "", "", "", "", "", "", "",
]
MOON_PHASES_WI = (
"", "", "", "", "", "", "",
"", "", "", "", "", "", "",
"", "", "", "", "", "", "",
"", "", "", "", "", "", "",
)
WEATHER_SYMBOL_WEGO = {
"Unknown": [
" .-. ",
" __) ",
" ( ",
" `- ",
""],
"Sunny": [
"\033[38;5;226m \\ / \033[0m",
"\033[38;5;226m .-. \033[0m",
"\033[38;5;226m ― ( ) ― \033[0m",
"\033[38;5;226m `- \033[0m",
"\033[38;5;226m / \\ \033[0m"],
"PartlyCloudy": [
"\033[38;5;226m \\ /\033[0m ",
"\033[38;5;226m _ /\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m \\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
" "],
"Cloudy": [
" ",
"\033[38;5;250m .--. \033[0m",
"\033[38;5;250m .-( ). \033[0m",
"\033[38;5;250m (___.__)__) \033[0m",
" "],
"VeryCloudy": [
" ",
"\033[38;5;240;1m .--. \033[0m",
"\033[38;5;240;1m .-( ). \033[0m",
"\033[38;5;240;1m (___.__)__) \033[0m",
" "],
"LightShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;111m \033[0m",
"\033[38;5;111m \033[0m"],
"HeavyShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;240;1m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;240;1m( ). \033[0m",
"\033[38;5;226m /\033[38;5;240;1m(___(__) \033[0m",
"\033[38;5;21;1m \033[0m",
"\033[38;5;21;1m \033[0m"],
"LightSnowShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;255m * * * \033[0m",
"\033[38;5;255m * * * \033[0m"],
"HeavySnowShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;240;1m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;240;1m( ). \033[0m",
"\033[38;5;226m /\033[38;5;240;1m(___(__) \033[0m",
"\033[38;5;255;1m * * * * \033[0m",
"\033[38;5;255;1m * * * * \033[0m"],
"LightSleetShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[38;5;255m* \033[0m",
"\033[38;5;255m *\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[0m"],
"ThunderyShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;228;5m ⚡\033[38;5;111;25m \033[38;5;228;5m⚡\033[38;5;111;25m \033[0m",
"\033[38;5;111m \033[0m"],
"ThunderyHeavyRain": [
"\033[38;5;240;1m .-. \033[0m",
"\033[38;5;240;1m ( ). \033[0m",
"\033[38;5;240;1m (___(__) \033[0m",
"\033[38;5;21;1m \033[38;5;228;5m⚡\033[38;5;21;25m\033[38;5;228;5m⚡\033[38;5;21;25m \033[0m",
"\033[38;5;21;1m \033[38;5;228;5m⚡\033[38;5;21;25m \033[0m"],
"ThunderySnowShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;255m *\033[38;5;228;5m⚡\033[38;5;255;25m*\033[38;5;228;5m⚡\033[38;5;255;25m* \033[0m",
"\033[38;5;255m * * * \033[0m"],
"LightRain": [
"\033[38;5;250m .-. \033[0m",
"\033[38;5;250m ( ). \033[0m",
"\033[38;5;250m (___(__) \033[0m",
"\033[38;5;111m \033[0m",
"\033[38;5;111m \033[0m"],
"HeavyRain": [
"\033[38;5;240;1m .-. \033[0m",
"\033[38;5;240;1m ( ). \033[0m",
"\033[38;5;240;1m (___(__) \033[0m",
"\033[38;5;21;1m \033[0m",
"\033[38;5;21;1m \033[0m"],
"LightSnow": [
"\033[38;5;250m .-. \033[0m",
"\033[38;5;250m ( ). \033[0m",
"\033[38;5;250m (___(__) \033[0m",
"\033[38;5;255m * * * \033[0m",
"\033[38;5;255m * * * \033[0m"],
"HeavySnow": [
"\033[38;5;240;1m .-. \033[0m",
"\033[38;5;240;1m ( ). \033[0m",
"\033[38;5;240;1m (___(__) \033[0m",
"\033[38;5;255;1m * * * * \033[0m",
"\033[38;5;255;1m * * * * \033[0m"],
"LightSleet": [
"\033[38;5;250m .-. \033[0m",
"\033[38;5;250m ( ). \033[0m",
"\033[38;5;250m (___(__) \033[0m",
"\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[38;5;255m* \033[0m",
"\033[38;5;255m *\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[0m"],
"Fog": [
" ",
"\033[38;5;251m _ - _ - _ - \033[0m",
"\033[38;5;251m _ - _ - _ \033[0m",
"\033[38;5;251m _ - _ - _ - \033[0m",
" "],
}
data = {}
weather = requests.get("https://wttr.in/?u&format=j1").json()
moon = requests.get("https://wttr.in/?format=%m").text
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)
def format_temp(temp):
return (hour["FeelsLikeF"] + "°").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]["FeelsLikeF"])
extrachar = ""
if tempint > 0 and tempint < 10:
extrachar = "+"
data["text"] = (
""
+ WEATHER_CODES[weather["current_condition"][0]["weatherCode"]]
+ " "
+ extrachar
+ weather["current_condition"][0]["FeelsLikeF"]
+ "°F"
)
data["tooltip"] = (
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]['windspeedMiles']}mph\n"
data["tooltip"] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n"
data["tooltip"] += f"Moon phase: {weather["weather"][0]['astronomy'][0]['moon_phase']} " + moon + "\n"
for i, day in enumerate(weather["weather"]):
data["tooltip"] += f"\n<b>"
if i == 0:
data["tooltip"] += "Today, "
if i == 1:
data["tooltip"] += "Tomorrow, "
date = datetime.strptime(day['date'], "%Y-%m-%d").strftime("%a %b %d %Y")
data["tooltip"] += f"{date}</b>\n"
data["tooltip"] += f"{day['maxtempF']}°F  {day['mintempF']}°F"
data[
"tooltip"
] += f"{day['astronomy'][0]['sunrise']}{day['astronomy'][0]['sunset']}\n"
for hour in day["hourly"]:
if i == 0:
if int(format_24_time(hour["time"])) < datetime.now().hour - 2:
continue
if int(format_24_time(hour["time"])) > datetime.strptime(day['astronomy'][0]['sunset'], "%I:%M %p").hour or int(format_24_time(hour["time"])) < datetime.strptime(day['astronomy'][0]['sunrise'], "%I:%M %p").hour:
codes = WEATHER_CODES_WI_NIGHT
else:
codes = WEATHER_CODES_WI_DAY
data[
"tooltip"
] += f"{format_time(hour['time'])} {codes[hour['weatherCode']]} {format_temp(hour['FeelsLikeF'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n"
print(json.dumps(data))

View File

@@ -0,0 +1,166 @@
@import "macchiato.css";
* {
border: none;
border-radius: 0;
font-family:
Jetbrains Mono Nerd Font,
monospace;
font-weight: bold;
font-size: 14px;
min-height: 0;
}
#window.waybar {
background-color: shade(@base, 0.9);
color: @text;
}
#tooltip {
background: #1e1e2e;
border-radius: 10px;
border-width: 2px;
border-style: solid;
border-color: #11111b;
}
#workspaces button {
padding: 5px;
color: #313244;
margin-right: 5px;
}
#workspaces button.active {
color: #a6adc8;
}
#workspaces button.focused {
color: #a6adc8;
background: #eba0ac;
border-radius: 10px;
}
#workspaces button.urgent {
color: #11111b;
background: #a6e3a1;
border-radius: 10px;
}
#workspaces button:hover {
background: #11111b;
color: #cdd6f4;
border-radius: 10px;
}
/*#window,
#custom-weather,
#clock,
#network,
#pulseaudio,
#keyboard-state,
#temperature,
#custom-updates,
#tray,
#workspaces,*/
#workspaces {
/* background: #1e1e2e; */
background: #1e2030; /* Mantle */
border-radius: 10px;
margin-left: 10px;
padding-right: 0px;
padding-left: 5px;
}
#tray {
border-radius: 10px;
margin-right: 10px;
}
/* ------------- */
#custom-updates {
color: #f5c2e7;
border-radius: 10px 0px 0px 10px;
border-left: 0px;
border-right: 0px;
}
#window {
border-radius: 10px;
margin-left: 60px;
margin-right: 60px;
}
#temperature {
color: #a6da95;/* Green */
border-left: 0px;
border-right: 0px;
}
#temperature.gpu {
color: #eed49f;/* Yellow */
border-left: 0px;
border-right: 0px;
}
#keyboard-state.capslock {
color: #f5a97f;/* Peach */
border-left: 0px;
border-right: 0px;
}
#keyboard-state.numlock {
color: #ee99a0;/* Maroon */
border-left: 0px;
border-right: 0px;
}
#pulseaudio {
color: #ed8796;/* Red */
border-radius: 0px 0px 0px 0px;
border-left: 0px;
border-right: 0px;
margin-left: 0px;
padding-right: 0px;
padding-top: 0px;
}
#pulseaudio.microphone {
color: #c6a0f6; /* Mauve */
border-radius: 0px 10px 10px 0px;
border-left: 0px;
border-right: 0px;
padding-top: 5px;
}
/* ------------- */
#network {
color: #f5bde6; /* Pink */
border-left: 0px;
border-right: 0px;
border-radius: 10px 10px 10px 10px;
margin-left: 5px;
padding-right: 15px;
}
/* ------------- */
#clock {
color: #f0c6c6; /* Flamingo */
border-radius: 10px 0px 0px 10px;
margin-left: 5px;
border-right: 0px;
}
#custom-weather {
color: #f4dbd6; /* Rosewater */
border-radius: 0px 10px 10px 0px;
border-right: 0px;
margin-left: 0px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,36 @@
{
"label" : "lock",
"action" : "swaylock",
"text" : "Lock",
"keybind" : "l"
}
{
"label" : "hibernate",
"action" : "systemctl hibernate",
"text" : "Hibernate",
"keybind" : "h"
}
{
"label" : "logout",
"action" : "sleep 1; hyprctl dispatch exit",
"text" : "Logout",
"keybind" : "e"
}
{
"label" : "shutdown",
"action" : "systemctl poweroff",
"text" : "Shutdown",
"keybind" : "s"
}
{
"label" : "suspend",
"action" : "systemctl suspend",
"text" : "Suspend",
"keybind" : "u"
}
{
"label" : "reboot",
"action" : "systemctl reboot",
"text" : "Reboot",
"keybind" : "r"
}

View File

@@ -0,0 +1,50 @@
* {
background-image: none;
}
window {
background-color: rgba(36, 39, 58, 0.9);
}
button {
margin: 8px;
color: #cad3f5;
background-color: #363a4f;
border-style: solid;
border-width: 2px;
background-repeat: no-repeat;
background-position: center;
background-size: 25%;
}
button:active,
button:focus,
button:hover {
color: #8bd5ca;
background-color: #24273a;
outline-style: none;
}
#lock {
background-image: image(url("icons/lock.png"));
}
#logout {
background-image: image(url("icons/logout.png"));
}
#suspend {
background-image: image(url("icons/suspend.png"));
}
#hibernate {
background-image: image(url("icons/hibernate.png"));
}
#shutdown {
background-image: image(url("icons/shutdown.png"));
}
#reboot {
background-image: image(url("icons/reboot.png"));
}

View File

@@ -0,0 +1,145 @@
{
programs.wofi = {
enable = false;
style = ''
@define-color rosewater #f4dbd6;
@define-color rosewater-rgb rgb(244, 219, 214);
@define-color flamingo #f0c6c6;
@define-color flamingo-rgb rgb(240, 198, 198);
@define-color pink #f5bde6;
@define-color pink-rgb rgb(245, 189, 230);
@define-color mauve #c6a0f6;
@define-color mauve-rgb rgb(198, 160, 246);
@define-color red #ed8796;
@define-color red-rgb rgb(237, 135, 150);
@define-color maroon #ee99a0;
@define-color maroon-rgb rgb(238, 153, 160);
@define-color peach #f5a97f;
@define-color peach-rgb rgb(245, 169, 127);
@define-color yellow #eed49f;
@define-color yellow-rgb rgb(238, 212, 159);
@define-color green #a6da95;
@define-color green-rgb rgb(166, 218, 149);
@define-color teal #8bd5ca;
@define-color teal-rgb rgb(139, 213, 202);
@define-color sky #91d7e3;
@define-color sky-rgb rgb(145, 215, 227);
@define-color sapphire #7dc4e4;
@define-color sapphire-rgb rgb(125, 196, 228);
@define-color blue #8aadf4;
@define-color blue-rgb rgb(138, 173, 244);
@define-color lavender #b7bdf8;
@define-color lavender-rgb rgb(183, 189, 248);
@define-color text #cad3f5;
@define-color text-rgb rgb(202, 211, 245);
@define-color subtext1 #b8c0e0;
@define-color subtext1-rgb rgb(184, 192, 224);
@define-color subtext0 #a5adcb;
@define-color subtext0-rgb rgb(165, 173, 203);
@define-color overlay2 #939ab7;
@define-color overlay2-rgb rgb(147, 154, 183);
@define-color overlay1 #8087a2;
@define-color overlay1-rgb rgb(128, 135, 162);
@define-color overlay0 #6e738d;
@define-color overlay0-rgb rgb(110, 115, 141);
@define-color surface2 #5b6078;
@define-color surface2-rgb rgb(91, 96, 120);
@define-color surface1 #494d64;
@define-color surface1-rgb rgb(73, 77, 100);
@define-color surface0 #363a4f;
@define-color surface0-rgb rgb(54, 58, 79);
@define-color base #24273a;
@define-color base-rgb rgb(36, 39, 58);
@define-color mantle #1e2030;
@define-color mantle-rgb rgb(30, 32, 48);
@define-color crust #181926;
@define-color crust-rgb rgb(24, 25, 38);
* {
font-family: "Inconsolata Nerd Font", monospace;
font-size: 14px;
}
/* Window */
window {
margin: 0px;
padding: 10px;
border: 0.16em solid @lavender;
border-radius: 0.1em;
background-color: @base;
}
/* Inner Box */
#inner-box {
margin: 5px;
padding: 10px;
border: none;
background-color: @base;
}
/* Outer Box */
#outer-box {
margin: 5px;
padding: 10px;
border: none;
background-color: @base;
}
/* Scroll */
#scroll {
margin: 0px;
padding: 10px;
border: none;
background-color: @base;
}
/* Input */
#input {
margin: 5px 20px;
padding: 10px;
border: none;
border-radius: 0.1em;
color: @text;
background-color: @base;
}
#input image {
border: none;
color: @red;
}
#input * {
outline: 4px solid @red!important;
}
/* Text */
#text {
margin: 5px;
border: none;
color: @text;
}
#entry {
background-color: @base;
}
#entry arrow {
border: none;
color: @lavender;
}
/* Selected Entry */
#entry:selected {
border: 0.11em solid @lavender;
}
#entry:selected #text {
color: @mauve;
}
#entry:drop(active) {
background-color: @lavender!important;
}
'';
};
}

View File

@@ -0,0 +1,108 @@
{ pkgs, ... }:
let
sddmTheme = "catppuccin-mocha";
in
{
specialisation.hyprland.configuration = {
imports = [
./environment.nix
];
home-manager.users.matt = import ./home.nix;
services = {
displayManager.sddm.enable = true;
displayManager.sddm.package = pkgs.kdePackages.sddm;
displayManager.sddm.theme = sddmTheme;
displayManager.defaultSession = "hyprland";
# disable plasma
desktopManager.plasma6.enable = false;
dbus.enable = true;
ddccontrol.enable = true;
blueman.enable = true;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
programs.nm-applet.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
extraConfig = ''
DefaultTimeoutStopSec=10s
'';
};
security = {
polkit.enable = true;
# configure sudo
sudo.extraRules = [
{
commands = [
{
command = "/run/current-system/sw/bin/waybar-weather";
options = [ "NOPASSWD" ];
}
{
command = "/run/current-system/sw/bin/waybar-updates";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
];
};
xdg.portal = {
enable = true;
wlr.enable = false;
xdgOpenUsePortal = false;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk
];
};
fonts.packages = with pkgs; [
font-awesome
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: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
})
];
};
}

View File

@@ -0,0 +1,64 @@
{ pkgs, ... }:
let
waybarWeatherScript = pkgs.writeScriptBin "waybar-weather" ''
/home/matt/.config/waybar/scripts/waybar-wttr.py
'';
waybarUpdatesScript = pkgs.writeScriptBin "waybar-updates" ''
/home/matt/.config/waybar/scripts/waybar-updates.py
'';
in
{
environment.systemPackages = with pkgs; [
unstable.adwaita-icon-theme
apple-cursor
catppuccin-sddm
colloid-gtk-theme
colloid-icon-theme
ddcutil
dunst
egl-wayland
unstable.file-roller
glib
unstable.gnome-tweaks
unstable.gnome-disk-utility
unstable.gnome-system-monitor
unstable.gsettings-desktop-schemas
hyprcursor
hyprland
hyprshot
libnotify
mako
meson
unstable.nautilus
networkmanagerapplet
nm-tray
nwg-drawer
nwg-look
pamixer
papirus-folders
pavucontrol
playerctl
polkit
polkit_gnome
qt5.qtwayland
qt6.qtwayland
rocmPackages.rocm-smi
rofi-wayland
waybar
waybarUpdatesScript
waybarWeatherScript
wayland-protocols
wayland-utils
wev
wl-clipboard
wlogout
wlroots
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
xsettingsd
xwayland
];
}

View File

@@ -0,0 +1,198 @@
{ pkgs, ... }:
let
wallpaper = "/home/matt/.config/wallpapers/wall.png";
cursorTheme = "macOS";
cursorThemePkg = pkgs.apple-cursor;
cursorSize = 24;
gtkThemeSize = "compact";
gtkThemeAccent = "all";
gtkThemeVariant = "nord";
gtkThemeColor = "dark";
gtkTheme = "Colloid-Dark-Compact-Nord";
gtkThemePkg = pkgs.colloid-gtk-theme.override {
sizeVariants = [ gtkThemeSize ];
colorVariants = [ gtkThemeColor ];
themeVariants = [ gtkThemeAccent ];
tweaks = [ gtkThemeVariant ];
};
# iconThemeColor = "dark"; # "" "light" "dark"
# iconThemeVariant = ""; # "" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey"
iconThemeScheme = "nord"; # "" "nord" "dracula" "gruvbox" "everforest" "catppuccin"
iconTheme = "Colloid-Nord";
iconThemePkg = pkgs.colloid-icon-theme.override {
schemeVariants = [ iconThemeScheme ];
colorVariants = [ "default" ];
};
in
{
imports = [
./config.nix
./config/btop
./config/hypr
./config/kitty
./config/mako
./config/waybar
./config/wofi
];
services = {
hyprpaper = {
enable = true;
settings = {
preload = [ wallpaper ];
wallpaper = [
"DP-1, ${wallpaper}"
"DP-2, ${wallpaper}"
];
splash = false;
};
};
hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
};
listener = [
# {
# timeout = 300; # 5min
# on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
# on-resume = "brightnessctl -r"; # monitor backlight restore.
# }
{
timeout = 900; # 15 min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 930; # 15.5 min
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 3600; # 1hr
on-timeout = "systemctl suspend"; # suspend pc
}
];
};
};
};
programs.hyprlock = {
enable = true;
settings = {
background = [
{
monitor = "";
path = wallpaper; # supports png, jpg, webp (no animations, though)
color = "rgba(25, 20, 20, 1.0)";
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = "3"; # 0 disables blurring
blur_size = "7";
noise = "0.0117";
contrast = "0.8916";
brightness = "0.8172";
vibrancy = "0.1696";
vibrancy_darkness = "0.0";
}
];
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "DP-1";
dots_center = true;
fade_on_empty = true;
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
bothlock_color = -1;
outline_thickness = 5;
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
shadow_passes = 2;
}
];
};
};
home.sessionVariables = {
BROWSER = "firefox";
EDITOR = "nano";
TERMINAL = "kitty";
NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORMTHEME = "gtk3";
QT_SCALE_FACTOR = "1";
MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland-egl";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
GTK_CSD = "0";
# WLR_DRM_DEVICES = "/dev/dri/card0";
# WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland";
# WLR_RENDERER = "vulkan";
XCURSOR_THEME = cursorTheme;
XCURSOR_SIZE = cursorSize;
HYPRCURSOR_THEME = cursorTheme;
HYPRCURSOR_SIZE = cursorSize;
GTK_THEME = gtkTheme;
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
GTK_USE_PORTAL = "1";
NIXOS_XDG_OPEN_USE_PORTAL = "1";
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
#XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
ICON_THEME = iconTheme;
};
home.pointerCursor = {
gtk.enable = true;
package = cursorThemePkg;
name = cursorTheme;
size = cursorSize;
};
dconf = {
enable = true;
settings = {
"org/gnome/desktop/interface".cursor-theme = cursorTheme;
"org/gnome/desktop/interface".icon-theme = iconTheme;
};
};
gtk = {
enable = true;
cursorTheme = {
name = cursorTheme; # macOS-[BigSur, Monterey]-[ , White, White-Windows, Windows]
package = cursorThemePkg;
};
theme = {
name = gtkTheme;
package = gtkThemePkg;
};
iconTheme = {
name = iconTheme;
package = iconThemePkg;
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
};
}