diff --git a/bin/skyg b/bin/skyg index bf5011c..4377027 100755 --- a/bin/skyg +++ b/bin/skyg @@ -46,7 +46,7 @@ function run-switch() { fi fi - sudo nixos-rebuild switch --flake . + sudo nixos-rebuild switch --flake . --show-trace --print-build-logs --verbose unlock } diff --git a/configs/hypr/hypridle.conf b/configs/hypr/hypridle.conf index 7e373b0..e8cdd89 100644 --- a/configs/hypr/hypridle.conf +++ b/configs/hypr/hypridle.conf @@ -19,8 +19,8 @@ listener { listener { timeout = 295 - on-timeout = hyprctl notify 0 5000 'rgb(ff0000)' 'Locking..' - on-resume = hyprctl notify 0 5000 'rgb(ff0000)' 'Stopping lock process..' + on-timeout = notify-send 'Locking..' + on-resume = notify-send 'Stopping lock process..' } listener { @@ -28,13 +28,13 @@ listener { on-timeout = loginctl lock-session # lock screen when timeout has passed } -listener { - timeout = 380 # 5.5min - 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. -} +#listener { +# timeout = 380 # 5.5min +# 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. +#} listener { - timeout = 1800 # 30min + timeout = 380 # 5.5min on-timeout = systemctl suspend # suspend pc } diff --git a/configs/niri-config.kdl b/configs/niri-config.kdl deleted file mode 100644 index 96a5408..0000000 --- a/configs/niri-config.kdl +++ /dev/null @@ -1,202 +0,0 @@ -// https://github.com/YaLTeR/niri/wiki/Configuration:-Input -input { - touchpad { - tap - natural-scroll - } -} -spawn-at-startup "hypridle" -spawn-at-startup "xwayland-satellite" -spawn-at-startup "ghostty" -spawn-at-startup "mako" -spawn-at-startup "nm-applet --indicator" -spawn-at-startup "waybar" -spawn-at-startup "waybar -c /home/ari/.config/waybar/bottom-config.jsonc" - -environment { - QT_QPA_PLATFORM "wayland" - QT_WAYLAND_DISABLE_WINDOWDECORATION "1" - NIXOS_OZONE_WL "1" - DISPLAY ":0" - ELECTRON_OZONE_PLATFORM_HINT "auto" -} - - -// ========================= -// Outputs -// ========================= -output "BOE 0x0BCA Unknown" { - mode "2256x1504@60" - scale 1 - transform "normal" - position x=0 y=0 -} -// Portable Azopa -output "PNP(GWD) ARZOPA \\x15\\xd9F\\x1675US0000" { - mode "1920x1080@60" - scale 1 - transform "normal" - position x=-1920 y=0 -} -// Two Screens in Office -output "Samsung Electric Company S22R35x H4TR604392" { - mode "1920x1080@74.973" - scale 1 - transform "normal" - position x=-960 y=-1080 -} - -output "Samsung Electric Company S22R35x H4TR503886" { - mode "1920x1080@74.973" - scale 1 - transform "normal" - position x=980 y=-1080 -} - -// Office -output "Dell Inc. DELL SE3223Q 1WDWKK3" { - scale 2 - position x=0 y=-1080 -} - -// ========================= -// General layout -// ========================= -layout { - gaps 8 - center-focused-column "never" - tab-indicator - preset-column-widths { - proportion 0.33333 - proportion 0.5 - proportion 0.66667 - } - default-column-width { proportion 0.5; } - focus-ring { - width 4 - active-color "#7fc8ff" - inactive-color "#505050" - } -} - -// ========================= -// Screen Shots -// ========================= -screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" - -// ========================= -// Window Rules -// ========================= -// Open the Firefox picture-in-picture player as floating by default. -window-rule { - match app-id=r#"firefox$"# title="^Picture-in-Picture$" - match app-id="org.pulseaudio.pavucontrol" - match app-id="Rofi" - match app-id="nm-connection-editor" - match app-id=".blueman-manager-wrapped" - match app-id=r#"^org.gnome.Calendar$"# - match app-id=r#"^gcr-prompter$"# - match app-id=r#"^xdg-desktop-portal-gnome$"# - match app-id=r#"^nm-applet$"# - match app-id=r#"^chrome-.*"# - match title="$Huddle:.*" app-id="Slack" - match title="Visual Studio Code" app-id="code" - - open-focused true - open-floating true - default-floating-position x=0 y=25 relative-to="top" - default-window-height { proportion 0.5; } - default-column-width { proportion 0.25; } -} -window-rule { - match is-active=false - opacity 0.85 -} -window-rule { - match app-id=r#"^Slack$"# - match app-id="code" - exclude app-id=r#"^code$"# title=r#"^Visual Studio Code$"# - open-fullscreen false - open-floating false - open-maximized true - open-focused true -} -// ========================= -// General Stuff -// ========================= -switch-events { - lid-close { spawn "notify-send" "The laptop lid is closed!"; } - lid-open { spawn "notify-send" "The laptop lid is open!"; } -} -hotkey-overlay { - skip-at-startup -} - -// ========================= -// General binds -// ========================= -binds { - Mod+Shift+H { show-hotkey-overlay; } - Mod+T { spawn "ghostty"; } - Mod+Space { spawn "fuzzel"; } - Mod+B { spawn "chromium" "--profile-directory=ProfilePersonal"; } - Mod+Alt+B { spawn "chromium" "--profile-directory=ProfileWork"; } - Mod+E { spawn "wofi-emoji"; } - XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } - XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } - XF86MonBrightnessUp { spawn "brightnessctl" "set" "10%+"; } - XF86MonBrightnessDown { spawn "brightnessctl" "set" "10%-"; } - Mod+Alt+L { spawn "/run/current-system/sw/bin/makoctl" "dismiss" "-a"; } - - Mod+Left { focus-column-left; } - Mod+Down { focus-workspace-down; } - Mod+Up { focus-workspace-up; } - Mod+Right { focus-column-right; } - - Mod+Shift+Tab { focus-monitor-next; } - - Mod+Ctrl+Right { swap-window-right; } - Mod+Ctrl+Left { swap-window-left; } - Mod+Ctrl+Up { move-window-to-workspace-up; } - Mod+Ctrl+Down { move-window-to-workspace-down; } - - Mod+W { toggle-column-tabbed-display; } - Mod+F { maximize-column; } - Mod+Shift+F { fullscreen-window; } - Mod+Ctrl+F { reset-window-height; } - Mod+V { toggle-window-floating; } - - Mod+C { center-column; } - - Mod+Minus { set-column-width "-10%"; } - Mod+Equal { set-column-width "+10%"; } - - Mod+Shift+Minus { set-window-height "-10%"; } - Mod+Shift+Equal { set-window-height "+10%"; } - - Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } - - Print { screenshot; } - Mod+P { screenshot; } - - Ctrl+Alt+Delete { quit; } - Mod+Q { close-window; } - - Mod+Ctrl+W { spawn "waybar"; } - Mod+Ctrl+B { spawn "waybar" "-c" "/home/ari/.config/waybar/bottom-config.jsonc"; } -} - - -/// Com Apps -workspace "chat" { - open-on-output "eDP-1" -} -spawn-at-startup "slack" -window-rule { - match app-id=r#"^Slack$"# - match app-id=r#"^signal$"# - open-on-workspace "chat" - open-focused true -} diff --git a/configs/niri/config.kdl b/configs/niri/config.kdl index 96a5408..bbb5a3d 100644 --- a/configs/niri/config.kdl +++ b/configs/niri/config.kdl @@ -5,13 +5,8 @@ input { natural-scroll } } -spawn-at-startup "hypridle" -spawn-at-startup "xwayland-satellite" -spawn-at-startup "ghostty" -spawn-at-startup "mako" -spawn-at-startup "nm-applet --indicator" -spawn-at-startup "waybar" -spawn-at-startup "waybar -c /home/ari/.config/waybar/bottom-config.jsonc" + +spawn-at-startup "/home/ari/.config/niri/startup.sh" environment { QT_QPA_PLATFORM "wayland" @@ -34,26 +29,26 @@ output "BOE 0x0BCA Unknown" { // Portable Azopa output "PNP(GWD) ARZOPA \\x15\\xd9F\\x1675US0000" { mode "1920x1080@60" - scale 1 + scale 1 transform "normal" position x=-1920 y=0 } // Two Screens in Office output "Samsung Electric Company S22R35x H4TR604392" { mode "1920x1080@74.973" - scale 1 + scale 1 transform "normal" position x=-960 y=-1080 } output "Samsung Electric Company S22R35x H4TR503886" { mode "1920x1080@74.973" - scale 1 + scale 1 transform "normal" position x=980 y=-1080 } -// Office +// Office output "Dell Inc. DELL SE3223Q 1WDWKK3" { scale 2 position x=0 y=-1080 @@ -114,7 +109,7 @@ window-rule { } window-rule { match app-id=r#"^Slack$"# - match app-id="code" + match app-id="code" exclude app-id=r#"^code$"# title=r#"^Visual Studio Code$"# open-fullscreen false open-floating false @@ -122,9 +117,9 @@ window-rule { open-focused true } // ========================= -// General Stuff +// General Stuff // ========================= -switch-events { +switch-events { lid-close { spawn "notify-send" "The laptop lid is closed!"; } lid-open { spawn "notify-send" "The laptop lid is open!"; } } @@ -167,7 +162,7 @@ binds { Mod+Shift+F { fullscreen-window; } Mod+Ctrl+F { reset-window-height; } Mod+V { toggle-window-floating; } - + Mod+C { center-column; } Mod+Minus { set-column-width "-10%"; } @@ -177,10 +172,11 @@ binds { Mod+Shift+Equal { set-window-height "+10%"; } Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } - - Print { screenshot; } - Mod+P { screenshot; } - + + Print { spawn "grim" "-g" "\"$(slurp)\"" "-" "|" "satty" "-f" "-"; } + Mod+P { spawn "grim" "-g" "\"$(slurp)\"" "-" "|" "satty" "-f" "-"; } + Mod+R { spawn "/home/ari/.config/niri/screen-record.sh"; } + Ctrl+Alt+Delete { quit; } Mod+Q { close-window; } diff --git a/configs/niri/screen-record.sh b/configs/niri/screen-record.sh new file mode 100755 index 0000000..05a06c4 --- /dev/null +++ b/configs/niri/screen-record.sh @@ -0,0 +1,32 @@ +#!/bin/sh +set -e + +_SCREEN_RECORD_DIR="$HOME/Videos/ScreenRecordings" +mkdir -p "$_SCREEN_RECORD_DIR" + + +if pgrep -x "wf-recorder" > /dev/null; then + last_cmd=$(pgrep -x "wf-recorder" -a) + filepath="${last_cmd##* -f }" + filepath="${filepath%% *}" + pgrep -x "wf-recorder" && pkill -INT -x wf-recorder + notify-send -h string:wf-recorder:record -t 5000 "Finished Recording. Saved at $filepath." + echo $filepath | xclip -selection clipboard + exit 0 +fi + +dims=$(slurp) +notify-send -h string:wf-recorder:record -t 1000 "Recording in:" "3" + +sleep 1 + +notify-send -h string:wf-recorder:record -t 1000 "Recording in:" "2" + +sleep 1 + +notify-send -h string:wf-recorder:record -t 950 "Recording in:" "1" + +sleep 1 + +dateTime=$(date +%Y-%m-%d-%H_%M_%S) +wf-recorder --bframes max_b_frames -g "${dims}" -f $_SCREEN_RECORD_DIR/$dateTime.mp4 \ No newline at end of file diff --git a/configs/niri/startup.sh b/configs/niri/startup.sh new file mode 100755 index 0000000..d9a99fc --- /dev/null +++ b/configs/niri/startup.sh @@ -0,0 +1,10 @@ +#!/bin/sh +_CONFIG_DIR="$HOME/.config/niri" + +hypridle & +xwayland-satellite & +mako & +nm-applet --indicator & +waybar -c $_CONFIG_DIR/waybar/top-config.jsonc -s $_CONFIG_DIR/waybar/style.css & +waybar -c $_CONFIG_DIR/waybar/bottom-config.jsonc -s $_CONFIG_DIR/waybar/style.css & +flatpak run dev.deedles.Trayscale --hide-window & \ No newline at end of file diff --git a/configs/waybar/bottom-config.jsonc b/configs/niri/waybar/bottom-config.jsonc similarity index 100% rename from configs/waybar/bottom-config.jsonc rename to configs/niri/waybar/bottom-config.jsonc diff --git a/configs/waybar/style.css b/configs/niri/waybar/style.css similarity index 100% rename from configs/waybar/style.css rename to configs/niri/waybar/style.css diff --git a/configs/waybar/config.jsonc b/configs/niri/waybar/top-config.jsonc similarity index 100% rename from configs/waybar/config.jsonc rename to configs/niri/waybar/top-config.jsonc diff --git a/modules/nixos/desktop/niri.nix b/modules/nixos/desktop/niri.nix index 9fa2a95..5be431e 100644 --- a/modules/nixos/desktop/niri.nix +++ b/modules/nixos/desktop/niri.nix @@ -18,8 +18,8 @@ in hypridle ]; system.userActivationScripts.niriConfig.text = skygUtils.makeHyperlinkScriptToConfigs { - filePath = "niri.kdl"; - configSource = "/home/${config.skyg.user.name}/nixos-setup/configs/niri"; + filePath = "niri"; + configSource = "/home/${config.skyg.user.name}/nixos-setup/configs"; }; }; } diff --git a/modules/nixos/desktop/tiler.nix b/modules/nixos/desktop/tiler.nix index cd9f06b..caa4ba7 100644 --- a/modules/nixos/desktop/tiler.nix +++ b/modules/nixos/desktop/tiler.nix @@ -18,19 +18,28 @@ in # services.blueman.enable = true; # programs.nm-applet.enable = true; environment.systemPackages = with pkgs; [ - mako - brightnessctl - libnotify - fuzzel - waybar - pavucontrol + # Protocols and libraries xwayland-satellite + libnotify + # Notifications + mako wofi rofi rofi-wayland + # Control Tools + pavucontrol + brightnessctl networkmanagerapplet blueman + # Apps + fuzzel + waybar nwg-bar + # Screen capture and recording tools + grim + slurp + satty + wf-recorder ]; }; } diff --git a/modules/skyg-utils.nix b/modules/skyg-utils.nix index d14652f..09db6b2 100644 --- a/modules/skyg-utils.nix +++ b/modules/skyg-utils.nix @@ -10,7 +10,10 @@ '' rm -f "${homePath}" if [[ ! -h "$HOME/.config/${filePath}" ]]; then - ln -s "${sourcePath}" "${homePath}" + ln -s "${sourcePath}" "${homePath}" || { + echo "Failed to create symlink for ${filePath} at ${homePath}" + exit 1 + } fi ''; }