diff --git a/docs/THEMES.md b/docs/THEMES.md index 7e798ec..7094aa5 100644 --- a/docs/THEMES.md +++ b/docs/THEMES.md @@ -1,7 +1,7 @@ # Themes Themes are defined in `themes`. Those themes define the colors, fonts, icons, etc, used by Hyprland and the apps/programs installed. -You can change the selected theme by changing the import statement of your host's variables.nix file. +You can change the selected theme by changing the import statement of your host's configuration.nix file. > [!TIP] > To apply the theme to DuckDuckGo, follow the instructions in `$HOME/.duckduckgo-colorscheme.js` diff --git a/docs/TODO.md b/docs/TODO.md index b3cd6cc..d26374e 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -2,8 +2,7 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) -- [ ] Hyprshade (replacement for gammastep) - - [ ] !!! Qutebrowser Bitwarden integration (I need this.) +- [!] Qutebrowser Bitwarden integration (I need this.) - [ ] Hyprland - [ ] Fix screenshots (screenshot region's border shows up in the screenshot, hyprshot jq error?) and add in the scripts doc diff --git a/docs/scripts/keybindings_to_markdown.sh b/docs/scripts/keybindings_to_markdown.sh index a4b9aa8..0909579 100644 --- a/docs/scripts/keybindings_to_markdown.sh +++ b/docs/scripts/keybindings_to_markdown.sh @@ -17,9 +17,9 @@ function getList() { echo "$list" } -[[ -f "./home/system/hyprland/default.nix" ]] || (echo "File ./home/system/hyprland/default.nix not found" && exit 1) +[[ -f "./home/system/hyprland/bindings.nix" ]] || (echo "File ./home/system/hyprland/bindings.nix not found" && exit 1) -config=$(cat "./home/system/hyprland/default.nix") +config=$(cat "./home/system/hyprland/bindings.nix") # Bind bind=$(getList "$config" "bind") diff --git a/home/scripts/night-shift/default.nix b/home/scripts/night-shift/default.nix index ad85f89..35d5cb3 100644 --- a/home/scripts/night-shift/default.nix +++ b/home/scripts/night-shift/default.nix @@ -10,10 +10,9 @@ { pkgs, ... }: let - default = "4000"; night-shift-on = pkgs.writeShellScriptBin "night-shift-on" '' - ${pkgs.hyprland}/bin/hyprctl dispatch exec "${pkgs.gammastep}/bin/gammastep -O ${default}" + ${pkgs.hyprshade}/bin/hyprshade on blue-light-filter title="󰖔 Night-Shift Activated" description="Night-Shift is now activated! Your screen will be warmer and easier on the eyes." @@ -21,7 +20,7 @@ let ''; night-shift-off = pkgs.writeShellScriptBin "night-shift-off" '' - pkill gammastep + ${pkgs.hyprshade}/bin/hyprshade off title="󰖕 Night-Shift Deactivated" description="Night-Shift is now deactivated! Your screen will return to normal." @@ -29,7 +28,7 @@ let ''; night-shift = pkgs.writeShellScriptBin "night-shift" '' - if pgrep gammastep; then + if [[ $(${pkgs.hyprshade}/bin/hyprshade current) ]]; then night-shift-off else night-shift-on @@ -37,7 +36,7 @@ let ''; night-shift-status = pkgs.writeShellScriptBin "night-shift-status" '' - if [[ $(pgrep gammastep) ]]; then + if [[ $(${pkgs.hyprshade}/bin/hyprshade current) ]]; then echo "1" else echo "0" @@ -46,15 +45,14 @@ let night-shift-status-icon = pkgs.writeShellScriptBin "night-shift-status-icon" '' - if [[ $(pgrep gammastep) ]]; then - echo "󰖔" - else - echo "󰖕" - fi + if [[ $(hyprshade current) ]]; then + echo "󰖔" + else + echo "󰖕" + fi ''; in { home.packages = [ - pkgs.gammastep night-shift-on night-shift-off night-shift diff --git a/home/system/hyprland/hypridle.nix b/home/system/hypridle/default.nix similarity index 100% rename from home/system/hyprland/hypridle.nix rename to home/system/hypridle/default.nix diff --git a/home/system/hyprland/animations.nix b/home/system/hyprland/animations.nix new file mode 100644 index 0000000..f02309a --- /dev/null +++ b/home/system/hyprland/animations.nix @@ -0,0 +1,52 @@ +{ config, ... }: { + wayland.windowManager.hyprland.settings = { + animations = let + animationSpeed = config.var.theme.animation-speed; + + animationDuration = if animationSpeed == "slow" then + "4" + else if animationSpeed == "medium" then + "2.5" + else + "1.5"; + borderDuration = if animationSpeed == "slow" then + "10" + else if animationSpeed == "medium" then + "6" + else + "3"; + in { + enabled = true; + bezier = [ + "linear, 0, 0, 1, 1" + "md3_standard, 0.2, 0, 0, 1" + "md3_decel, 0.05, 0.7, 0.1, 1" + "md3_accel, 0.3, 0, 0.8, 0.15" + "overshot, 0.05, 0.9, 0.1, 1.1" + "crazyshot, 0.1, 1.5, 0.76, 0.92" + "hyprnostretch, 0.05, 0.9, 0.1, 1.0" + "menu_decel, 0.1, 1, 0, 1" + "menu_accel, 0.38, 0.04, 1, 0.07" + "easeInOutCirc, 0.85, 0, 0.15, 1" + "easeOutCirc, 0, 0.55, 0.45, 1" + "easeOutExpo, 0.16, 1, 0.3, 1" + "softAcDecel, 0.26, 0.26, 0.15, 1" + "md2, 0.4, 0, 0.2, 1" + ]; + + animation = [ + "windows, 1, ${animationDuration}, md3_decel, popin 60%" + "windowsIn, 1, ${animationDuration}, md3_decel, popin 60%" + "windowsOut, 1, ${animationDuration}, md3_accel, popin 60%" + "border, 1, ${borderDuration}, default" + "fade, 1, ${animationDuration}, md3_decel" + "layersIn, 1, ${animationDuration}, menu_decel, slide" + "layersOut, 1, ${animationDuration}, menu_accel" + "fadeLayersIn, 1, ${animationDuration}, menu_decel" + "fadeLayersOut, 1, ${animationDuration}, menu_accel" + "workspaces, 1, ${animationDuration}, menu_decel, slide" + "specialWorkspace, 1, ${animationDuration}, md3_decel, slidevert" + ]; + }; + }; +} diff --git a/home/system/hyprland/bindings.nix b/home/system/hyprland/bindings.nix new file mode 100644 index 0000000..1c01d5f --- /dev/null +++ b/home/system/hyprland/bindings.nix @@ -0,0 +1,58 @@ +{ pkgs, ... }: { + wayland.windowManager.hyprland.settings = { + bind = [ + "$mod, RETURN, exec, ${pkgs.kitty}/bin/kitty" # Kitty + "$mod, E, exec, ${pkgs.xfce.thunar}/bin/thunar" # Thunar + "$mod, B, exec, ${pkgs.qutebrowser}/bin/qutebrowser" # Qutebrowser + "$mod, K, exec, ${pkgs.bitwarden}/bin/bitwarden" # Bitwarden + "$mod, L, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock + "$mod, X, exec, powermenu" # Powermenu + "$mod, SPACE, exec, menu" # Launcher + "$shiftMod, SPACE, exec, hyprfocus-toggle" # Toggle HyprFocus + + "$mod, Q, killactive," # Close window + "$mod, T, togglefloating," # Toggle Floating + "$mod, F, fullscreen" # Toggle Fullscreen + "$mod, left, movefocus, l" # Move focus left + "$mod, right, movefocus, r" # Move focus Right + "$mod, up, movefocus, u" # Move focus Up + "$mod, down, movefocus, d" # Move focus Down + "$shiftMod, left, layoutmsg, addmaster" # Add to master + "$shiftMod, right, layoutmsg, removemaster" # Remove from master + + "$mod, PRINT, exec, screenshot window" # Screenshot window + ", PRINT, exec, screenshot monitor" # Screenshot monitor + "$shiftMod, PRINT, exec, screenshot region" # Screenshot region + "ALT, PRINT, exec, screenshot region swappy" # Screenshot region then edit + + "$shiftMod, S, exec, ${pkgs.qutebrowser}/bin/qutebrowser :open $(wofi --show dmenu -L 1 -p ' Search on internet')" # Search on internet with wofi + "$shiftMod, C, exec, clipboard" # Clipboard picker with wofi + "$shiftMod, E, exec, ${pkgs.wofi-emoji}/bin/wofi-emoji" # Emoji picker with wofi + "$mod, F2, exec, night-shift" # Toggle night shift + "$mod, F3, exec, night-shift" # Toggle night shift + ] ++ (builtins.concatLists (builtins.genList (i: + let ws = i + 1; + in [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" + ]) 9)); + + bindm = [ + "$mod, mouse:272, movewindow" # Move Window (mouse) + "$mod, R, resizewindow" # Resize Window (mouse) + ]; + + bindl = [ + ",XF86AudioMute, exec, sound-toggle" # Toggle Mute + ",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock when closing Lid + ]; + + bindle = [ + ", XF86AudioRaiseVolume, exec, sound-up" # Sound Up + ", XF86AudioLowerVolume, exec, sound-down" # Sound Down + ", XF86MonBrightnessUp, exec, brightness-up" # Brightness Up + ", XF86MonBrightnessDown, exec, brightness-down" # Brightness Down + ]; + + }; +} diff --git a/home/system/hyprland/default.nix b/home/system/hyprland/default.nix index 86f5f2f..394c373 100644 --- a/home/system/hyprland/default.nix +++ b/home/system/hyprland/default.nix @@ -1,13 +1,12 @@ { pkgs, config, inputs, ... }: { - imports = [ ./hyprlock.nix ./hypridle.nix ./hyprpaper.nix ./hyprpanel.nix ]; + imports = [ ./animations.nix ./bindings.nix ]; home.packages = with pkgs; [ qt5.qtwayland qt6.qtwayland qt5ct qt6ct - hyprshot hyprpicker swappy @@ -35,12 +34,7 @@ "$mod" = "SUPER"; "$shiftMod" = "SUPER_SHIFT"; - exec-once = [ - "${pkgs.bitwarden}/bin/bitwarden" - "[[ ${ - toString config.var.sops - } == 1 ]] && systemctl --user start sops-nix" - ]; + exec-once = [ "${pkgs.bitwarden}/bin/bitwarden" ]; monitor = [ "eDP-2,highres,0x0,1" @@ -48,60 +42,6 @@ ",prefered,auto,1" ]; - bind = [ - "$mod, RETURN, exec, ${pkgs.kitty}/bin/kitty" # Kitty - "$mod, E, exec, ${pkgs.xfce.thunar}/bin/thunar" # Thunar - "$mod, B, exec, ${pkgs.qutebrowser}/bin/qutebrowser" # Qutebrowser - "$mod, K, exec, ${pkgs.bitwarden}/bin/bitwarden" # Bitwarden - "$mod, L, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock - "$mod, X, exec, powermenu" # Powermenu - "$mod, SPACE, exec, menu" # Launcher - "$shiftMod, SPACE, exec, hyprfocus-toggle" # Toggle HyprFocus - - "$mod, Q, killactive," # Close window - "$mod, T, togglefloating," # Toggle Floating - "$mod, F, fullscreen" # Toggle Fullscreen - "$mod, left, movefocus, l" # Move focus left - "$mod, right, movefocus, r" # Move focus Right - "$mod, up, movefocus, u" # Move focus Up - "$mod, down, movefocus, d" # Move focus Down - "$shiftMod, left, layoutmsg, addmaster" # Add to master - "$shiftMod, right, layoutmsg, removemaster" # Remove from master - - "$mod, PRINT, exec, screenshot window" # Screenshot window - ", PRINT, exec, screenshot monitor" # Screenshot monitor - "$shiftMod, PRINT, exec, screenshot region" # Screenshot region - "ALT, PRINT, exec, screenshot region swappy" # Screenshot region then edit - - "$shiftMod, S, exec, ${pkgs.qutebrowser}/bin/qutebrowser :open $(wofi --show dmenu -L 1 -p ' Search on internet')" # Search on internet with wofi - "$shiftMod, C, exec, clipboard" # Clipboard picker with wofi - "$shiftMod, E, exec, ${pkgs.wofi-emoji}/bin/wofi-emoji" # Emoji picker with wofi - "$mod, F2, exec, night-shift-off" # Turn off night shift - "$mod, F3, exec, night-shift-on" # Turn on night shift - ] ++ (builtins.concatLists (builtins.genList (i: - let ws = i + 1; - in [ - "$mod, code:1${toString i}, workspace, ${toString ws}" - "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" - ]) 9)); - - bindm = [ - "$mod, mouse:272, movewindow" # Move Window (mouse) - "$mod, R, resizewindow" # Resize Window (mouse) - ]; - - bindl = [ - ",XF86AudioMute, exec, sound-toggle" # Toggle Mute - ",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock when closing Lid - ]; - - bindle = [ - ", XF86AudioRaiseVolume, exec, sound-up" # Sound Up - ", XF86AudioLowerVolume, exec, sound-down" # Sound Down - ", XF86MonBrightnessUp, exec, brightness-up" # Brightness Up - ", XF86MonBrightnessDown, exec, brightness-down" # Brightness Down - ]; - env = [ "XDG_SESSION_TYPE,wayland" "XDG_CURRENT_DESKTOP,Hyprland" @@ -191,68 +131,8 @@ }; }; - windowrulev2 = [ - "float, class:floating" - "size 40% 40%, class:floating" - "move 30% 30%, class:floating" - - "float, title:Bluetooth Devices" - "move 20% 20%, title:Bluetooth Devices" - "size 60% 60%, title:Bluetooth Devices" - ]; - - animations = let - animationSpeed = config.var.theme.animation-speed; - - animationDuration = if animationSpeed == "slow" then - "4" - else if animationSpeed == "medium" then - "2.5" - else - "1.5"; - borderDuration = if animationSpeed == "slow" then - "10" - else if animationSpeed == "medium" then - "6" - else - "3"; - in { - enabled = true; - bezier = [ - "linear, 0, 0, 1, 1" - "md3_standard, 0.2, 0, 0, 1" - "md3_decel, 0.05, 0.7, 0.1, 1" - "md3_accel, 0.3, 0, 0.8, 0.15" - "overshot, 0.05, 0.9, 0.1, 1.1" - "crazyshot, 0.1, 1.5, 0.76, 0.92" - "hyprnostretch, 0.05, 0.9, 0.1, 1.0" - "menu_decel, 0.1, 1, 0, 1" - "menu_accel, 0.38, 0.04, 1, 0.07" - "easeInOutCirc, 0.85, 0, 0.15, 1" - "easeOutCirc, 0, 0.55, 0.45, 1" - "easeOutExpo, 0.16, 1, 0.3, 1" - "softAcDecel, 0.26, 0.26, 0.15, 1" - "md2, 0.4, 0, 0.2, 1" - ]; - - animation = [ - "windows, 1, ${animationDuration}, md3_decel, popin 60%" - "windowsIn, 1, ${animationDuration}, md3_decel, popin 60%" - "windowsOut, 1, ${animationDuration}, md3_accel, popin 60%" - "border, 1, ${borderDuration}, default" - "fade, 1, ${animationDuration}, md3_decel" - "layersIn, 1, ${animationDuration}, menu_decel, slide" - "layersOut, 1, ${animationDuration}, menu_accel" - "fadeLayersIn, 1, ${animationDuration}, menu_decel" - "fadeLayersOut, 1, ${animationDuration}, menu_accel" - "workspaces, 1, ${animationDuration}, menu_decel, slide" - "specialWorkspace, 1, ${animationDuration}, md3_decel, slidevert" - ]; - }; - }; }; systemd.user.targets.hyprland-session.Unit.Wants = [ "xdg-desktop-autostart.target" ]; - } diff --git a/home/system/hyprland/hyprlock.nix b/home/system/hyprlock/default.nix similarity index 97% rename from home/system/hyprland/hyprlock.nix rename to home/system/hyprlock/default.nix index 6bb410f..abe1a0a 100644 --- a/home/system/hyprland/hyprlock.nix +++ b/home/system/hyprlock/default.nix @@ -74,7 +74,7 @@ in { font_color = foreground; fade_on_empty = false; font_family = config.stylix.fonts.serif.name + " Bold"; - placeholder_text = "🔒 Enter Pass"; + placeholder_text = "🔒 Enter Password"; hide_input = false; position = "0, -250"; halign = "center"; diff --git a/home/system/hyprland/hyprpanel.nix b/home/system/hyprpanel/default.nix similarity index 100% rename from home/system/hyprland/hyprpanel.nix rename to home/system/hyprpanel/default.nix diff --git a/home/system/hyprland/hyprpaper.nix b/home/system/hyprpaper/default.nix similarity index 100% rename from home/system/hyprland/hyprpaper.nix rename to home/system/hyprpaper/default.nix diff --git a/home/system/wofi/default.nix b/home/system/wofi/default.nix index 0a027ea..b13a4d5 100644 --- a/home/system/wofi/default.nix +++ b/home/system/wofi/default.nix @@ -55,6 +55,7 @@ #input { background-color: #${config.lib.stylix.colors.base00}; border: 0px solid #${config.lib.stylix.colors.base0D}; + color: #${config.lib.stylix.colors.base05}; padding: 8px 12px; } diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index ed6da87..35a3f72 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -18,6 +18,7 @@ ../../nixos/variables-config.nix ../../themes/nixy.nix + ./hardware-configuration.nix ./variables.nix ]; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index acdb136..d9e33fe 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -19,6 +19,10 @@ # System (Desktop environment like stuff) ../../home/system/hyprland + ../../home/system/hypridle + ../../home/system/hyprlock + ../../home/system/hyprpanel + ../../home/system/hyprpaper ../../home/system/gtk ../../home/system/wofi ../../home/system/batsignal diff --git a/hosts/laptop/secrets/default.nix b/hosts/laptop/secrets/default.nix index b5e918e..51f4ddf 100644 --- a/hosts/laptop/secrets/default.nix +++ b/hosts/laptop/secrets/default.nix @@ -15,4 +15,7 @@ systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ]; home.packages = with pkgs; [ sops age ]; + + wayland.windowManager.hyprland.settings.exec-once = + [ "systemctl --user start sops-nix" ]; } diff --git a/hosts/laptop/variables.nix b/hosts/laptop/variables.nix index 45889a5..e81b811 100644 --- a/hosts/laptop/variables.nix +++ b/hosts/laptop/variables.nix @@ -21,11 +21,6 @@ autoUpgrade = false; autoGarbageCollector = false; - # SOPS - # Sops is a tool to store secrets in git repositories encrypted with GPG. - # change the sops configuration if you want to enable that: - sops = true; - theme = { rounding = 15; gaps-in = 10;