diff --git a/home/desktop/waybar/configs/style.css b/home/desktop/waybar/configs/style.css index a6057ba..a8d969e 100644 --- a/home/desktop/waybar/configs/style.css +++ b/home/desktop/waybar/configs/style.css @@ -157,6 +157,22 @@ window#waybar.hidden { margin-right: 20px; } +#custom-mako { + color: @red; + margin-top: 6px; + margin-bottom: 6px; + padding-left: 6px; + padding-right: 6px; +} + +#custom-mako.enabled { + color: @red; +} + +#custom-mako.disabled { + color: @overlay1; +} + /* SwayNC */ #custom-notification { font-family: "NotoSansMono Nerd Font"; diff --git a/home/desktop/waybar/dual.nix b/home/desktop/waybar/dual.nix index ab6ade7..a0ccabb 100644 --- a/home/desktop/waybar/dual.nix +++ b/home/desktop/waybar/dual.nix @@ -4,6 +4,8 @@ let common = import ./common.nix; wm = if compositor == "hyprland" then import ./hyprland-wm.nix else import ./niri-wm.nix; + workspaceModule = if compositor == "hyprland" then "hyprland/workspaces" else "niri/workspaces"; + notificationModule = if compositor == "hyprland" then "custom/mako" else "custom/swaync"; in { enable = true; @@ -18,10 +20,8 @@ in "clock" ]; modules-center = [ - "hyprland/workspaces" - "niri/workspaces" - "custom/mako" - "custom/swaync" + workspaceModule + notificationModule ]; modules-right = [ "group/hardware" @@ -40,8 +40,7 @@ in "custom/wallpaper" ]; modules-center = [ - "hyprland/workspaces" - "niri/workspaces" + workspaceModule ]; modules-right = [ "custom/weather" ]; } diff --git a/home/desktop/waybar/hyprland-wm.nix b/home/desktop/waybar/hyprland-wm.nix index f20a019..5e5a3f2 100644 --- a/home/desktop/waybar/hyprland-wm.nix +++ b/home/desktop/waybar/hyprland-wm.nix @@ -3,19 +3,15 @@ "hyprland/workspaces" = { format = "{icon}"; format-icons = { - default = ""; - active = ""; + default = " "; + active = " "; }; }; "custom/mako" = { tooltip = false; - format = "{icon}"; - format-icons = { - enabled = " "; - disabled = " "; - }; + format = "{}"; return-type = "json"; - exec = "makoctl mode | grep -q do-not-disturb && echo '{\"text\":\"\",\"class\":\"disabled\"}' || echo '{\"text\":\"\",\"class\":\"enabled\"}'"; + exec = "sh ~/.config/waybar/mako.sh"; on-click = "makoctl mode -t do-not-disturb"; interval = 1; }; diff --git a/home/desktop/waybar/waybar/common.nix b/home/desktop/waybar/waybar/common.nix deleted file mode 100644 index fb5a64f..0000000 --- a/home/desktop/waybar/waybar/common.nix +++ /dev/null @@ -1,181 +0,0 @@ -{ - widgets = { - "group/media" = { - orientation = "horizontal"; - - modules = [ - "mpris" - "custom/cava" - "wireplumber" - ]; - }; - - mpris = { - format = "{player_icon}"; - format-paused = "{status_icon}"; - max-length = 100; - player-icons = { - default = "||"; - mpv = "||"; - }; - status-icons = { - paused = "▶"; - }; - }; - - "custom/cava" = { - exec = "sh ~/.config/waybar/cava.sh"; - format = "{} ♪"; - on-click = "hyprctl dispatch focuswindow class:spotify"; - }; - - wireplumber = { - format = "{volume}%"; - format-muted = ""; - max-volume = 110; - scroll-step = 0.2; - }; - - "group/hardware" = { - orientation = "horizontal"; - modules = [ - "cpu" - "network" - "memory" - "disk" - "temperature" - ]; - }; - - network = { - # Wifi - tooltip = true; - format-wifi = "{icon} "; - format-icons = [ - "󰤟" - "󰤢" - "󰤥" - ]; - rotate = 0; - - # Ethernet - format-ethernet = "⇵{bandwidthTotalBits}"; - tooltip-format = "Network: {essid}\nSignal strength: {signaldBm}dBm ({signalStrength}%)\nFrequency: {frequency}MHz\nInterface: {ifname}\nIP: {ipaddr}/{cidr}\nGateway: {gwaddr}\nNetmask: {netmask}\nCurrent󰈀 : {bandwidthTotalBits}\nUp 󰶣: {bandwidthUpBits}\nDown 󰶡: {bandwidthDownBits}"; - format-linked = "󰈀 {ifname} (No IP)"; - format-disconnected = " "; - tooltip-format-disconnected = "Disconnected"; - interval = 2; - }; - - memory = { - interval = 1; - #rotate = 270; - format = "{icon} {percentage}%"; - format-icons = [ - "󰝦" - "󰪞" - "󰪟" - "󰪠" - "󰪡" - "󰪢" - "󰪣" - "󰪤" - "󰪥" - ]; - max-length = 10; - }; - - cpu = { - interval = 1; - format = "{icon} {usage}%"; - #rotate = 270; - format-icons = [ - "󰝦" - "󰪞" - "󰪟" - "󰪠" - "󰪡" - "󰪢" - "󰪣" - "󰪤" - "󰪥" - ]; - }; - - temperature = { - format = " {temperatureC}°C"; - thermal-zone = 0; - hwmon-path = "/sys/class/thermal/thermal_zone1/temp"; - critical-threshold = 80; - }; - - disk = { - format = " {percentage_free}%"; - tooltip = true; - tooltip-format = "{free} / {total} ({percentage_free})"; - }; - - clock = { - format = "{:%a %b %d, %I:%M %p}"; - rotate = 0; - on-click = " "; - tooltip-format = "{calendar}"; - calendar = { - mode = "month"; - mode-mon-col = 3; - on-scroll = 1; - on-click-right = "mode"; - format = { - months = "{}"; - 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"; - }; - }; - - "custom/nixicon" = { - format = " "; - on-click = "rofi -show drun -theme $HOME/.config/rofi/custom.rasi"; - tooltip = false; - }; - - "custom/weather" = { - format = "{}"; - return-type = "json"; - exec = '' - curl -s -X GET "https://api.openweathermap.org/data/2.5/weather?lat=52.281311&lon=10.527029&appid=$(cat $OPENWEATHER_API_KEY)&units=metric&lang=en" | jq -c '{text: "\(.name) \(.main.temp)C°"}' - ''; - interval = 120; - on-click = '' - data=$(curl -s -X GET "https://api.openweathermap.org/data/2.5/weather?lat=52.281311&lon=10.527029&appid=$(cat $OPENWEATHER_API_KEY)&units=metric&lang=en") - city=$(echo "$data" | jq -r '.name') - temp=$(echo "$data" | jq -r '.main.temp') - feels=$(echo "$data" | jq -r '.main.feels_like') - humidity=$(echo "$data" | jq -r '.main.humidity') - wind=$(echo "$data" | jq -r '.wind.speed') - clouds=$(echo "$data" | jq -r '.clouds.all') - sunrise=$(echo "$data" | jq -r '.sys.sunrise | strftime("%H:%M")') - sunset=$(echo "$data" | jq -r '.sys.sunset | strftime("%H:%M")') - notify-send "$city" "Temperature: $temp °C\nFeels Like: $feels °C\nHumidity: $humidity%\nWind: $wind m/s\nClouds: $clouds%\nSunrise at: $sunrise\nSunset at: $sunset" -u normal --icon="$HOME/Pictures/Avatar/avatar_weather_no_bg.png" - ''; - }; - - "custom/wallpaper" = { - format = "【{} 】"; - exec = "basename $(swww query | grep -oP 'image: \\K.*')"; - interval = 5; - on-click = "waypaper"; - tooltip = true; - tooltip-format = "{}"; - max-length = 30; - }; - }; - -} diff --git a/home/desktop/waybar/waybar/configs/cava.sh b/home/desktop/waybar/waybar/configs/cava.sh deleted file mode 100644 index a12dac4..0000000 --- a/home/desktop/waybar/waybar/configs/cava.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# Not my own work. Credit to original author - -#----- Optimized bars animation without much CPU usage increase -------- -bar="▁▂▃▄▅▆▇█" -dict="s/;//g" - -# Calculate the length of the bar outside the loop -bar_length=${#bar} - -# Create dictionary to replace char with bar -for ((i = 0; i < bar_length; i++)); do - dict+=";s/$i/${bar:$i:1}/g" -done - -# Create cava config -config_file="/tmp/bar_cava_config" -cat >"$config_file" < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/home/desktop/waybar/waybar/configs/style.css b/home/desktop/waybar/waybar/configs/style.css deleted file mode 100644 index a8d969e..0000000 --- a/home/desktop/waybar/waybar/configs/style.css +++ /dev/null @@ -1,191 +0,0 @@ -@import "catppuccin.css"; - -* { - border: none; - font-family: "FiraCode Nerd Font"; - font-size: 15px; - min-height: 10px; -} - -window#waybar { - background: @crust; -} - -window#waybar.hidden { - opacity: 0.2; -} -󠀰 -/* - Genera rules for visible modules -- */ -#media, -#clock, -#cpu, -#memory, -#disk, -#temperature, -#network, -#custom-wallpaper, -#media, -#custom-weather { - color: @crust; - margin-top: 6px; - margin-bottom: 6px; - padding-left: 10px; - padding-right: 10px; - transition: none; -} - -/* Separation to the left */ -#custom-nixicon, -#cpu { - margin-left: 5px; - border-top-left-radius: 10px; - border-bottom-left-radius: 10px; -} - -/* Separation to the rigth */ -#clock, -#temperature { - margin-right: 20px; - border-top-right-radius: 10px; - border-bottom-right-radius: 10px; -} - -/* -- Specific styles -- */ - -#custom-nixicon { - background-image: url("nix-snowflake.svg"); - background-size: contain; - background-repeat: no-repeat; - background-position: center; - min-height: 24px; - min-width: 24px; - - padding: 0px; - padding-right: 15px; - padding-left: 10px; - margin-top: 6px; - margin-bottom: 6px; - margin-left: 15px; -} - -/* Hardware Group */ -#clock { - background: @yellow; -} - -#cpu { - background: @blue; -} - -#memory { - background: @red; -} - -#disk { - background: @peach; -} - -#temperature { - background: @sky; -} - -#network { - background: @lavender; - padding-right: 13px; -} - -/* Workspace */ -#workspaces { - border-radius: 10px; - margin: 6px 5px; - padding: 0px 6px; -} - -#workspaces button { - color: @text; - background: transparent; - padding: 4px 4px; - transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease; - border: none; -} - -#workspaces button.occupied { - color: @red; -} - -#workspaces button.active { - color: @green; - text-shadow: 0 0 4px @green; -} - -#workspaces button:hover { - color: @teal; - border: none; -} - -#workspaces button.active:hover {} - - - -/* Media Group */ -#media { - background: @overlay2; - border-radius: 10px; - color: @crust; - margin-left: 20px; -} - -#custom-cava { - color: @sky; -} - -#wireplumber, #custom-cava, #mpris { - margin-left: 10px; - margin-right: 5px; -} - -#wireplumber { - margin-right: 5px; -} - - -/* Weather */ -#custom-weather { - background: @sky; - color: @crust; - border-radius: 10px; - margin-right: 20px; -} - -#custom-mako { - color: @red; - margin-top: 6px; - margin-bottom: 6px; - padding-left: 6px; - padding-right: 6px; -} - -#custom-mako.enabled { - color: @red; -} - -#custom-mako.disabled { - color: @overlay1; -} - -/* SwayNC */ -#custom-notification { - font-family: "NotoSansMono Nerd Font"; - background: @green; - border-radius: 10px; - padding-left: 10px; - padding-right: 5px; -} - -/* Wallpaper */ -#custom-wallpaper { - background: @red; - color: @mantle; - border-radius: 10px; - margin-left: 5px; -} diff --git a/home/desktop/waybar/waybar/configs/style.min.css b/home/desktop/waybar/waybar/configs/style.min.css deleted file mode 100644 index dc25e86..0000000 --- a/home/desktop/waybar/waybar/configs/style.min.css +++ /dev/null @@ -1 +0,0 @@ -*{border:none;min-height:10px;font-family:FiraCode Nerd Font;font-size:15px}window#waybar{background:@crust}window#waybar.hidden{opacity:.2}󠀰 #media,#clock,#cpu,#memory,#disk,#temperature,#network,#custom-wallpaper,#media,#custom-weather{color:@crust;margin-top:6px;margin-bottom:6px;padding-left:10px;padding-right:10px;transition:none}#custom-nixicon,#cpu{border-top-left-radius:10px;border-bottom-left-radius:10px;margin-left:5px}#clock,#temperature{border-top-right-radius:10px;border-bottom-right-radius:10px;margin-right:20px}#custom-nixicon{background-image:url(nix-snowflake.svg);background-position:50%;background-repeat:no-repeat;background-size:contain;min-width:24px;min-height:24px;margin-top:6px;margin-bottom:6px;margin-left:15px;padding:0 15px 0 10px}#clock{background:@yellow}#cpu{background:@blue}#memory{background:@red}#disk{background:@peach}#temperature{background:@sky}#network{background:@lavender;padding-right:13px}#workspaces{border-radius:10px;margin:6px 5px;padding:0 6px}#workspaces button{color:@text;background:0 0;border:none;padding:4px;transition:color .3s,text-shadow .3s,transform .3s}#workspaces button.occupied{color:@red}#workspaces button.active{color:@green;text-shadow:0 0 4px @green}#workspaces button:hover{color:@teal;border:none}#media{background:@overlay2;color:@crust;border-radius:10px;margin-left:20px}#custom-cava{color:@green}#wireplumber,#custom-cava,#mpris{margin-left:10px;margin-right:5px}#wireplumber{margin-right:5px}#custom-weather{background:@sky;color:@crust;border-radius:10px;margin-right:20px}#custom-notification{background:@green;border-radius:10px;padding-left:10px;padding-right:5px;font-family:NotoSansMono Nerd Font}#custom-wallpaper{background:@red;color:@mantle;border-radius:10px;margin-left:5px} diff --git a/home/desktop/waybar/waybar/default.nix b/home/desktop/waybar/waybar/default.nix deleted file mode 100644 index abb663d..0000000 --- a/home/desktop/waybar/waybar/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - pkgs, - compositor ? "hyprland", - ... -}: -{ - - programs.waybar = { - enable = true; - package = pkgs.waybar; - } - // (import ./dual.nix { inherit compositor; }); - home = { - packages = with pkgs; [ cava ]; - file.".config/waybar" = { - source = ./configs; - recursive = true; - }; - }; -} diff --git a/home/desktop/waybar/waybar/dual.nix b/home/desktop/waybar/waybar/dual.nix deleted file mode 100644 index a0ccabb..0000000 --- a/home/desktop/waybar/waybar/dual.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ - compositor ? "hyprland", -}: -let - common = import ./common.nix; - wm = if compositor == "hyprland" then import ./hyprland-wm.nix else import ./niri-wm.nix; - workspaceModule = if compositor == "hyprland" then "hyprland/workspaces" else "niri/workspaces"; - notificationModule = if compositor == "hyprland" then "custom/mako" else "custom/swaync"; -in -{ - enable = true; - settings = { - mainBar = { - layer = "top"; - position = "top"; - height = 30; - output = [ "DP-1" ]; - modules-left = [ - "custom/nixicon" - "clock" - ]; - modules-center = [ - workspaceModule - notificationModule - ]; - modules-right = [ - "group/hardware" - ]; - } - // common.widgets - // wm.widgets; - - secondBar = { - layer = "top"; - position = "top"; - height = 30; - output = [ "HDMI-A-2" ]; - modules-left = [ - "group/media" - "custom/wallpaper" - ]; - modules-center = [ - workspaceModule - ]; - modules-right = [ "custom/weather" ]; - } - // common.widgets - // wm.widgets; - }; - -} diff --git a/home/desktop/waybar/waybar/hyprland-wm.nix b/home/desktop/waybar/waybar/hyprland-wm.nix deleted file mode 100644 index 5e5a3f2..0000000 --- a/home/desktop/waybar/waybar/hyprland-wm.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - widgets = { - "hyprland/workspaces" = { - format = "{icon}"; - format-icons = { - default = " "; - active = " "; - }; - }; - "custom/mako" = { - tooltip = false; - format = "{}"; - return-type = "json"; - exec = "sh ~/.config/waybar/mako.sh"; - on-click = "makoctl mode -t do-not-disturb"; - interval = 1; - }; - }; -} diff --git a/home/desktop/waybar/waybar/niri-wm.nix b/home/desktop/waybar/waybar/niri-wm.nix deleted file mode 100644 index ac653aa..0000000 --- a/home/desktop/waybar/waybar/niri-wm.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - widgets = { - "niri/workspaces" = { - format = "{icon}"; - format-icons = { - default = ""; - active = ""; - }; - }; - "custom/swaync" = { - tooltip = false; - 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 = "swaync-client -t -sw"; - on-click-right = "swaync-client -d -sw"; - escape = true; - }; - }; -} diff --git a/home/shell.nix b/home/shell.nix index b16c318..0b8f8e9 100644 --- a/home/shell.nix +++ b/home/shell.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ eza # ls replacement tdf # terminal pdf viewer @@ -40,31 +41,32 @@ tab_bar_min_tabs = 1; tab_bar_edge = "bottom"; tab_bar_style = "custom"; # Should be changed to custom - tab_title_template = - "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}"; + tab_title_template = "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}"; - symbol_map = let - mappings = [ - "U+23FB-U+23FE" - "U+2B58" - "U+E200-U+E2A9" - "U+E0A0-U+E0A3" - "U+E0B0-U+E0BF" - "U+E0C0-U+E0C8" - "U+E0CC-U+E0CF" - "U+E0D0-U+E0D2" - "U+E0D4" - "U+E700-U+E7C5" - "U+F000-U+F2E0" - "U+2665" - "U+26A1" - "U+F400-U+F4A8" - "U+F67C" - "U+E000-U+E00A" - "U+F300-U+F313" - "U+E5FA-U+E62B" - ]; - in (builtins.concatStringsSep "," mappings) + " Symbols Nerd Font Mono"; + symbol_map = + let + mappings = [ + "U+23FB-U+23FE" + "U+2B58" + "U+E200-U+E2A9" + "U+E0A0-U+E0A3" + "U+E0B0-U+E0BF" + "U+E0C0-U+E0C8" + "U+E0CC-U+E0CF" + "U+E0D0-U+E0D2" + "U+E0D4" + "U+E700-U+E7C5" + "U+F000-U+F2E0" + "U+2665" + "U+26A1" + "U+F400-U+F4A8" + "U+F67C" + "U+E000-U+E00A" + "U+F300-U+F313" + "U+E5FA-U+E62B" + ]; + in + (builtins.concatStringsSep "," mappings) + " Symbols Nerd Font Mono"; }; }; @@ -75,15 +77,24 @@ urls = [ { url = "https://www.tagesschau.de/xml/rss2"; - tags = [ "news" "de" ]; + tags = [ + "news" + "de" + ]; } { url = "https://www.spiegel.de/schlagzeilen/index.rss"; - tags = [ "news" "de" ]; + tags = [ + "news" + "de" + ]; } { url = "https://www.focus.de/rss"; - tags = [ "news" "de" ]; + tags = [ + "news" + "de" + ]; } { url = "https://feeds.feedburner.com/blogspot/rkEL"; @@ -92,7 +103,9 @@ ]; }; - programs.cava = { enable = true; }; + programs.cava = { + enable = true; + }; programs.yazi = { enable = true; @@ -100,7 +113,13 @@ enableZshIntegration = true; enableFishIntegration = true; - settings = { ration = [ 1 3 4 ]; }; + settings = { + ration = [ + 1 + 3 + 4 + ]; + }; }; programs.fzf = { @@ -109,8 +128,7 @@ enableZshIntegration = true; enableFishIntegration = true; defaultCommand = "fd --type f --strip-cwd-prefix --hidden --exclude .git"; - fileWidgetCommand = - "fd --type f --strip-cwd-prefix --hidden --exclude .git"; + fileWidgetCommand = "fd --type f --strip-cwd-prefix --hidden --exclude .git"; defaultOptions = [ "--height 100%" "--border sharp" @@ -121,7 +139,44 @@ }; # TODO: Install OpenCode - # TODO: Install NuShell + programs.nushell = { + enable = true; + + shellAliases = { + # ls = "eza --icons=always"; + la = "ls -la"; + #tree = "eza --icons=always -T"; + i = "kitty +kitten icat"; + # cat = "bat --color=always --style=numbers"; + grep = "rg"; + }; + + extraConfig = '' + $env.config = { + show_banner: false + } + + # Starship + $env.STARSHIP_SHELL = "nu" + mkdir ~/.cache/starship + starship init nu | save -f ~/.cache/starship/init.nu + + # fzf picker for nvim + def f [] { nvim (fzf) } + + # llm | glow + def l [...args] { llm prompt -m groq/llama-3.3-70b-versatile -t std ...$args | glow } + + # Fastfetch on shell start + fastfetch + ''; + + extraEnv = '' + starship init nu | save -f ~/.cache/starship/init.nu + use ~/.cache/starship/init.nu + ''; + }; + programs.fish = { enable = true; @@ -132,11 +187,13 @@ tree = "eza --icons=always -T"; i = "kitty +kitten icat"; cat = "bat --color=always --style=numbers"; - grep = "ripgrep"; - nix-switch = if pkgs.stdenv.isDarwin then - "darwin-rebuild switch --flake ~/.config/nix#(hostname -s)" - else - "sudo nixos-rebuild switch --flake ~/.config/nix#(hostname -s)"; + grep = "rg"; + cp = "rsync -ah --progress"; + nix-switch = + if pkgs.stdenv.isDarwin then + "darwin-rebuild switch --flake ~/.config/nix#(hostname -s)" + else + "sudo nixos-rebuild switch --flake ~/.config/nix#(hostname -s)"; }; interactiveShellInit = '' @@ -192,8 +249,7 @@ # Git status module settings git_status = { - format = - "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](red) ($ahead_behind$stashed)]($style)"; + format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](red) ($ahead_behind$stashed)]($style)"; style = "bold #a6e3a1"; conflicted = ""; untracked = "";