diff --git a/hosts/default.nix b/hosts/default.nix index 37b4e3b2..0b3b6ec6 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -53,7 +53,7 @@ in work = lib.nixosSystem { # Work Profile inherit system; specialArgs = { - inherit inputs system unstable hyprland vars; + inherit inputs system unstable hyprland hyprlock hypridle vars; host = { hostName = "work"; mainMonitor = "eDP-1"; @@ -76,7 +76,7 @@ in xps = lib.nixosSystem { # Work Profile inherit system; specialArgs = { - inherit inputs system unstable hyprland vars; + inherit inputs system unstable hyprland hyprlock hypridle vars; host = { hostName = "xps"; mainMonitor = "eDP-1"; @@ -121,7 +121,7 @@ in h310m = lib.nixosSystem { # DEPRECATED Desktop Profile inherit system; specialArgs = { - inherit inputs system unstable hyprland vars; + inherit inputs system unstable hyprland hyprlock hypridle vars; host = { hostName = "h310m"; mainMonitor = "HDMI-A-1"; diff --git a/modules/desktops/hyprland.nix b/modules/desktops/hyprland.nix index 4bd29dc5..bcd53831 100644 --- a/modules/desktops/hyprland.nix +++ b/modules/desktops/hyprland.nix @@ -191,14 +191,15 @@ with host; settings = { general = { border_size = 2; - gaps_in = 0; - gaps_out = 0; + gaps_in = 3; + gaps_out = 6; "col.active_border" = "0x99${active}"; "col.inactive_border" = "0x66${inactive}"; + resize_on_border = true; layout = "dwindle"; }; decoration = { - rounding = 0; + rounding = 6; active_opacity = 1; inactive_opacity = 1; fullscreen_opacity = 1; @@ -274,7 +275,7 @@ with host; tap-to-click = true; } else {}; }; - guestures = if hostName == "work"|| hostName == "xps" || hostName == "probook" then { + gestures = if hostName == "work"|| hostName == "xps" || hostName == "probook" then { workspace_swipe = true; workspace_swipe_fingers = 3; workspace_swipe_distance = 100; diff --git a/modules/programs/flatpak.nix b/modules/programs/flatpak.nix index ba178a8c..9aed17b8 100644 --- a/modules/programs/flatpak.nix +++ b/modules/programs/flatpak.nix @@ -25,6 +25,7 @@ with lib; config = mkIf (config.flatpak.enable) { xdg.portal.enable = true; + xdg.portal.config.common.default = "*"; xdg.portal.extraPortals = mkIf (config.wlwm.enable || config.x11wm.enable) [ pkgs.xdg-desktop-portal-gtk ]; diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index 6c8de502..7f289557 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -19,7 +19,7 @@ let ] else [ mainMonitor ]; - modules-left = with config.programs; + modules-left = with config; if hyprland.enable == true then [ "custom/menu" "hyprland/workspaces" ] else if sway.enable == true then [ @@ -66,7 +66,7 @@ in background-color: rgba(${rgb.active},0.4); } window#waybar { - background-color: #${hex.bg}; + background-color: rgba(0, 0, 0 , 0.5); transition-property: background-color; transition-duration: .5s; border-bottom: 1px solid rgba(${rgb.active}, 0.99); @@ -113,7 +113,7 @@ in /*#workspaces button.focused {*/ #workspaces button.active { color: rgba(${rgb.fg},1); - background-color: rgba(${rgb.active}, 0.99); + background-color: rgba(${rgb.active}, 0.8); } #workspaces button.hidden { color: #${hex.text}; @@ -235,7 +235,7 @@ in backlight = { device = "intel_backlight"; format= "{percent}% {icon}"; - format-icons = ["" ""]; + format-icons = ["" "󰖙"]; on-scroll-down = "${pkgs.light}/bin/light -U 5"; on-scroll-up = "${pkgs.light}/bin/light -A 5"; }; diff --git a/modules/services/swaync.nix b/modules/services/swaync.nix index 6c30dc16..5f9fa9eb 100644 --- a/modules/services/swaync.nix +++ b/modules/services/swaync.nix @@ -166,7 +166,7 @@ in } .close-button { - background: #${hex.red}; + background: #${hex.active}; color: @cc-bg; text-shadow: none; padding: 0; @@ -316,7 +316,7 @@ in } .widget-title>button:hover { - background: #${hex.red}; + background: #${hex.active}; color: @cc-bg; } @@ -335,8 +335,8 @@ in } .widget-dnd>switch:checked { - background: #${hex.red}; - border: 1px solid #${hex.red}; + background: #${hex.active}; + border: 1px solid #${hex.active}; } .widget-dnd>switch slider { @@ -444,12 +444,19 @@ in color: @text-color; } - trough { - background: #${hex.fg}; + scale trough highlight{ + background: #${hex.active}; } - highlight{ - background: #${hex.active}; + scale trough slider { + background: @text-color; + min-width: 2px; + min-height: 2px; + margin: -5px; + } + + scale trough { + min-height: 2px; } ''; }; diff --git a/modules/theming/colors.nix b/modules/theming/colors.nix index c1e05839..dc70c9e5 100644 --- a/modules/theming/colors.nix +++ b/modules/theming/colors.nix @@ -5,6 +5,48 @@ { scheme = { default = { + scheme = "One Dark Pro"; + hex = { + bg = "111111"; + fg = "f7f7f7"; + red = "e06c75"; + orange = "d19a66"; + yellow = "e5c07b"; + green = "98c379"; + cyan = "56b6c2"; + blue = "61afef"; + purple = "c678dd"; + white = "abb2bf"; + black = "282c34"; + gray = "5c6370"; + highlight = "e2be7d"; + comment = "7f848e"; + active = "f7870a"; + inactive = "013864"; + text = "999999"; + }; + rgb = { + bg = "17, 17, 17"; + fg = "247, 247, 247"; + red = "224, 108, 118"; + orange = "209, 154, 102"; + yellow = "229, 192, 123"; + green = "152, 195, 121"; + cyan = "86, 181, 194"; + blue = "97, 175, 223"; + purple = "197, 120, 221"; + white = "171, 178, 191"; + black = "40, 44, 52"; + gray = "92, 99, 112"; + highlight = "226, 191, 125"; + comment = "127, 132, 142"; + active = "247, 135, 10"; + inactive = "1, 56, 100"; + text = "153, 153, 153"; + }; + }; + + onedark = { scheme = "One Dark Pro"; hex = { bg = "111111"; # 283c34 diff --git a/rsc/archive/hyprland.nix b/rsc/archive/dwm/hyprland.nix similarity index 100% rename from rsc/archive/hyprland.nix rename to rsc/archive/dwm/hyprland.nix diff --git a/rsc/archive/dwm/waybar.nix b/rsc/archive/dwm/waybar.nix new file mode 100644 index 00000000..d6d2781f --- /dev/null +++ b/rsc/archive/dwm/waybar.nix @@ -0,0 +1,443 @@ +# +# Bar +# + +{ config, lib, pkgs, vars, host, ...}: +let + colors = import ../theming/colors.nix; +in +with host; +let + output = + if hostName == "beelink" || hostName == "xps" || hostName == "h310m" then [ + mainMonitor + secondMonitor + ] else if hostName == "work" then [ + mainMonitor + secondMonitor + thirdMonitor + ] else [ + mainMonitor + ]; + modules-left = with config; + if hyprland.enable == true then [ + "custom/menu" "hyprland/workspaces" + ] else if sway.enable == true then [ + "sway/workspaces" "sway/window" "sway/mode" + ] else []; + + modules-right = + if hostName == "beelink" || hostName == "h310m" then [ + "custom/ds4" "custom/mouse" "custom/kb" "custom/pad" "network" "cpu" "memory" "custom/pad" "pulseaudio" "custom/sink" "custom/pad" "clock" "tray" "custom/notification" + ] else [ + "cpu" "memory" "custom/pad" "battery" "custom/pad" "backlight" "custom/pad" "pulseaudio" "custom/sink" "custom/pad" "clock" "tray" "custom/notification" + ]; + + sinkBuiltIn="Built-in Audio Analog Stereo"; + sinkVideocard=''Ellesmere HDMI Audio \[Radeon RX 470\/480 \/ 570\/580\/590\] Digital Stereo \(HDMI 3\)''; + sinkBluetooth="S10 Bluetooth Speaker"; + headset=sinkBuiltIn; + speaker=sinkBluetooth; +in +{ + config = lib.mkIf (config.wlwm.enable) { + environment.systemPackages = with pkgs; [ + waybar + ]; + + home-manager.users.${vars.user} = with colors.scheme.default; { + programs.waybar = { + enable = true; + package = pkgs.waybar; + systemd ={ + enable = true; + target = "sway-session.target"; + }; + + style = '' + * { + border: none; + border-radius: 0; + font-family: FiraCode Nerd Font Mono; + font-size: 12px; + text-shadow: 0px 0px 5px #000000; + } + button:hover { + background-color: rgba(${rgb.active},0.4); + } + window#waybar { + background-color: #${hex.bg}; + transition-property: background-color; + transition-duration: .5s; + border-bottom: 1px solid rgba(${rgb.active}, 0.99); + } + window#waybar.hidden { + opacity: 0.2; + } + #workspace, + #mode, + #clock, + #pulseaudio, + #custom-sink, + #network, + #mpd, + #memory, + #network, + #window, + #cpu, + #disk, + #backlight, + #battery, + #custom-mouse, + #custom-kb, + #custom-ds4, + #tray { + color: #${hex.text}; + background-clip: padding-box; + } + #custom-menu, #custom-notification { + color: rgba(255, 255, 255, 0.9); + padding: 0px 5px 0px 5px; + } + #workspaces button { + padding: 0px 7px; + min-width: 5px; + color: rgba(${rgb.text},1); + } + #workspaces button:hover { + background-color: rgba(0,0,0,0.2); + } + #workspaces button.visible { + background-color: rgba(${rgb.active}, 0.3); + } + /*#workspaces button.focused {*/ + #workspaces button.active { + color: rgba(${rgb.fg},1); + background-color: rgba(${rgb.active}, 0.99); + } + #workspaces button.hidden { + color: #${hex.text}; + } + #battery.warning { + color: #ff5d17; + background-color: rgba(0,0,0,0); + } + #battery.critical { + color: #ff200c; + background-color: rgba(0,0,0,0); + } + #battery.charging { + color: #9ece6a; + background-color: rgba(0,0,0,0); + } + ''; + settings = { + Main = { + layer = if config.hyprland.enable then "top" else "bottom"; + position = "top"; + height = 27; + output = output; + + tray = { spacing = 5; }; + modules-left = modules-left; + modules-right = modules-right; + + "custom/pad" = { + format = " "; + tooltip = false; + }; + "custom/menu" = { + format = ""; + # on-click = ''${pkgs.eww-wayland}/bin/eww open --toggle menu --screen 0''; + on-click = ''sleep 0.1; .config/wofi/power.sh''; + on-click-right = "sleep 0.1; ${pkgs.wofi}/bin/wofi --show drun"; + tooltip = false; + }; + "custom/notification" = { + 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 = "sleep 0.1; swaync-client -t -sw"; + on-click-right = "sleep 0.1; swaync-client -d -sw"; + escape = true; + }; + "sway/workspaces" = { + format = "{icon}"; + format-icons = { + # "1"=""; + # "2"=""; + # "3"=""; + # "4"=""; + # "5"=""; + "1"="1"; + "2"="2"; + "3"="3"; + "4"="4"; + "5"="5"; + "6"="6"; + "7"="7"; + "8"="8"; + }; + all-outputs = true; + persistent_workspaces = { + # "1" = []; + # "2" = []; + # "3" = []; + # "4" = []; + # "5" = []; + "1" = []; + "2" = []; + "3" = []; + "4" = []; + "5" = []; + "6" = []; + "7" = []; + "8" = []; + }; + }; + "wlr/workspaces" = { + format = "{name}"; + active-only = false; + on-click = "activate"; + }; + "hyprland/workspaces" = { + format = "{name}"; + }; + clock = { + format = "{:%b %d %H:%M} "; + on-click = "sleep 0.1; ${pkgs.eww-wayland}/bin/eww open --toggle calendar --screen 0"; + }; + cpu = { + format = " {usage}% "; + interval = 1; + }; + disk = { + format = "{percentage_used}% "; + path = "/"; + interval = 30; + }; + memory = { + format = "{}% "; + interval = 1; + }; + backlight = { + device = "intel_backlight"; + format= "{percent}% {icon}"; + format-icons = ["" ""]; + on-scroll-down = "${pkgs.light}/bin/light -U 5"; + on-scroll-up = "${pkgs.light}/bin/light -A 5"; + }; + battery = { + interval = 1; + states = { + warning = 30; + critical = 15; + }; + format = "{capacity}% {icon}"; + format-charging = "{capacity}% "; + format-icons = ["" "" "" "" ""]; + max-length = 25; + }; + network = { + format-wifi = ""; + format-ethernet = "󰈀"; + format-linked = "󱘖 {ifname} (No IP)"; + format-disconnected = "󱘖 Not connected"; + tooltip-format = "{essid} {ipaddr}/{cidr}"; + }; + pulseaudio = { + format = "{icon} {volume}% {format_source} "; + format-bluetooth = "{icon} {volume}% {format_source} "; + format-bluetooth-muted = "x {volume}% {format_source} "; + format-muted = "x {volume}% {format_source} "; + format-source = " "; + format-source-muted = " "; + format-icons = { + default = [ "" "" "" ]; + headphone = ""; + }; + tooltip-format = "{desc}, {volume}%"; + scroll-step = 5; + on-click = "${pkgs.pamixer}/bin/pamixer -t"; + on-click-right = "${pkgs.pamixer}/bin/pamixer --default-source -t"; + on-click-middle = "${pkgs.pavucontrol}/bin/pavucontrol"; + }; + "custom/sink" = { + format = "{}"; + exec = "$HOME/.config/waybar/script/sink.sh"; + interval = 2; + on-click = "$HOME/.config/waybar/script/switch.sh"; + tooltip = false; + }; + "custom/mouse" = { + format = "{}"; + exec = "$HOME/.config/waybar/script/mouse.sh"; + interval = 60; + tooltip = false; + }; + "custom/kb" = { + format = "{}"; + exec = "$HOME/.config/waybar/script/kb.sh"; + interval = 60; + tooltip = false; + }; + "custom/ds4" = { + format = "{}"; + exec = "$HOME/.config/waybar/script/ds4.sh"; + interval = 60; + tooltip = false; + }; + tray = { + icon-size = if hostName == "xps" then 16 else 13; + }; + }; + }; + }; + home.file = { + ".config/waybar/script/sink.sh" = { + text = if hostName == "beelink" || hostName == "h310m" then '' + #!/bin/sh + + HEAD=$(awk '/ ${headset}/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1) + SPEAK=$(awk '/ ${speaker}/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1) + + if [[ $SPEAK = "*" ]]; then + printf "󰓃\n" + elif [[ $HEAD = "*" ]]; then + printf "\n" + fi + exit 0 + '' else '' + #!/bin/sh + + SINK=$(${pkgs.pulseaudio}/bin/pactl list sinks | grep "Active Port" | awk '{ print $3 }') + + if [[ $SINK == "analog-output-headphones" ]]; then + printf "\n" + elif [[ $SINK == "analog-output-speaker" ]]; then + printf "󰓃\n" + fi + exit 0 + ''; + executable = true; + }; + ".config/waybar/script/switch.sh" = { + text = if hostName == "beelink" || hostName == "h310m" then '' + #!/bin/sh + + ID1=$(awk '/ ${headset}/ {sub(/.$/,"",$2); print $2 }' <(${pkgs.wireplumber}/bin/wpctl status) | head -n 1) + ID2=$(awk '/ ${speaker}/ {sub(/.$/,"",$2); print $2 }' <(${pkgs.wireplumber}/bin/wpctl status) | sed -n 2p) + + HEAD=$(awk '/ ${headset}/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1) + SPEAK=$(awk '/ ${speaker}/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1) + + if [[ $SPEAK = "*" ]]; then + ${pkgs.wireplumber}/bin/wpctl set-default $ID1 + elif [[ $HEAD = "*" ]]; then + ${pkgs.wireplumber}/bin/wpctl set-default $ID2 + fi + exit 0 + '' else '' + #!/bin/sh + + SINK=$(${pkgs.pulseaudio}/bin/pactl list sinks | grep "Active Port" | awk '{ print $3 }') + + if [[ $SINK == "analog-output-headphones" ]]; then + ${pkgs.pulseaudio}/bin/pactl set-sink-port 0 analog-output-speaker + elif [[ $SINK == "analog-output-speaker" ]]; then + ${pkgs.pulseaudio}/bin/pactl set-sink-port 0 analog-output-headphones + fi + ''; + executable = true; + }; + ".config/waybar/script/mouse.sh" = { + text = '' + #!/bin/sh + + for cap in /sys/class/power_supply/hidpp_battery_*/capacity; do + BATT=$(cat "$cap") + done + for stat in /sys/class/power_supply/hidpp_battery_*/status; do + STAT=$(cat "$stat") + done + + if [[ "$STAT" = "Charging" ]] then + printf " 󰍽 $BATT%%\n" + elif [[ "$STAT" = "Full" ]] then + printf " 󰍽 Full\n" + elif [[ "$STAT" = "Discharging" ]] then + printf " 󰍽 $BATT%%\n" + else + printf "\n" + fi + + exit 0 + ''; + executable = true; + }; + ".config/waybar/script/kb.sh" = { + text = '' + #!/bin/sh + + for cap in /sys/class/power_supply/hid-dc:2c:26:36:79:9b-battery/capacity; do + BATT=$(cat "$cap") + done + for stat in /sys/class/power_supply/hid-dc:2c:26:36:79:9b-battery/status; do + STAT=$(cat "$stat") + done + + if [[ "$STAT" == "Charging" ]] then + printf " 󰌌 $BATT%%\n" + elif [[ "$STAT" == "Full" ]] then + printf " 󰌌 Full\n" + elif [[ "$STAT" = "Discharging" ]] then + printf " 󰌌 $BATT%%\n" + else + printf "\n" + fi + + exit 0 + ''; + executable = true; + }; + ".config/waybar/script/ds4.sh" = { + text = '' + #!/bin/sh + + for cap in /sys/class/power_supply/*e8:47:3a:05:c0:2b/capacity; do + BATT=$(cat "$cap") + done + for stat in /sys/class/power_supply/*e8:47:3a:05:c0:2b/status; do + STAT=$(cat "$stat") + done + + if [[ "$STAT" == "Charging" ]] then + printf " 󰊴 $BATT%%\n" + elif [[ "$STAT" == "Full" ]] then + printf " 󰊴 Full\n" + elif [[ "$STAT" = "Discharging" ]] then + printf " 󰊴 $BATT%%\n" + else + printf "\n" + fi + + exit 0 + ''; + executable = true; + }; + }; + }; + }; +} diff --git a/rsc/archive/original/hyprland.nix b/rsc/archive/original/hyprland.nix new file mode 100644 index 00000000..e606a1a9 --- /dev/null +++ b/rsc/archive/original/hyprland.nix @@ -0,0 +1,389 @@ +# +# Hyprland Configuration +# Enable with "hyprland.enable = true;" +# + +{ config, lib, system, pkgs, hyprland, vars, host, ... }: + +with lib; +with host; +{ + options = { + hyprland = { + enable = mkOption { + type = types.bool; + default = false; + }; + }; + }; + + config = mkIf (config.hyprland.enable) { + wlwm.enable = true; # Wayland Window Manager + + environment = + let + exec = "exec dbus-launch Hyprland"; + in + { + loginShellInit = '' + if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then + ${exec} + fi + ''; # Start from TTY1 + + variables = { + #WLR_NO_HARDWARE_CURSORS="1"; # Needed for VM + #WLR_RENDERER_ALLOW_SOFTWARE="1"; + XDG_CURRENT_DESKTOP="Hyprland"; + XDG_SESSION_TYPE="wayland"; + XDG_SESSION_DESKTOP="Hyprland"; + }; + sessionVariables = if hostName == "work" then { + #GBM_BACKEND = "nvidia-drm"; + #__GL_GSYNC_ALLOWED = "0"; + #__GL_VRR_ALLOWED = "0"; + #WLR_DRM_NO_ATOMIC = "1"; + #__GLX_VENDOR_LIBRARY_NAME = "nvidia"; + #_JAVA_AWT_WM_NONREPARENTING = "1"; + + QT_QPA_PLATFORM = "wayland"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + + GDK_BACKEND = "wayland"; + WLR_NO_HARDWARE_CURSORS = "1"; + MOZ_ENABLE_WAYLAND = "1"; + } else { + QT_QPA_PLATFORM = "wayland"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + + GDK_BACKEND = "wayland"; + WLR_NO_HARDWARE_CURSORS = "1"; + MOZ_ENABLE_WAYLAND = "1"; + }; + systemPackages = with pkgs; [ + grim # Grab Images + slurp # Region Selector + swappy # Snapshot Editor + swayidle # Idle Daemon + swaylock # Lock Screen + wl-clipboard # Clipboard + wlr-randr # Monitor Settings + ]; + }; + + security.pam.services.swaylock = { + text = '' + auth include login + ''; + }; + + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland"; + }; + }; + vt = 7; + }; + + programs = { + hyprland = { # Window Manager + enable = true; + package = hyprland.packages.${pkgs.system}.hyprland; + #nvidiaPatches = if hostName == "work" then true else false; + }; + }; + + systemd.sleep.extraConfig = '' + AllowSuspend=yes + AllowHibernation=no + AllowSuspendThenHibernate=no + AllowHybridSleep=yes + ''; # Clamshell Mode + + nix.settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; # Cache + + home-manager.users.${vars.user} = + let + touchpad = + if hostName == "laptop" || hostName == "work" then '' + touchpad { + natural_scroll=true + middle_button_emulation=true + tap-to-click=true + } + } + '' else ""; + gestures = + if hostName == "laptop" || hostName == "work" then '' + gestures { + workspace_swipe=true + workspace_swipe_fingers=3 + workspace_swipe_distance=100 + } + '' else ""; + workspaces = + if hostName == "desktop" || hostName == "beelink" then '' + monitor=${toString mainMonitor},1920x1080@60,1920x0,1 + monitor=${toString secondMonitor},1920x1080@60,0x0,1 + '' else if hostName == "work" then '' + monitor=${toString mainMonitor},1920x1080@60,0x0,1 + monitor=${toString secondMonitor},1920x1200@60,1920x0,1 + monitor=${toString thirdMonitor},1920x1200@60,3840x0,1 + '' else '' + monitor=${toString mainMonitor},1920x1080@60,0x0,1 + ''; + monitors = + if hostName == "desktop" || hostName == "beelink" then '' + workspace=${toString mainMonitor},1 + workspace=${toString mainMonitor},2 + workspace=${toString mainMonitor},3 + workspace=${toString mainMonitor},4 + workspace=${toString secondMonitor},5 + workspace=${toString secondMonitor},6 + workspace=${toString secondMonitor},7 + workspace=${toString secondMonitor},8 + '' else if hostName == "work" then '' + workspace=${toString mainMonitor},1 + workspace=${toString mainMonitor},2 + workspace=${toString mainMonitor},3 + workspace=${toString secondMonitor},4 + workspace=${toString secondMonitor},5 + workspace=${toString secondMonitor},6 + workspace=${toString thirdMonitor},7 + + bindl=,switch:Lid Switch,exec,$HOME/.config/hypr/script/clamshell.sh + '' else ""; + execute = + if hostName == "desktop" || hostName == "beelink" then '' + exec-once=${pkgs.swayidle}/bin/swayidle -w timeout 600 '${pkgs.swaylock}/bin/swaylock -f' timeout 1200 '${pkgs.systemd}/bin/systemctl suspend' after-resume '${config.programs.hyprland.package}/bin/hyprctl dispatch dpms on' before-sleep '${pkgs.swaylock}/bin/swaylock -f && ${config.programs.hyprland.package}/bin/hyprctl dispatch dpms off' + '' else if hostName == "work" then '' + exec-once=${pkgs.networkmanagerapplet}/bin/nm-applet --indicator + #exec-once=${pkgs.google-drive-ocamlfuse}/bin/google-drive-ocamlfuse /GDrive + exec-once=${pkgs.rclone}/bin/rclone mount --daemon gdrive: /GDrive + exec-once=${pkgs.swayidle}/bin/swayidle -w timeout 300 '${pkgs.swaylock}/bin/swaylock -f' timeout 600 '${pkgs.systemd}/bin/systemctl suspend' after-resume '${config.programs.hyprland.package}/bin/hyprctl dispatch dpms on' before-sleep '${pkgs.swaylock}/bin/swaylock -f && ${config.programs.hyprland.package}/bin/hyprctl dispatch dpms off' + '' else ""; + in + let + hyprlandConf = '' + ${workspaces} + ${monitors} + monitor=,highres,auto,auto + + general { + #main_mod=SUPER + border_size=3 + gaps_in=5 + gaps_out=7 + col.active_border=0x80ffffff + col.inactive_border=0x66333333 + layout=dwindle + } + + decoration { + rounding=5 + active_opacity=0.93 + inactive_opacity=0.93 + fullscreen_opacity=1 + blur { + enabled=true + } + drop_shadow=false + } + + animations { + enabled = true + bezier = overshot, 0.05, 0.9, 0.1, 1.05 + bezier = smoothOut, 0.5, 0, 0.99, 0.99 + bezier = smoothIn, 0.5, -0.5, 0.68, 1.5 + bezier = rotate,0,0,1,1 + animation = windows, 1, 4, overshot, slide + animation = windowsIn, 1, 2, smoothOut + animation = windowsOut, 1, 0.5, smoothOut + animation = windowsMove, 1, 3, smoothIn, slide + animation = border, 1, 5, default + animation = fade, 1, 4, smoothIn + animation = fadeDim, 1, 4, smoothIn + animation = workspaces, 1, 4, default + animation = borderangle, 1, 20, rotate, loop + } + + input { + kb_layout=us,us + #kb_options=caps:ctrl_modifier + kb_variant=,dvorak + follow_mouse=2 + repeat_delay=250 + numlock_by_default=1 + accel_profile=flat + sensitivity=0.8 + ${touchpad} + } + + ${gestures} + + dwindle { + pseudotile=false + force_split=2 + } + + misc { + disable_hyprland_logo=true + disable_splash_rendering=true + mouse_move_enables_dpms=true + key_press_enables_dpms=true + } + + debug { + damage_tracking=2 + } + + bindm=SUPER,mouse:272,movewindow + bindm=SUPER,mouse:273,resizewindow + + bind=SUPER,Return,exec,${pkgs.${vars.terminal}}/bin/${vars.terminal} + bind=SUPER,Q,killactive, + bind=SUPER,Escape,exit, + bind=SUPER,S,exec,${pkgs.systemd}/bin/systemctl suspend + bind=SUPER,L,exec,${pkgs.swaylock}/bin/swaylock + bind=SUPER,E,exec,GDK_BACKEND=x11 ${pkgs.pcmanfm}/bin/pcmanfm + bind=SUPER,H,togglefloating, + #bind=SUPER,Space,exec,${pkgs.rofi}/bin/rofi -show drun + bind=SUPER,Space,exec, pkill wofi || ${pkgs.wofi}/bin/wofi --show drun + bind=SUPER,P,pseudo, + bind=SUPER,F,fullscreen, + bind=SUPER,R,forcerendererreload + bind=SUPERSHIFT,R,exec,${pkgs.hyprland}/bin/hyprctl reload + bind=SUPER,T,exec,${pkgs.emacs}/bin/emacsclient -c + bind=SUPER,K,exec,${pkgs.hyprland}/bin/hyprctl switchxkblayout keychron-k8-keychron-k8 next + + bind=SUPER,left,movefocus,l + bind=SUPER,right,movefocus,r + bind=SUPER,up,movefocus,u + bind=SUPER,down,movefocus,d + + bind=SUPERSHIFT,left,movewindow,l + bind=SUPERSHIFT,right,movewindow,r + bind=SUPERSHIFT,up,movewindow,u + bind=SUPERSHIFT,down,movewindow,d + + bind=ALT,1,workspace,1 + bind=ALT,2,workspace,2 + bind=ALT,3,workspace,3 + bind=ALT,4,workspace,4 + bind=ALT,5,workspace,5 + bind=ALT,6,workspace,6 + bind=ALT,7,workspace,7 + bind=ALT,8,workspace,8 + bind=ALT,9,workspace,9 + bind=ALT,0,workspace,10 + bind=ALT,right,workspace,+1 + bind=ALT,left,workspace,-1 + + bind=ALTSHIFT,1,movetoworkspace,1 + bind=ALTSHIFT,2,movetoworkspace,2 + bind=ALTSHIFT,3,movetoworkspace,3 + bind=ALTSHIFT,4,movetoworkspace,4 + bind=ALTSHIFT,5,movetoworkspace,5 + bind=ALTSHIFT,6,movetoworkspace,6 + bind=ALTSHIFT,7,movetoworkspace,7 + bind=ALTSHIFT,8,movetoworkspace,8 + bind=ALTSHIFT,9,movetoworkspace,9 + bind=ALTSHIFT,0,movetoworkspace,10 + bind=ALTSHIFT,right,movetoworkspace,+1 + bind=ALTSHIFT,left,movetoworkspace,-1 + + #bind=CTRL,right,resizeactive,20 0 + #bind=CTRL,left,resizeactive,-20 0 + #bind=CTRL,up,resizeactive,0 -20 + #bind=CTRL,down,resizeactive,0 20 + + bind=SUPER,M,submap,resize + submap=resize + binde=,right,resizeactive,20 0 + binde=,left,resizeactive,-20 0 + binde=,up,resizeactive,0 -20 + binde=,down,resizeactive,0 20 + bind=,escape,submap,reset + submap=reset + + bind=,print,exec,${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.swappy}/bin/swappy -f - -o ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png && notify-send "Saved to ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png" + + bind=,XF86AudioLowerVolume,exec,${pkgs.pamixer}/bin/pamixer -d 10 + bind=,XF86AudioRaiseVolume,exec,${pkgs.pamixer}/bin/pamixer -i 10 + bind=,XF86AudioMute,exec,${pkgs.pamixer}/bin/pamixer -t + bind=SUPER_L,c,exec,${pkgs.pamixer}/bin/pamixer --default-source -t + bind=,XF86AudioMicMute,exec,${pkgs.pamixer}/bin/pamixer --default-source -t + bind=,XF86MonBrightnessDown,exec,${pkgs.light}/bin/light -U 10 + bind=,XF86MonBrightnessUP,exec,${pkgs.light}/bin/light -A 10 + + #windowrule=float,^(Rofi)$ + windowrule=float,title:^(Volume Control)$ + windowrule=float,title:^(Picture-in-Picture)$ + windowrule=pin,title:^(Picture-in-Picture)$ + windowrule=move 75% 75% ,title:^(Picture-in-Picture)$ + windowrule=size 24% 24% ,title:^(Picture-in-Picture)$ + + exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + exec-once=${pkgs.waybar}/bin/waybar + exec-once=${pkgs.eww-wayland}/bin/eww daemon + #exec-once=$HOME/.config/eww/scripts/eww # When running eww as a bar + exec-once=${pkgs.blueman}/bin/blueman-applet + ${execute} + ''; + in + { + xdg.configFile."hypr/hyprland.conf".text = hyprlandConf; + + programs.swaylock.settings = { + #image = "$HOME/.config/wall"; + color = "000000f0"; + font-size = "24"; + indicator-idle-visible = false; + indicator-radius = 100; + indicator-thickness = 20; + inside-color = "00000000"; + inside-clear-color = "00000000"; + inside-ver-color = "00000000"; + inside-wrong-color = "00000000"; + key-hl-color = "79b360"; + line-color = "000000f0"; + line-clear-color = "000000f0"; + line-ver-color = "000000f0"; + line-wrong-color = "000000f0"; + ring-color = "ffffff50"; + ring-clear-color = "bbbbbb50"; + ring-ver-color = "bbbbbb50"; + ring-wrong-color = "b3606050"; + text-color = "ffffff"; + text-ver-color = "ffffff"; + text-wrong-color = "ffffff"; + show-failed-attempts = true; + }; + + home.file = { + ".config/hypr/script/clamshell.sh" = { + text = '' + #!/bin/sh + + if grep open /proc/acpi/button/lid/LID/state; then + ${config.programs.hyprland.package}/bin/hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1" + else + if [[ `hyprctl monitors | grep "Monitor" | wc -l` != 1 ]]; then + ${config.programs.hyprland.package}/bin/hyprctl keyword monitor "eDP-1, disable" + else + ${pkgs.swaylock}/bin/swaylock -f + ${pkgs.systemd}/bin/systemctl sleep + fi + fi + ''; + executable = true; + }; + }; + }; + }; +} diff --git a/rsc/archive/waybar.nix b/rsc/archive/original/waybar.nix similarity index 100% rename from rsc/archive/waybar.nix rename to rsc/archive/original/waybar.nix diff --git a/rsc/archive/wofi.nix b/rsc/archive/original/wofi.nix similarity index 100% rename from rsc/archive/wofi.nix rename to rsc/archive/original/wofi.nix