From 68207a05b9dc3b7c469d417b0b9815c93a38db84 Mon Sep 17 00:00:00 2001 From: xbazzi Date: Sun, 10 Aug 2025 18:43:23 -0600 Subject: [PATCH] Switch to hyprpanel --- flake.lock | 61 +++++++-- flake.nix | 37 +++--- home/default.nix | 8 +- home/home.nix | 2 + home/hypridle.nix | 13 +- home/hyprland.nix | 75 ++++++++--- home/hyprlock.nix | 4 +- home/hyprpanel-config.json | 65 ++++++++++ home/hyprpanel-config.json.json | 35 +++++ home/hyprpanel.nix | 49 +++++++ home/hyprpanel2.nix | 47 +++++++ home/hyprpanel3.nix | 95 ++++++++++++++ home/hyprpaper.nix | 4 +- home/notify.nix | 26 ++++ home/packages.nix | 18 ++- home/quickshell.nix | 12 +- home/quickshell/defaultOLD/bars/TopBar.qml | 46 +++++++ .../defaultOLD/bars/modules/Clock.qml | 18 +++ home/quickshell/defaultOLD/shell.qml | 24 ++++ .../defaultOLD/widgets/HyprlandWorkspaces.qml | 37 ++++++ .../defaultOLD/widgets/VolumeMixer.qml | 101 +++++++++++++++ home/quickshell/shell.qml | 50 -------- home/quickshell/shell.qml.old | 120 ++++++++++++++++++ home/yazi.nix | 56 ++++++++ home/zsh.nix | 7 + system/configuration.nix | 9 +- system/default.nix | 1 - system/packages.nix | 17 ++- system/yazi.nix | 30 ----- 29 files changed, 908 insertions(+), 159 deletions(-) create mode 100644 home/hyprpanel-config.json create mode 100644 home/hyprpanel-config.json.json create mode 100644 home/hyprpanel.nix create mode 100644 home/hyprpanel2.nix create mode 100644 home/hyprpanel3.nix create mode 100644 home/notify.nix create mode 100644 home/quickshell/defaultOLD/bars/TopBar.qml create mode 100644 home/quickshell/defaultOLD/bars/modules/Clock.qml create mode 100644 home/quickshell/defaultOLD/shell.qml create mode 100644 home/quickshell/defaultOLD/widgets/HyprlandWorkspaces.qml create mode 100644 home/quickshell/defaultOLD/widgets/VolumeMixer.qml delete mode 100644 home/quickshell/shell.qml create mode 100644 home/quickshell/shell.qml.old create mode 100755 home/yazi.nix delete mode 100755 system/yazi.nix diff --git a/flake.lock b/flake.lock index c64994a..d6dfadc 100755 --- a/flake.lock +++ b/flake.lock @@ -294,11 +294,11 @@ ] }, "locked": { - "lastModified": 1754756528, - "narHash": "sha256-W1jYKMetZSOHP5m2Z5Wokdj/ct17swPHs+MiY2WT1HQ=", + "lastModified": 1754842705, + "narHash": "sha256-2vvncPLsBWV6dRM5LfGHMGYZ+vzqRDqSPBzxPAS0R/A=", "owner": "nix-community", "repo": "home-manager", - "rev": "3ec1cd9a0703fbd55d865b7fd2b07d08374f0355", + "rev": "91586008a23c01cc32894ee187dca8c0a7bd20a4", "type": "github" }, "original": { @@ -413,11 +413,11 @@ ] }, "locked": { - "lastModified": 1754517526, - "narHash": "sha256-zPfU6I7AqlDpoC0ZLTnayqCOyEn9Emub/ca4ATP/XxY=", + "lastModified": 1754766309, + "narHash": "sha256-pANfQZ22RNF6sCFxrMahjE70v/HbGfA4lPZ7pTmfwUQ=", "owner": "hyprwm", "repo": "hyprland-plugins", - "rev": "c8dc6f3d5437d26fae625c40388ba52e97bc5fdf", + "rev": "833af8e8c6f035a53a167aff59e5e85bf0386d93", "type": "github" }, "original": { @@ -560,6 +560,24 @@ "type": "github" } }, + "hyprshell": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1754807024, + "narHash": "sha256-mwCxEd8gFRUipVrj3IVUQW6JQ3lgts5pbS5SyQtRV/U=", + "ref": "refs/heads/master", + "rev": "a9eef265ad3417dd2f6cc3466413438571408b3f", + "revCount": 15, + "type": "git", + "url": "https://gitgud.foo/thegrind/hypr-shell.git" + }, + "original": { + "type": "git", + "url": "https://gitgud.foo/thegrind/hypr-shell.git" + } + }, "hyprutils": { "inputs": { "nixpkgs": [ @@ -674,11 +692,27 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1754498491, - "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", + "lastModified": 1754725699, + "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1754725699, + "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", + "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", "type": "github" }, "original": { @@ -768,8 +802,9 @@ "inputs": { "home-manager": "home-manager", "hyprland-plugins": "hyprland-plugins", + "hyprshell": "hyprshell", "lanzaboote": "lanzaboote", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "stylix": "stylix" } }, @@ -815,11 +850,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1754597531, - "narHash": "sha256-OpC9/PBIuL2WEJUkcuD/wVxI8r+3o6f5RylSIefjHo4=", + "lastModified": 1754851076, + "narHash": "sha256-k3+/24lN6E9BFRhryHocm7314t0Wtku0hgIdEWi15XI=", "owner": "danth", "repo": "stylix", - "rev": "63bb34a66ad7d1af2e95ee20dd675896b2074c32", + "rev": "afcfed6fd2a51615cd63aa7fa7608d670e7b61e5", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index cc3080c..e6e69a1 100755 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,17 @@ description = "My system configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; stylix = { url = "github:danth/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprshell = { + url = "git+https://gitgud.foo/thegrind/hypr-shell.git"; + }; + lanzaboote = { url = "github:nix-community/lanzaboote/v0.4.2"; inputs.nixpkgs.follows = "nixpkgs"; @@ -85,24 +89,6 @@ inputs.stylix.nixosModules.stylix ./system/default.nix lanzaboote.nixosModules.lanzaboote - - # Link Hyprland-Dots configs - # { - # home.file = { - # ".config/hypr".source = "${hyprdots}/hypr"; - # ".config/waybar".source = "${hyprdots}/waybar"; - # ".config/rofi".source = "${hyprdots}/rofi"; - # ".config/swww".source = "${hyprdots}/swww"; - # ".config/wallust".source = "${hyprdots}/wallust"; - # }; - - # # Install extra tools from Hyprland-Dots requirements - # home.packages = with pkgs; [ - # waybar rofi-wayland swww wallust - # grim slurp wl-clipboard - # ]; - # } - ( { pkgs, lib, ... }: { @@ -133,6 +119,7 @@ inherit pkgs; extraSpecialArgs = { inherit inputs; }; modules = [ + inputs.hyprshell.homeManagerModules.default ./home/default.nix ]; }; @@ -141,9 +128,17 @@ home-manager.users.xbazzi = { nixpkgs.config.allowUnfree = true; - #home.packages = [ - #]; + extraSpecialArgs = { inherit inputs; }; + # imports = }; + + # home-manager.users.xbazzi = { + # extraSpecialArgs = { inherit inputs; }; + # nixpkgs.config.allowUnfree = true; + # # imports = inputs.hyprshell.homeManagerModules.default; + # #home.packages = [ + # #]; + # }; #home-manager.extraSpecialArgs }; } diff --git a/home/default.nix b/home/default.nix index 2784fcf..e55cf7c 100755 --- a/home/default.nix +++ b/home/default.nix @@ -8,7 +8,9 @@ { imports = [ + # inputs.hyprshell.homeManagerModules.default ./home.nix + ./yazi.nix ./bash.nix ./gtk.nix ./tmux.nix @@ -16,9 +18,13 @@ #./vscode.nix ./packages.nix ./hyprlock.nix + ./hypridle.nix + ./notify.nix # ./waybar.nix # ./dconf.nix - ./quickshell.nix + # ./quickshell.nix + # ./hyprpanel.nix + ./hyprpanel3.nix ./hyprpaper.nix ./git.nix ./hyprland.nix diff --git a/home/home.nix b/home/home.nix index 606abb9..5a3828e 100755 --- a/home/home.nix +++ b/home/home.nix @@ -12,6 +12,8 @@ wayland.windowManager.hyprland.enable = true; + programs.command-not-found.enable = false; + # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/home/hypridle.nix b/home/hypridle.nix index 7bfc604..cec7722 100644 --- a/home/hypridle.nix +++ b/home/hypridle.nix @@ -7,24 +7,27 @@ }: { - programs.hypridle = { + services.hypridle = { enable = true; settings = { general = { - lock_cmd = "hyprctl dispatch exec 'hyprlock --immediate'"; + # lock_cmd = "hyprctl dispatch exec 'hyprlock --immediate'"; + lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; before_sleep_cmd = "hyprctl dispatch exec 'hyprlock --immediate'"; - after_sleep_cmd = "notify-send '💡 Welcome back, badman!'"; + # before_sleep_cmd = "loginctl lock-session"; + # after_sleep_cmd = "notify-send '💡 Welcome back, badman!'"; + after_sleep_cmd = "hyprctl dispatch dpms on"; }; listener = [ { - timeout = 270; # 4.5 min — warn before lock + timeout = 10; # 4.5 min — warn before lock on-timeout = "notify-send '🔒 Locking in 30s...'"; } { timeout = 300; # 5 min — lock screen - on-timeout = "hyprctl dispatch exec 'hypelock --immediate'"; + on-timeout = "hyprctl dispatch exec 'hyprlock --immediate'"; } { timeout = 900; # 15 min — suspend diff --git a/home/hyprland.nix b/home/hyprland.nix index 23243b5..aa68419 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -10,20 +10,29 @@ settings = { "$mod" = "SUPER"; + input = { + repeat_delay = 240; + repeat_rate = 40; + }; + + env = [ + "HYPRLAND_PRIMARY_MONITOR,DP-3" + ]; + monitor = [ "DP-1, 1920x1080@144, 0x0, 1" "DP-3, 2560x1440@240, 1920x0, 1" - "HMDI-A-1, 3440x1440@160, 4480x0, 1" + "HDMI-A-1, 3440x1440@160, 4480x0, 1" # "DP-3,addreserved,30,0,0,0" ]; # Mouse stuff (Ew... I know) bindm = [ - # Left click move - "$mod, mouse:272, movewindow" + # Right click move + "ALT, mouse:272, movewindow" # Left click resize - "ALT, mouse:272, resizewindow" + "ALT, mouse:273, resizewindow" # "ALT CTRL, mouse:272, resizewindow 1" ]; @@ -32,9 +41,21 @@ "$mod CTRL, l, resizeactive, 30 0" "$mod CTRL, j, resizeactive, 0 30" "$mod CTRL, k, resizeactive, 0 -30" + + "$mod, 0, layoutmsg, rollnext" + "$mod SHIFT, 0, layoutmsg, rollprev" + "$mod SHIFT, n, layoutmsg, cycleprev" + "$mod SHIFT, p, layoutmsg, cyclenext" ]; bind = [ + # Dwindle + "$mod, p, layoutmsg, togglesplit" + "$mod, 0, layoutmsg, swapsplit" + "$mod, a, layoutmsg, preselect l" + "$mod SHIFT, a, layoutmsg, preselect u" + + "ALT, TAB, cyclenext, all" "$mod, h, movefocus, l" "$mod, l, movefocus, r" @@ -42,10 +63,6 @@ "$mod, j, movefocus, d" "$mod SHIFT, q, killactive" - "$mod, 0, layoutmsg, rollnext" - "$mod SHIFT, n, layoutmsg, cycleprev" - "$mod SHIFT, p, layoutmsg, cyclenext" - "$mod, f, fullscreen, 0" "$mod, d, exec, wofi --show drun" @@ -56,11 +73,10 @@ "$mod SHIFT, l, movewindow, mon:-1" "$mod SHIFT, h, movewindow, mon:+1" - ", Print, exec, grimblast copy area" "$mod, e, exec, thunderbird" "$mod, r, exec, kitty -- zsh -c 'exec yazi; exec zsh'" - "$mod, b, exec, kitty -- zsh -c 'btop; exec zsh'" + "$mod, b, exec, kitty -- zsh -c 'exec btop; exec zsh'" "$mod CTRL, n, exec, kitty --start-as=normal -- zsh -ic 'code ~/nixos-config && exit'" "$mod, i, exec, brave" @@ -77,9 +93,15 @@ # Log out # "$mod, -, exec, hyprctl dispatch exit" "$mod SHIFT ALT, x, exec, hyprctl dispatch exit" + + # Reload + "$mod SHIFT rLT, R, exec, hyprctl reload" "$mod ALT, L, exec, hyprlock --immediate" + # Print whole screen + ", Print, exec, grimblast copy screen" + # Shift+Print → select area and copy "SHIFT, Print, exec, grimblast copy area" @@ -103,13 +125,34 @@ ) ); - general = { - layout = "master"; + # doesn't work + # workspace = + # builtins.genList (i: "DP-3, ${toString (i + 1)}") 9; + workspace = [ + "1, monitor:DP-3, persistent:true" + "2, monitor:DP-3, persistent:true" + "3, monitor:DP-3, persistent:true" + "4, monitor:DP-3, persistent:true" + "5, monitor:DP-3, persistent:true" + "6, monitor:DP-3, persistent:true" + "7, monitor:DP-3, persistent:true" + ]; + + dwindle = { + preserve_split = true; + smart_resizing = true; + }; + + general = { + gaps_out = 0; + gaps_in = 0; + # layout = "master"; + layout = "dwindle"; }; windowrulev2 = [ "opacity 0.85, class:^(Code)$" - "opacity 0.85, class:^(kitty)$" + "opacity 0.75, class:^(kitty)$" ]; # layerrule = [ @@ -123,7 +166,7 @@ blur = { enabled = true; - size = 5; + size = 2; passes = 2; brightness = 1; contrast = 1.0; @@ -132,8 +175,8 @@ new_optimizations = true; # xray = true; }; - blurls = "^(popup|menu)$"; + blurls = "^(popup|menu)$"; shadow = { enabled = true; @@ -179,7 +222,7 @@ exec-once = [ # "sleep 2 && waybar &" "hypridle &" - # "waybar &" + "hyprpanel &" "eval $(gnome-keyring-daemon --start --components=secrets,ssh,gpg)" # "hash dbus-update-activation-environment 2>/dev/null" # "dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" diff --git a/home/hyprlock.nix b/home/hyprlock.nix index 97ac1ef..6116a0a 100644 --- a/home/hyprlock.nix +++ b/home/hyprlock.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: +{ config, inputs, pkgs, ... }: { programs.hyprlock = { @@ -18,7 +18,7 @@ background = [ { monitor = ""; - path = "${./wallpapers/world_map_of_cpp_STL_algorithms.png}"; + path = "${config.home.homeDirectory}/Pictures/wallpapers/City-Night.png"; blur_passes = 2; contrast = 0.8916; brightness = 0.8172; diff --git a/home/hyprpanel-config.json b/home/hyprpanel-config.json new file mode 100644 index 0000000..55888d4 --- /dev/null +++ b/home/hyprpanel-config.json @@ -0,0 +1,65 @@ +{ + "bar": { + "customModules": { + "hypridle": { + "isActiveCommand": "systemctl --user status hypridle.service | grep -q 'Active: active (running)' && echo 'yes' || echo 'no'", + "startCommand": "systemctl --user start hypridle.service", + "stopCommand": "systemctl --user stop hypridle.service" + } + }, + "launcher": { + "autoDetectIcon": true + }, + "workspaces": { + "show_icons": true + } + }, + "layout": { + "bar": { + "layouts": { + "0": { + "left": [ + "dashboard", + "workspaces" + ], + "middle": [ + "media" + ], + "right": [ + "volume", + "systray", + "notifications" + ] + } + } + } + }, + "menus": { + "clock": { + "time": { + "hideSeconds": true, + "military": true + }, + "weather": { + "unit": "metric" + } + }, + "dashboard": { + "directories": { + "enabled": false + }, + "stats": { + "enable_gpu": true + } + } + }, + "theme": { + "bar": { + "transparent": false + }, + "font": { + "name": "CaskaydiaCove NF", + "size": "16px" + } + } +} diff --git a/home/hyprpanel-config.json.json b/home/hyprpanel-config.json.json new file mode 100644 index 0000000..ca54eb6 --- /dev/null +++ b/home/hyprpanel-config.json.json @@ -0,0 +1,35 @@ +{ + "bar.customModules.storage.paths": [ + "/" + ], + "theme.font.name": "Monaspace Krypton", + "theme.font.label": "Monaspace Krypton Medium", + "theme.bar.floating": false, + "theme.bar.location": "bottom", + "bar.autoHide": "never", + "theme.bar.buttons.enableBorders": true, + "bar.workspaces.show_icons": false, + "bar.workspaces.show_numbered": false, + "bar.workspaces.workspaceMask": false, + "bar.workspaces.showWsIcons": true, + "bar.workspaces.showApplicationIcons": true, + "bar.workspaces.showAllActive": true, + "bar.network.showWifiInfo": true, + "bar.network.truncation_size": 6, + "theme.bar.buttons.network.enableBorder": false, + "bar.network.label": true, + "menus.media.displayTimeTooltip": true, + "menus.media.noMediaText": "Nathan rn", + "menus.clock.time.military": true, + "menus.clock.time.hideSeconds": false, + "theme.bar.transparent": false, + "theme.bar.opacity": 85, + "theme.bar.background": "#14003e", + "theme.bar.buttons.borderSize": "0.02em", + "theme.bar.buttons.monochrome": false, + "theme.bar.buttons.workspaces.occupied": "#00d0d0", + "theme.bar.buttons.workspaces.active": "#05ff00", + "theme.bar.buttons.workspaces.numbered_active_underline_color": "#00d0d0", + "theme.bar.buttons.windowtitle.text": "#00d0d0", + "theme.bar.buttons.windowtitle.icon": "#00ff19" +} \ No newline at end of file diff --git a/home/hyprpanel.nix b/home/hyprpanel.nix new file mode 100644 index 0000000..3b10296 --- /dev/null +++ b/home/hyprpanel.nix @@ -0,0 +1,49 @@ +{ inputs, ... }: +{ + programs.hyprpanel = { + enable = true; + # Configure and theme almost all options from the GUI. + # See 'https://hyprpanel.com/configuration/settings.html'. + # Default: + settings = { + + # system = { bluetoothAgent = { enable = false; }; }; + + # Configure bar layouts for monitors. + # See 'https://hyprpanel.com/configuration/panel.html'. + # Default: null + layout = { + bar.layouts = { + "0" = { + left = [ "dashboard" "workspaces" ]; + middle = [ "media" ]; + right = [ "volume" "systray" "notifications" ]; + }; + }; + }; + + bar.launcher.autoDetectIcon = true; + bar.workspaces.show_icons = true; + + # menus.bluetooth = { enable = false; }; + menus.clock = { + time = { + military = true; + hideSeconds = true; + }; + weather.unit = "metric"; + }; + + menus.dashboard.directories.enabled = false; + menus.dashboard.stats.enable_gpu = true; + + theme.bar.transparent = false; + + theme.font = { + name = "CaskaydiaCove NF"; + # name = "fira-code"; + size = "16px"; + }; + }; + }; +} \ No newline at end of file diff --git a/home/hyprpanel2.nix b/home/hyprpanel2.nix new file mode 100644 index 0000000..aca7e03 --- /dev/null +++ b/home/hyprpanel2.nix @@ -0,0 +1,47 @@ +{ inputs, ... }: +{ + programs.hyprpanel = { + enable = false; + settings = { + bar = { + customModules.hypridle = { + isActiveCommand = "systemctl --user status hypridle.service | grep -q 'Active: active (running)' && echo 'yes' || echo 'no'"; + startCommand = "systemctl --user start hypridle.service"; + stopCommand = "systemctl --user stop hypridle.service"; + }; + + launcher.autoDetectIcon = true; + workspaces.show_icons = true; + }; + + layout.bar.layouts."0" = { + left = [ "dashboard" "workspaces" ]; + middle = [ "media" ]; + right = [ "volume" "systray" "notifications" ]; + }; + + menus = { + clock = { + time = { + hideSeconds = true; + military = true; + }; + weather.unit = "metric"; + }; + + dashboard = { + directories.enabled = false; + stats.enable_gpu = true; + }; + }; + + theme = { + bar.transparent = false; + font = { + name = "Monaspace Krypton"; # likely "CaskaydiaCove Nerd Font" in fontconfig + size = "16px"; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/home/hyprpanel3.nix b/home/hyprpanel3.nix new file mode 100644 index 0000000..20f395b --- /dev/null +++ b/home/hyprpanel3.nix @@ -0,0 +1,95 @@ +{ inputs, ... }: + +{ + programs.hyprpanel = { + enable = true; + settings = { + bar = { + layouts = { + "0" = { + left = [ "dashboard" "workspaces" ]; + middle = [ "media" ]; + right = [ "volume" "systray" "notifications" ]; + }; + }; + + launcher.autoDetectIcon = true; + customModules.storage.paths = [ "/" ]; + autoHide = "never"; + + workspaces = { + show_icons = true; + show_numbered = false; + workspaceMask = false; + showWsIcons = true; + showApplicationIcons = true; + showAllActive = true; + }; + + network = { + showWifiInfo = true; + truncation_size = 6; + label = true; + }; + }; + + menus = { + media = { + displayTimeTooltip = true; + noMediaText = "Nathan rn"; + }; + clock.time = { + military = true; + hideSeconds = false; + }; + dashboard.controls.enabled = true; + }; + + theme = { + matugen = false; + + font = { + name = "Monaspace Krypton"; + label = "Monaspace Krypton Medium"; + }; + + bar = { + floating = false; + location = "bottom"; + transparent = false; + opacity = 90; + background = "#241f31"; + + buttons = { + enableBorders = true; + borderSize = "0.02em"; + monochrome = false; + + workspaces = { + occupied = "#00d0d0"; + active = "#05ff00"; + numbered_active_underline_color = "#00d0d0"; + }; + + windowtitle = { + text = "#00d0d0"; + icon = "#00ff19"; + }; + + network.enableBorder = false; + + modules = { + hypridle.enableBorder = true; + cava.enableBorder = true; + }; + }; + + menus.menu.media = { + slider.primary = "#00e2c5"; + artist = "#50ff00"; + }; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/home/hyprpaper.nix b/home/hyprpaper.nix index 5cb4509..81b49a6 100644 --- a/home/hyprpaper.nix +++ b/home/hyprpaper.nix @@ -14,11 +14,11 @@ ipc = "on"; splash = false; preload = [ - "/home/xbazzi/Pictures/wallpapers/Fantasy-Landscape2.png" + "/home/xbazzi/Pictures/wallpapers/cities" ]; wallpaper = [ - ",/home/xbazzi/Pictures/wallpapers/Fantasy-Landscape2.png" + ",/home/xbazzi/Pictures/wallpapers/Fantasy-Lake1.png" ]; }; }; diff --git a/home/notify.nix b/home/notify.nix new file mode 100644 index 0000000..68f267a --- /dev/null +++ b/home/notify.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: let + notif = + pkgs.writeShellScriptBin "notif" # bash + + '' + # Shell script to send custom notifications + # Usage: notif "sender_id" "message" ["description"] + NOTIF_FOLDER="/tmp/notif" + sender_id=$1 # To overwrite existing notifications + title=$2 + description=$3 + + [[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER + [[ -f "$NOTIF_FOLDER/$sender_id" ]] || (echo "0" > "$NOTIF_FOLDER/$sender_id") + + old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id") + [[ -z "$old_notification_id" ]] && old_notification_id=0 + + ${pkgs.libnotify}/bin/notify-send \ + --replace-id="$old_notification_id" --print-id \ + --app-name="$sender_id" \ + "$title" \ + "$description" \ + > "$NOTIF_FOLDER/$sender_id" + ''; +in {home.packages = [pkgs.libnotify notif];} \ No newline at end of file diff --git a/home/packages.nix b/home/packages.nix index 630d321..251f077 100755 --- a/home/packages.nix +++ b/home/packages.nix @@ -4,20 +4,26 @@ home.packages = with pkgs; [ hello tmux - # gnomeExtensions.appindicator - wofi - # waybar - # eww - # gnome-keyring + gnome-keyring libsecret grim # for screenshots slurp # for selecting area grimblast # easier syntax for grim+slurp wl-clipboard # copy screenshot to clipboard + bat + yazi + + # Hyprland hypridle hyprlock - # (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + hyprpanel + wofi + # Old stuff for documentation + # gnomeExtensions.appindicator + # waybar + # eww + # (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) #zsh-powerlevel10k #inputs.nixvim.packages.${pkgs.system}.default ]; diff --git a/home/quickshell.nix b/home/quickshell.nix index 3ae9603..7801990 100644 --- a/home/quickshell.nix +++ b/home/quickshell.nix @@ -1,7 +1,9 @@ { pkgs, ... }: { - home.packages = [ pkgs.quickshell ]; + home.packages = with pkgs; [ + quickshell + ]; home.file.".config/quickshell" = { source = ./quickshell; @@ -9,15 +11,15 @@ }; # start it when Hyprland starts - wayland.windowManager.hyprland.settings.exec-once = [ - "quickshell -c default" - ]; + # wayland.windowManager.hyprland.settings.exec-once = [ + # "quickshell -c default" + # ]; # auto reload systemd.user.services.quickshell = { Unit = { Description = "Quickshell bar"; PartOf = [ "graphical-session.target" ]; }; Service = { - ExecStart = "${pkgs.quickshell}/bin/quickshell -c default"; + ExecStart = "${pkgs.quickshell}/bin/quickshell -c hyprshell"; Restart = "always"; }; Install = { WantedBy = [ "default.target" ]; }; diff --git a/home/quickshell/defaultOLD/bars/TopBar.qml b/home/quickshell/defaultOLD/bars/TopBar.qml new file mode 100644 index 0000000..4ee422e --- /dev/null +++ b/home/quickshell/defaultOLD/bars/TopBar.qml @@ -0,0 +1,46 @@ +import "../widgets" +import "./modules" +import QtQuick +import Quickshell +import Quickshell.Io + +PanelWindow { + property int defaultMargin: 0 + + implicitHeight: 40 + margins.top: defaultMargin + margins.left: defaultMargin + margins.right: defaultMargin + margins.bottom: defaultMargin + aboveWindows: true + + anchors { + top: true + left: true + right: true + } + + Rectangle { + anchors.fill: parent + color: "#000000" + } + + Clock { + anchors.centerIn: parent + } + + // Workspaces + HyprlandWorkspaces { + anchors.verticalCenter: parent.verticalCenter + } + + // Right side - Volume button + VolumeMixer { + anchors { + right: parent.right + verticalCenter: parent.verticalCenter + } + + } + +} diff --git a/home/quickshell/defaultOLD/bars/modules/Clock.qml b/home/quickshell/defaultOLD/bars/modules/Clock.qml new file mode 100644 index 0000000..cdc022a --- /dev/null +++ b/home/quickshell/defaultOLD/bars/modules/Clock.qml @@ -0,0 +1,18 @@ +import QtQuick +import Quickshell +import Quickshell.Io + +Item { + SystemClock { + id: clock + + precision: SystemClock.Seconds + } + + Text { + anchors.centerIn: parent + color: "#ffffff" + text: Qt.formatDateTime(clock.date, "ddd MMM d h:m ap") + } + +} diff --git a/home/quickshell/defaultOLD/shell.qml b/home/quickshell/defaultOLD/shell.qml new file mode 100644 index 0000000..edcff0e --- /dev/null +++ b/home/quickshell/defaultOLD/shell.qml @@ -0,0 +1,24 @@ +import "./bars" +import QtQuick +import Quickshell +import Quickshell.Io + +ShellRoot { + // PanelWindow { + // exclusiveZone: 0 + // implicitWidth: 600 + // implicitHeight: 300 + // anchors.top: true + // Rectangle { + // anchors.fill: parent + // color: "black" + // } + // } + + //model: Quickshell.screens + + TopBar { + //required property var modelData + //screen: modelData + } +} diff --git a/home/quickshell/defaultOLD/widgets/HyprlandWorkspaces.qml b/home/quickshell/defaultOLD/widgets/HyprlandWorkspaces.qml new file mode 100644 index 0000000..f6ce537 --- /dev/null +++ b/home/quickshell/defaultOLD/widgets/HyprlandWorkspaces.qml @@ -0,0 +1,37 @@ +import QtQuick +import Quickshell +import Quickshell.Hyprland +import Quickshell.Io + +Row { + spacing: 1 + anchors.verticalCenter: parent.verticalCenter + showEmpty: false + anchors.left: parent.left + anchors.leftMargin: 10 + + Repeater { + model: Hyprland.workspaces + + Rectangle { + visible: modelData.id > 0 // "Magic" workspaces have IDs < 0 + width: 30 + height: 30 + color: modelData.focused ? "#ffffff" : "transparent" + + Text { + anchors.centerIn: parent + text: modelData.id.toString() + color: modelData.focused ? "#000000" : "#ffffff" + } + + MouseArea { + anchors.fill: parent + onClicked: modelData.activate() + } + + } + + } + +} diff --git a/home/quickshell/defaultOLD/widgets/VolumeMixer.qml b/home/quickshell/defaultOLD/widgets/VolumeMixer.qml new file mode 100644 index 0000000..c78376d --- /dev/null +++ b/home/quickshell/defaultOLD/widgets/VolumeMixer.qml @@ -0,0 +1,101 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Services.Pipewire +import Quickshell.Widgets + +Item { + property bool showPopup: false + // Get the default audio sink + property var audioSink: Pipewire.defaultAudioSink + + implicitWidth: volumeButton.width + 20 + + PwObjectTracker { + objects: [audioSink] + } + + // Volume icon button + Rectangle { + // text height + 10px padding + + id: volumeButton + + color: Pipewire.ready ? "transparent" : "red" + width: volumeText.implicitWidth + 20 + height: volumeText.implicitHeight + 10 + anchors.centerIn: parent + + Text { + id: volumeText + + anchors.centerIn: parent + text: `Vol: ${Math.floor(audioSink.audio.volume * 100)}%` + color: "white" + } + + MouseArea { + anchors.fill: parent + onClicked: { + showPopup = !showPopup; + console.log("Volume clicked, showPopup:", showPopup); + } + } + + } + + // Floating volume popup window + PanelWindow { + id: volumePopup + + visible: showPopup + exclusiveZone: 0 + implicitWidth: 500 + implicitHeight: 100 + anchors.right: parent.right + anchors.top: parent.top + + Rectangle { + anchors.fill: parent + color: "black" + + ColumnLayout { + anchors.fill: parent + anchors.margins: 30 + spacing: 10 + + RowLayout { + Label { + Layout.fillWidth: true + text: `${audioSink.description}` + color: "white" + font.pixelSize: 16 + } + + } + + RowLayout { + spacing: 10 + + Label { + text: `${Math.floor(audioSink.audio.volume * 100)}%` + color: "white" + font.pixelSize: 16 + } + + Slider { + Layout.fillWidth: true + value: audioSink.audio.volume + onValueChanged: audioSink.audio.volume = value + } + + } + + } + + } + + } + +} diff --git a/home/quickshell/shell.qml b/home/quickshell/shell.qml deleted file mode 100644 index 593d0b5..0000000 --- a/home/quickshell/shell.qml +++ /dev/null @@ -1,50 +0,0 @@ -import Quickshell -import Quickshell.Io -import QtQuick - -// one window per screen -Variants { - model: Quickshell.screens - delegate: Component { - PanelWindow { - required property var modelData - screen: modelData - - // top bar, full width - anchors.top: true - anchors.left: true - anchors.right: true - implicitHeight: 30 // tweak height if yuh want - - Rectangle { - anchors.fill: parent - color: "#1a1a1a" - opacity: 0.5 - } - - // center clock - Text { - id: clock - anchors.centerIn: parent - font.pixelSize: 13 - color: "#e6e6e6" - } - - // update clock every second using `date` - Process { - id: dateProc - command: [ "date", "+%a %b %d %H:%M:%S" ] - running: true - stdout: StdioCollector { - onStreamFinished: clock.text = this.text.trim() - } - } - Timer { - interval: 1000 - running: true - repeat: true - onTriggered: dateProc.running = true - } - } - } -} \ No newline at end of file diff --git a/home/quickshell/shell.qml.old b/home/quickshell/shell.qml.old new file mode 100644 index 0000000..a9fd39f --- /dev/null +++ b/home/quickshell/shell.qml.old @@ -0,0 +1,120 @@ +import Quickshell +import Quickshell.Io +import QtQuick + +// one window per screen +Variants { + model: Quickshell.screens + delegate: Component { + PanelWindow { + required property var modelData + screen: modelData + + // top bar, full width + anchors.top: true + anchors.left: true + anchors.right: true + implicitHeight: 30 // tweak height if yuh want + + Rectangle { + anchors.fill: parent + color: "#1a1a1a" + opacity: 0.5 + } + + // === Workspaces (top-left) === + Row { + id: wsBar + anchors.left: parent.left + anchors.leftMargin: 8 + anchors.verticalCenter: parent.verticalCenter + spacing: 6 + + // dynamic list of workspace IDs (fallback to 1..10) + property var ids: [1,2,3,4,5,6,7,8,9,10] + property int active: 1 + + Repeater { + model: ids.length + delegate: Rectangle { + property int idx: wsBar.ids[index] + width: 22; height: 16; radius: 5 + color: (wsBar.active === idx) ? "#2e7d32" : "#303030" + border.width: 1 + border.color: (wsBar.active === idx) ? "#4caf50" : "#444444" + + Text { + anchors.centerIn: parent + text: idx + color: "#eaeaea" + font.pixelSize: 10 + } + + MouseArea { + anchors.fill: parent + onClicked: { + var p = Qt.createQmlObject('import Quickshell; Process {}', parent) + p.command = ["hyprctl","dispatch","workspace", String(idx)] + p.running = true + } + } + } + } + + // poll active workspace + known workspaces (needs jq in PATH) + Timer { + interval: 700; running: true; repeat: true + onTriggered: { + // active ws + var p1 = Qt.createQmlObject( + 'import Quickshell; import Quickshell.Io; Process { stdout: StdioCollector{} }', wsBar) + p1.command = ["bash","-lc","hyprctl activeworkspace -j | jq -r .id"] + p1.running = true + p1.stdout.onStreamFinished.connect(function() { + var v = parseInt(p1.stdout.text.trim()) + if (!isNaN(v)) wsBar.active = v + }) + + // list of existing ws ids (sorted) + var p2 = Qt.createQmlObject( + 'import Quickshell; import Quickshell.Io; Process { stdout: StdioCollector{} }', wsBar) + p2.command = ["bash","-lc","hyprctl workspaces -j | jq -r '.[].id' | sort -n | tr '\\n' ' '"] + p2.running = true + p2.stdout.onStreamFinished.connect(function() { + var s = p2.stdout.text.trim() + if (s.length > 0) { + var arr = s.split(/\\s+/).map(function(x){ return parseInt(x) }) + .filter(function(x){ return !isNaN(x) }) + if (arr.length > 0) wsBar.ids = arr + } + }) + } + } + } + + // center clock + Text { + id: clock + anchors.centerIn: parent + font.pixelSize: 13 + color: "#e6e6e6" + } + + // update clock every second using `date` + Process { + id: dateProc + command: [ "date", "+%a %b %d %H:%M:%S" ] + running: true + stdout: StdioCollector { + onStreamFinished: clock.text = this.text.trim() + } + } + Timer { + interval: 1000 + running: true + repeat: true + onTriggered: dateProc.running = true + } + } + } +} \ No newline at end of file diff --git a/home/yazi.nix b/home/yazi.nix new file mode 100755 index 0000000..cd36e15 --- /dev/null +++ b/home/yazi.nix @@ -0,0 +1,56 @@ +{ config, pkgs, ... }: + +{ + + programs.yazi = { + enable = true; + # keymap = { + # mgr.prepend_keymap = [ + # { + # on = [ + # "b" + # "g" + # ]; + # run = "shell 'hyprctl hyprpaper preload \"$0\" && hyprctl hyprpaper wallpaper \",$0\""; + # desc = "Set img as wallpaper"; + # } + # ]; + # }; + + keymap = { + manager.prepend_keymap = [ + { + on = [ + "b" + "g" + ]; + run = "shell 'hyprctl hyprpaper preload \"$0\" && hyprctl hyprpaper wallpaper \", $0\"'"; + desc = "Set as wallpaper"; + } + ]; + }; + + settings = { + yazi = { + ratio = [ + 1 + 4 + 3 + ]; + sort_by = "natural"; + sort_sensitive = true; + sort_reverse = false; + sort_dir_first = true; + linemode = "none"; + show_hidden = true; + show_symlink = true; + }; + + # tasks = { + # micro_workers = 5; + # macro_workers = 10; + # bizarre_retry = 5; + # }; + }; + }; +} diff --git a/home/zsh.nix b/home/zsh.nix index f5e5d02..f5b0cca 100755 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -13,6 +13,7 @@ autosuggestion.enable = true; syntaxHighlighting.enable = true; initExtra = '' + source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh export TERM=xterm-kitty bindkey -e @@ -79,6 +80,12 @@ in { # la="eza -s modified -r -lh"; + fonts = "fc-list : family "; + + workspaces = "hyprctl -j workspaces | jq '.[] | {id, monitor, windows, active}'"; + reboot = ''echo "Nice try. Use \`sudo /run/current-system/sw/bin/reboot\` instead."''; + reboot-foreal = "sudo /run/current-system/sw/bin/reboot now"; + cat = " bat"; cb = "cmake -B build -S . && cmake --build build -j$(nproc)"; la = "eza -s modified -lhr --icons --git"; ls = "eza -lh --group-directories-first --icons --git"; diff --git a/system/configuration.nix b/system/configuration.nix index 95be4f1..7edb4a9 100755 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -14,6 +14,11 @@ "flakes" ]; + # Graphics + hardware.graphics.enable = true; + hardware.graphics.enable32Bit = true; + + # OpenRGB services.hardware.openrgb.enable = true; @@ -32,7 +37,7 @@ # command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c 'Hyprland'"; # TUI greeter - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember \ + command = "${pkgs.tuigreet}/bin/tuigreet --time --remember \ --cmd 'dbus-run-session ${pkgs.hyprland}/bin/Hyprland'"; user = "greeter"; }; @@ -134,6 +139,8 @@ isNormalUser = true; description = "Xander Bazzi"; extraGroups = [ + "video" + "render" "docker" "networkmanager" "wheel" diff --git a/system/default.nix b/system/default.nix index 5604c0a..eb0dc8e 100755 --- a/system/default.nix +++ b/system/default.nix @@ -9,7 +9,6 @@ # ./stylix.nix # ./gnome.nix # ./lanzaboote.nix - ./yazi.nix ./nvidia.nix ./network.nix ./nfs.nix diff --git a/system/packages.nix b/system/packages.nix index f194ffb..14c4f30 100755 --- a/system/packages.nix +++ b/system/packages.nix @@ -2,12 +2,14 @@ { environment.systemPackages = with pkgs; [ # modrinth-app + gnumake ansible niv sbctl vim wget xournalpp + zathura obsidian libreoffice-qt hunspell @@ -16,7 +18,6 @@ git fastfetch wget - #discord-canary vesktop discord cudaPackages_12.cudatoolkit @@ -27,17 +28,16 @@ gparted htop btop - yazi - #google-chrome dig + # netstat-net-tools prismlauncher inetutils ansible-builder + nix-index ansible-lint hollywood cmatrix nmap - #intellephense brave ffmpeg variety @@ -50,21 +50,26 @@ openssl tree screenkey - # firefox direnv jq nixfmt + unzip + nettools # Hyprland Ecosystem hyprpaper hyprpicker hyprpolkitagent hyprsunset - (pkgs.hyprland.override { enableXWayland = true; withSystemd = true; }) + + # Qt + # kdePackages.qt5compat + # libsForQt5.qt5.qtgraphicaleffects + # libsForQt5.qt5.qtdeclarative ]; programs.nix-ld.enable = true; diff --git a/system/yazi.nix b/system/yazi.nix deleted file mode 100755 index 160272a..0000000 --- a/system/yazi.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, pkgs, ... }: - -{ - - programs.yazi = { - enable = true; - settings = { - yazi = { - ratio = [ - 1 - 4 - 3 - ]; - sort_by = "natural"; - sort_sensitive = true; - sort_reverse = false; - sort_dir_first = true; - linemode = "none"; - show_hidden = true; - show_symlink = true; - }; - - # tasks = { - # micro_workers = 5; - # macro_workers = 10; - # bizarre_retry = 5; - # }; - }; - }; -}