From 05fc3fbcd95baf31fb8278d2f4395c9863b45054 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:42:15 +0100 Subject: [PATCH] Up --- README.md | 19 ++++++--- home/home.nix | 74 +++++++++++++++++++----------------- home/hyprland/default.nix | 44 +++++++++++++++++---- home/scripts/default.nix | 1 + home/scripts/night-shift.nix | 16 ++++++++ home/wlogout/default.nix | 3 -- hosts/tuigreet/default.nix | 9 ++--- 7 files changed, 111 insertions(+), 55 deletions(-) create mode 100644 home/scripts/night-shift.nix diff --git a/README.md b/README.md index d917d71..e1fb52f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,11 @@ This is my dotfiles repo. It's a work in progress, and I'm still learning how to # Apps +- WM: *Hyprland* + - hyprlock + - hyprpaper + - hypridle + - wlogout - File manager: - lf - thunar @@ -23,11 +28,6 @@ This is my dotfiles repo. It's a work in progress, and I'm still learning how to - Bar: waybar - Notifications: dunst - Launcher: wofi -- WM: Hyprland - - hyprlock - - hyprpaper - - hypridle - - wlogout - DM: Tuigreet # Themes & Colors @@ -65,6 +65,13 @@ Caffeine is a simple script that toggles hypridle (disable suspend & screenlock) - `caffeine` # Toggle caffeine - `caffeine-status` # Return active/inactive +## Night-Shift + +Blue light filter, using wlsunset + +- `night-shift-on` +- `night-shift-off` + # Installation ```sh @@ -83,3 +90,5 @@ sudo nixos-rebuild switch --flake ~/.config/nixos#nixy - [ ] Variable user & homeDir - [ ] Custom GTK based on the colorscheme +- [ ] Obsidian.nvim on every markdown file +- [ ] Nextcloud services (Only on my personnal network) diff --git a/home/home.nix b/home/home.nix index 322b0fc..52cd8aa 100644 --- a/home/home.nix +++ b/home/home.nix @@ -21,44 +21,48 @@ ./lf ]; - home.username = "hadi"; # CHANGEME - home.homeDirectory = "/home/hadi"; # CHANGEME + home = { + username = "hadi"; # CHANGEME + homeDirectory = "/home/hadi"; # CHANGEME - home.packages = with pkgs; [ - swappy - imv - bc - discord - obsidian - fd - btop - go - cargo - nodejs - python3 - unzip - blueman - gcc - peaclock - xdg_utils - tldr - qt5ct - libva - dconf - wget - ripgrep - xfce.thunar + packages = with pkgs; [ + swappy + imv + discord + obsidian + btop + xfce.thunar - # Just cool - cbonsai - pipes - cmatrix + # Dev + go + cargo + nodejs + python3 - # Backup - vscode - firefox - ]; + # Utils + fd + bc + gcc + blueman + unzip + xdg_utils + tldr + wget + curl + ripgrep - home.stateVersion = "23.11"; + # Just cool + peaclock + cbonsai + pipes + cmatrix + + # Backup + vscode + firefox + ]; + + stateVersion = "23.11"; + }; programs.home-manager.enable = true; } diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index cb7e141..af7ba21 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -14,6 +14,9 @@ xwayland xdg-desktop-portal-gtk wlroots + qt5ct + libva + dconf wayland-utils wayland-protocols meson @@ -56,6 +59,8 @@ "$mod, PRINT, exec, ${pkgs.hyprshot}/bin/hyprshot -m window -o ~/Pictures/screenshots" ", PRINT, exec, ${pkgs.hyprshot}/bin/hyprshot -m output -o ~/Pictures/screenshots" "$shiftMod, PRINT, exec, ${pkgs.hyprshot}/bin/hyprshot -m region -o ~/Pictures/screenshots" + "$mod, F2, exec, night-shift-off" + "$mod, F3, exec, night-shift-on" ] ++ (builtins.concatLists (builtins.genList (i: let ws = i + 1; in [ @@ -95,20 +100,21 @@ general = { resize_on_border = true; - gaps_in = 10; - gaps_out = 20; - border_size = 2; + gaps_in = config.theme.gaps-in; + gaps_out = config.theme.gaps-out; + border_size = config.theme.border-size; "col.active_border" = "rgba(${config.theme.colors.primary-bg}ff)"; - "col.inactive_border" = "rgba(${config.theme.colors.color0}96)"; + "col.inactive_border" = "rgba(00000055)"; + border_part_of_window = true; layout = "master"; }; decoration = { rounding = config.theme.rounding; drop_shadow = true; - shadow_range = 15; - shadow_render_power = 4; - "col.shadow" = "rgba(${config.theme.colors.color0}96)"; + shadow_range = 20; + shadow_render_power = 3; + "col.shadow" = "rgba(00000055)"; blur = { enabled = false; }; }; @@ -151,6 +157,30 @@ "size 60% 60%, title:Bluetooth Devices" ]; + animations = { + enabled = true; + bezier = [ + "fluent_decel, 0, 0.2, 0.4, 1" + "easeOutCirc, 0, 0.55, 0.45, 1" + "easeOutCubic, 0.33, 1, 0.68, 1" + "easeinoutsine, 0.37, 0, 0.63, 1" + ]; + + animation = [ + "windowsIn, 1, 3, easeOutCubic, popin 30% # window open" + "windowsOut, 1, 3, fluent_decel, popin 70% # window close." + "windowsMove, 1, 2, easeinoutsine, slide # everything in between, moving, dragging, resizing." + "fadeIn, 1, 3, easeOutCubic # fade in (open) -> layers and windows" + "fadeOut, 1, 2, easeOutCubic # fade out (close) -> layers and windows" + "fadeSwitch, 0, 1, easeOutCirc # fade on changing activewindow and its opacity" + "fadeShadow, 1, 10, easeOutCirc # fade on changing activewindow for shadows" + "fadeDim, 1, 4, fluent_decel # the easing of the dimming of inactive windows" + "border, 1, 2.7, easeOutCirc # for animating the border's color switch speed" + "borderangle, 1, 30, fluent_decel, once # for animating the border's gradient angle - styles: once (default), loop" + "workspaces, 1, 4, easeOutCubic, fade # styles: slide, slidevert, fade, slidefade, slidefadevert" + ]; + }; + }; }; diff --git a/home/scripts/default.nix b/home/scripts/default.nix index 2a6b33a..92feec1 100644 --- a/home/scripts/default.nix +++ b/home/scripts/default.nix @@ -6,5 +6,6 @@ ./sounds.nix ./brightness.nix ./caffeine.nix + ./night-shift.nix ]; } diff --git a/home/scripts/night-shift.nix b/home/scripts/night-shift.nix new file mode 100644 index 0000000..9bb24da --- /dev/null +++ b/home/scripts/night-shift.nix @@ -0,0 +1,16 @@ +{ pkgs, config, ... }: + +let + homedir = config.home.homeDirectory; + default = "4000"; + + night-shift-on = pkgs.writeShellScriptBin "night-shift-on" '' + ${pkgs.hyprland}/bin/hyprctl dispatch exec "${pkgs.wlsunset}/bin/wlsunset -t ${default}" + ${pkgs.libnotify}/bin/notify-send "󰖔 Night Shift Activated" + ''; + night-shift-off = pkgs.writeShellScriptBin "night-shift-off" '' + pkill wlsunset + ${pkgs.libnotify}/bin/notify-send " Night Shift Deactivated" + ''; + +in { home.packages = with pkgs; [ night-shift-on night-shift-off ]; } diff --git a/home/wlogout/default.nix b/home/wlogout/default.nix index 21653ac..ffe7a6c 100644 --- a/home/wlogout/default.nix +++ b/home/wlogout/default.nix @@ -62,9 +62,6 @@ border-style: solid; background-color: #${config.theme.colors.bg}; - border: ${ - toString config.theme.border-size - }px solid #${config.theme.colors.fg}; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); } diff --git a/hosts/tuigreet/default.nix b/hosts/tuigreet/default.nix index 55688f4..c9ffba9 100644 --- a/hosts/tuigreet/default.nix +++ b/hosts/tuigreet/default.nix @@ -1,17 +1,16 @@ -{pkgs, ...}: { +{ pkgs, ... }: { services.greetd = { enable = true; settings = { default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland"; + command = + "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --asterisks --container-padding 2 --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland"; user = "greeter"; }; }; }; - environment.systemPackages = with pkgs; [ - greetd.tuigreet - ]; + environment.systemPackages = with pkgs; [ greetd.tuigreet ]; # this is a life saver. # literally no documentation about this anywhere.