Add Hyprland, attempt generalization

This commit is contained in:
Jimbo 2024-12-08 06:41:06 -05:00
parent 590430f296
commit a0cc623c4b
57 changed files with 634 additions and 385 deletions

View file

@ -75,7 +75,6 @@
nixosConfigurations = { nixosConfigurations = {
tower = mkNix [ ./hosts/tower ]; # Main Desktop tower = mkNix [ ./hosts/tower ]; # Main Desktop
jupiter = mkNix [ ./hosts/jupiter ]; # Steam Deck
axolotl = mkNix [ ./hosts/axolotl ]; # PineBook Pro axolotl = mkNix [ ./hosts/axolotl ]; # PineBook Pro
lacros = mkNix [ ./hosts/lacros ]; # Dell Chromebook lacros = mkNix [ ./hosts/lacros ]; # Dell Chromebook
redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot Laptop redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot Laptop

View file

@ -6,11 +6,13 @@
./filesystems ./filesystems
./hardware ./hardware
./modules ./modules
./users
../../modules/system ../../modules/system
]; ];
system.wireguard.client.enable = true; system.wireguard.client.enable = true;
networking.wireguard.interfaces.wgc.ips = [ "10.100.0.21/24" ]; networking.wireguard.interfaces.wgc.ips = [ "10.100.0.21/24" ];
system.stateVersion = "24.11";
networking.hostName = "extern"; networking.hostName = "extern";
} }

4
hosts/extern/users/default.nix vendored Normal file
View file

@ -0,0 +1,4 @@
{ ... }:
{
imports = [ ./jimbo ];
}

6
hosts/extern/users/jimbo/default.nix vendored Normal file
View file

@ -0,0 +1,6 @@
{ ... }:
{
home-manager.users.jimbo = {
home.stateVersion = "24.11";
};
}

View file

@ -1,44 +0,0 @@
{ config, pkgs, ... }:
{
boot = {
kernelPackages = pkgs.unstable.linuxPackages_latest;
kernel.sysctl."vm.max_map_count" = 2147483642;
kernelParams = [
"amd_iommu=on"
"iommu=pt"
"nested=1"
"transparent_hugepage=never"
];
initrd.systemd = {
enable = true;
services.root-reset = {
description = "Reset root and snapshot last boot";
wantedBy = [ "initrd.target" ];
before = [ "sysroot.mount" ];
after = [ "dev-${config.networking.hostName}-root.device" ];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
mkdir -p /mnt
mount /dev/${config.networking.hostName}/root /mnt
if [[ -e /mnt/prev ]]; then
btrfs subvolume delete /mnt/prev
fi
btrfs subvolume snapshot /mnt/root /mnt/prev
btrfs subvolume list -o /mnt/root | cut -f9 -d' ' | while read subvolume; do
btrfs subvolume delete "/mnt/$subvolume"
done
btrfs subvolume delete /mnt/root
btrfs subvolume create /mnt/root
umount /mnt
'';
};
};
};
}

View file

@ -1,16 +0,0 @@
{ ... }:
{
imports = [
./boot
./disko
./filesystems
./hardware
./wireguard
../../modules/system
];
system.lanzaboote.enable = true;
system.libvirtd.enable = true;
networking.hostName = "jupiter";
}

View file

@ -1,97 +0,0 @@
{ disko, config, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/persist/.snapshots" = { };
"/jimbo" = {
mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/jimbo/.snapshots" = { };
};
};
};
swap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems = {
"/persist".neededForBoot = true;
"/persist/home/jimbo".neededForBoot = true;
};
}

View file

@ -1,11 +0,0 @@
{ ... }:
{
fileSystems = {
# Remote
"/home/jimbo/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];
};
};
}

View file

@ -1,17 +0,0 @@
{ config, lib, ... }:
{
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"usb_storage"
"usbhid"
"sd_mod"
"sdhci_pci"
];
boot.kernelModules = [ "kvm-amd" ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,23 +0,0 @@
{ lib, config, ... }:
{
networking = {
firewall = {
allowedUDPPorts = [ 51820 ];
trustedInterfaces = [ "wgc" ];
};
wireguard.interfaces.wgc = {
ips = [ "10.100.0.21/24" ];
listenPort = 51820;
privateKey = config.secrets.wgClientPriv;
peers = [
{ # Cyberspark Server
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "sv.${config.domains.jim1}:51820";
persistentKeepalive = 25;
}
];
};
};
}

View file

@ -15,8 +15,6 @@
system.video.nvidia.enable = true; system.video.nvidia.enable = true;
system.libvirtd.enable = true; system.libvirtd.enable = true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
networking.hostName = "tower"; networking.hostName = "tower";
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -1,6 +1,6 @@
{ ... }: { lib, ... }:
{ {
home-manager.users.jimbo = { home-manager.users.jimbo = {
home.stateVersion = "24.05"; home.stateVersion = lib.mkForce "24.05";
}; };
} }

View file

@ -15,4 +15,5 @@
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
home.stateVersion = "24.11";
} }

View file

@ -9,7 +9,6 @@
./mpv ./mpv
./pcmanfm ./pcmanfm
./rofi ./rofi
./swappy
./thunderbird ./thunderbird
]; ];
} }

View file

@ -133,7 +133,6 @@
Btop) foot -a btop -T Btop btop;; Btop) foot -a btop -T Btop btop;;
Music) foot -a music -T Music ncmpcpp;; Music) foot -a music -T Music ncmpcpp;;
Sound) foot -a sound -T Sound pulsemixer;; Sound) foot -a sound -T Sound pulsemixer;;
EasyEffects) easyeffects;;
esac esac
} }

View file

@ -1,11 +0,0 @@
{ pkgs, ... }:
{
home = {
packages = with pkgs; [ swappy ];
file.".config/swappy/config".text = ''
[Default]
early_exit=true
save_dir=$HOME/Pictures/Screenshots
'';
};
}

View file

@ -4,5 +4,6 @@
p7zip p7zip
vimv vimv
dua dua
trash-cli
]; ];
} }

View file

@ -10,27 +10,28 @@
plugins = [ "git" ]; plugins = [ "git" ];
}; };
shellAliases = { shellAliases = {
# NixOS aliases # NixOS
flakedate = "doas nix flake update --flake /etc/nixos"; flakedate = "sudo nix flake update --flake /etc/nixos";
nhs = "doas nh os switch -R"; nhs = "sudo nh os switch -R /etc/nixos";
nhu = "flakedate && nhs"; nhu = "flakedate && nhs";
ns = "nix-shell -p"; ns = "nix-shell -p";
nixclean = "doas nix-store --gc; nix-collect-garbage -d"; nixclean = "sudo nix-store --gc; nix-collect-garbage -d";
nixpurge = "doas nix-collect-garbage --delete-old"; nixpurge = "sudo nix-collect-garbage --delete-old";
nixoptimize = "doas nix store optimise"; nixoptimize = "sudo nix store optimise";
nixscrub = "nixclean; nixpurge; nixoptimize"; nixscrub = "nixclean; nixpurge; nixoptimize";
# Shortcut aliases # Shortcuts
ff = "clear && fastfetch"; ff = "clear && fastfetch";
ip = "ip -c"; ip = "ip -c";
ls = "${pkgs.eza}/bin/eza -a --color=always --group-directories-first --icons"; ls = "${pkgs.eza}/bin/eza -a --color=always --group-directories-first --icons";
nls = "/usr/bin/env ls";
cat = "${pkgs.bat}/bin/bat --paging never"; cat = "${pkgs.bat}/bin/bat --paging never";
ncat = "/usr/bin/env cat";
copycat = "wl-copy <"; copycat = "wl-copy <";
myip = "curl ifconfig.co"; myip = "curl ifconfig.co";
seneca = "ssh jhampton1@matrix.senecapolytechnic.ca"; seneca = "ssh jhampton1@matrix.senecapolytechnic.ca";
# Deny
rm = ''echo "Use trash."; false'';
}; };
initExtra = '' initExtra = ''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch ${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch

View file

@ -10,6 +10,7 @@
HISTCONTROL = "ignoreboth"; HISTCONTROL = "ignoreboth";
QT_QPA_PLATFORMTHEME = "gtk3"; QT_QPA_PLATFORMTHEME = "gtk3";
NIXPKGS_ALLOW_UNFREE = 1; NIXPKGS_ALLOW_UNFREE = 1;
NIXOS_OZONE_WL = 1;
}; };
}; };
} }

View file

@ -1,6 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./hyprland
./niri ./niri
./programs ./programs
./sway ./sway

View file

@ -0,0 +1,26 @@
{ pkgs, ... }:
{
wayland.windowManager.hyprland.settings.exec-once = [
"waybar"
# Scratchpads
"foot -a btop -T Gotop btop"
"foot -a music -T Music ncmpcpp"
"foot -a sound -T Sound pulsemixer"
# Deamons and tray
"hyprpaper"
"wl-paste -t text --watch clipman store -P"
"wl-copy"
"mako"
"sunshine"
"${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
# Foreground
"librewolf -P Misc --name=MiscBrowser"
"thunderbird"
"vesktop"
"fractal"
"telegram-desktop"
];
}

View file

@ -0,0 +1,18 @@
{ config, pkgs, ... }:
{
imports = [
./autostart
./hotkeys
./inputs
./outputs
./plugins
./programs
./rules
./theme
];
wayland.windowManager.hyprland = {
enable = true;
plugins = with pkgs.hyprlandPlugins; [ hy3 ];
};
}

View file

@ -0,0 +1,84 @@
# Sway Window Manager Hotkeys
## Application Launchers
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Win + F1 | Launch **LibreWolf** (Jim profile) |
| Win + F2 | Launch **LibreWolf** (Alt profile) |
| Win + F3 | Launch **LibreWolf** (Misc profile) |
| Win + F4 | Launch **Discord** |
| Win + F5 | Launch **Steam** |
| Win + F6 | Launch **Heroic Games** |
| Win + F7 | Launch **Looking Glass** VM Client |
| Win + F10 | Launch **Virt-Manager** |
| Win + F11 | Open **Rofi Scratchpads** |
| Win + F12 | Open **NixOS Configuration Files** |
## Window Management
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Win + Arrows | Focus in the specified direction |
| Win + Shift + Arrows | Move window in the specified direction |
| Win + Shift + Space | Toggle window floating |
| Win + Space | Switch focus between floating/tiled |
| Win + Shift + {1-9} | Move window to a workspace and focus |
| Win + {1-9} | Switch to specified workspace |
| Win + 0 | Pin window and toggle border |
| Win + F | Toggle fullscreen |
| Win + Shift + R | Reload configuration |
| Win + Q | Close the current window |
## Layout Management
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Win + W | Toggle split layout |
| Win + E | Toggle tabbed/stacking layout |
| Win + H/V | Split window horizontally/vertically |
| Win + A/D | Focus parent/child container |
## Volume and Media Controls
| Key Combination | Action |
|----------------------|-------------------------------------------|
| XF86AudioRaiseVolume | Raise system volume |
| XF86AudioLowerVolume | Lower system volume |
| XF86AudioMute | Mute/unmute audio |
| XF86AudioPlay | Toggle media playback |
| XF86AudioNext | Skip to the next track |
| XF86AudioPrev | Go to the previous track |
## Screenshot and Brightness Controls
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Print | Take a screenshot |
| Shift + Print | Screenshot of the current window |
| Brightness Up + Down | Change screen brightness |
## Scratchpads
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Ctrl + Shift + Escape | Open **Gotop** (monitoring) |
| Win + Shift + M | Open **Music** scratchpad |
| Win + Shift + V | Open **Sound Settings** scratchpad |
| Win + Shift + Backslash | Open **EasyEffects** scratchpad |
## Special Sway Tools
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Win + Escape | **Kill** selected window |
| Win + Ctrl + X | **Inspect** window properties |
| Win + Ctrl + Prior/Next | Switch OBS scene to **Main**/**Guest** |
## Miscellaneous
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Win + Return | Open **Foot terminal** |
| Win + S | Open **Rofi (run commands)** |
| Win + C | Open **Clipman (clipboard manager)** |
| Win + X | Open **Power Menu** |
| Win + B | Show/Hide **Waybar** |
## Workspaces (Alternate)
| Key Combination | Action |
|----------------------|-------------------------------------------|
| Alt + F1-F9 | Switch to alternate workspace |
| Alt + Shift + F1-F9 | Move window to alt workspace and focus |

View file

@ -0,0 +1,166 @@
{ pkgs, config, ... }:
{
wayland.windowManager.hyprland.settings = let
# Set default modifier and variables
primeMod = "Super";
secMod = "Alt";
resizeAmount = "55";
in {
bind = [
## Launchers
# Browser
''${primeMod}, F1, exec, librewolf -p Main --name MainBrowser | notify-send "Main Browser"''
''${primeMod}, F2, exec, librewolf -p Alt --name AltBrowser | notify-send "Alternate Browser"''
''${primeMod}, F3, exec, librewolf -p Misc --name MiscBrowser | notify-send "Miscellaneous Browser"''
# Virtual machines
''${primeMod}, F4, exec, virt-manager | notify-send "Virtual Machines"''
''${primeMod}, F5, exec, looking-glass-client input:rawMouse=yes | notify-send "Looking Glass"''
# Prime + key
"${primeMod}, s, exec, rofi -show run -p Command"
"${primeMod}, c, exec, clipman pick -t rofi"
"${primeMod}, x, exec, rofiscripts --power"
"${primeMod}, b, exec, pkill -USR1 waybar"
"${primeMod}, Return, exec, foot"
# Prime + shift + key
"${primeMod} Shift, s, exec, rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history"
"${primeMod} Shift, t, exec, pcmanfm"
"${primeMod} Shift, e, exec, bemoji -n -P 0"
"${primeMod} Shift, b, exec, rofi-bluetooth"
"${primeMod} Shift, Return, exec, foot ranger"
# Prime + ctrl + key
"${primeMod} Ctrl, s, exec, rofiscripts --scratchpads"
''${primeMod} Ctrl, c, exec, wlpicker && notify-send "Color copied to clipboard"''
## Media
# Volume
"${secMod}, j, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
"${secMod}, k, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
# MPD
"${primeMod}, Backslash, exec, mpc toggle"
"${secMod} Shift, h, exec, mpc prev"
"${secMod} Shift, j, exec, mpc volume -3"
"${secMod} Shift, k, exec, mpc volume +3"
"${secMod} Shift, l, exec, mpc next"
## Miscellaneous
# Notifications
"${primeMod}, n, exec, makotoggle"
"${primeMod} Shift, n, exec, makoctl restore"
"${primeMod} Ctrl, n, exec, makoctl dismiss -a"
# Screenshots
''${secMod}, f, exec, XDG_SCREENSHOTS_DIR="$HOME/Pictures/Screenshots" SLURP_ARGS="-w 3 -c 3823C4 -B 00000066 -b 00000099" grimblast --freeze --notify copysave area''
"${secMod} Shift, f, exec, grimblast --notify copysave output"
"${secMod} Ctrl, f, exec, grimblast --notify copysave active"
# Screenshots
# Display and keyboard brightness
"${primeMod}, equal, exec, light -A 5"
"${primeMod}, minus, exec, light -U 5"
"${primeMod} Shift, equal, exec, light -A 1"
"${primeMod} Shift, minus, exec, light -U 1"
",XF86KbdBrightnessUp, exec, light -s sysfs/leds/smc::kbd_backlight -A 5"
",XF86KbdBrightnessDown, exec, light -s sysfs/leds/smc::kbd_backlight -U 5"
## Window manager
"${primeMod}, q, killactive,"
# Switch to workspaces
"${primeMod}, grave, workspace, name:0"
"${primeMod}, 1, workspace, name:${config.ws.w1}"
"${primeMod}, 2, workspace, name:${config.ws.w2}"
"${primeMod}, 3, workspace, name:${config.ws.w3}"
"${primeMod}, 4, workspace, name:${config.ws.w4}"
"${primeMod}, 5, workspace, name:${config.ws.w5}"
"${primeMod}, 6, workspace, name:${config.ws.w6}"
"${primeMod}, 7, workspace, name:${config.ws.w7}"
"${primeMod}, 8, workspace, name:${config.ws.w8}"
"${primeMod}, 9, workspace, name:${config.ws.w9}"
# Switch to alternate workspaces
"${secMod}, F1, workspace, name:${config.ws.w1a}"
"${secMod}, F2, workspace, name:${config.ws.w2a}"
"${secMod}, F3, workspace, name:${config.ws.w3a}"
"${secMod}, F4, workspace, name:${config.ws.w4a}"
"${secMod}, F5, workspace, name:${config.ws.w5a}"
"${secMod}, F6, workspace, name:${config.ws.w6a}"
"${secMod}, F7, workspace, name:${config.ws.w7a}"
"${secMod}, F8, workspace, name:${config.ws.w8a}"
"${secMod}, F9, workspace, name:${config.ws.w9a}"
# Move window to and focus workspace
"${primeMod} Shift, grave, movetoworkspace, name:${config.ws.w0}"
"${primeMod} Shift, 1, movetoworkspace, name:${config.ws.w1}"
"${primeMod} Shift, 2, movetoworkspace, name:${config.ws.w2}"
"${primeMod} Shift, 3, movetoworkspace, name:${config.ws.w3}"
"${primeMod} Shift, 4, movetoworkspace, name:${config.ws.w4}"
"${primeMod} Shift, 5, movetoworkspace, name:${config.ws.w5}"
"${primeMod} Shift, 6, movetoworkspace, name:${config.ws.w6}"
"${primeMod} Shift, 7, movetoworkspace, name:${config.ws.w7}"
"${primeMod} Shift, 8, movetoworkspace, name:${config.ws.w8}"
"${primeMod} Shift, 9, movetoworkspace, name:${config.ws.w9}"
# Move window to and focus alternate workspace
"${secMod} Shift, F1, movetoworkspace, name:${config.ws.w1a}"
"${secMod} Shift, F2, movetoworkspace, name:${config.ws.w2a}"
"${secMod} Shift, F3, movetoworkspace, name:${config.ws.w3a}"
"${secMod} Shift, F4, movetoworkspace, name:${config.ws.w4a}"
"${secMod} Shift, F5, movetoworkspace, name:${config.ws.w5a}"
"${secMod} Shift, F6, movetoworkspace, name:${config.ws.w6a}"
"${secMod} Shift, F7, movetoworkspace, name:${config.ws.w7a}"
"${secMod} Shift, F8, movetoworkspace, name:${config.ws.w8a}"
"${secMod} Shift, F9, movetoworkspace, name:${config.ws.w9a}"
# Change focused window
"${primeMod}, h, hy3:movefocus, l"
"${primeMod}, j, hy3:movefocus, d"
"${primeMod}, k, hy3:movefocus, u"
"${primeMod}, l, hy3:movefocus, r"
# Move focused window
"${primeMod} Shift, h, hy3:movewindow, l"
"${primeMod} Shift, j, hy3:movewindow, d"
"${primeMod} Shift, k, hy3:movewindow, u"
"${primeMod} Shift, l, hy3:movewindow, r"
# Resize window
"${primeMod} ${secMod}, h, resizeactive, -${resizeAmount} 0"
"${primeMod} ${secMod}, j, resizeactive, 0 -${resizeAmount}"
"${primeMod} ${secMod}, k, resizeactive, 0 ${resizeAmount}"
"${primeMod} ${secMod}, l, resizeactive, ${resizeAmount} 0"
# Floating
"${primeMod}, Space, hy3:togglefocuslayer"
"${primeMod} Shift, Space, togglefloating"
# Change layout
"${primeMod}, f, fullscreen"
"${primeMod}, w, hy3:changegroup, opposite"
"${primeMod}, v, hy3:makegroup, v"
"${primeMod}, e, hy3:changegroup, toggletab"
## Scratchpads
"${primeMod} Shift, Backslash, togglespecialworkspace, btop"
"${primeMod} Shift, m, togglespecialworkspace, music"
"${primeMod} Shift, v, togglespecialworkspace, sound"
];
# Mouse
bindm = [
"${primeMod}, mouse:272, movewindow"
"${primeMod}, mouse:273, resizewindow"
];
bindn = [
",mouse:272, hy3:focustab, mouse"
];
};
}

View file

@ -0,0 +1,16 @@
{ config, ... }:
{
wayland.windowManager.hyprland.settings = {
input = {
follow_mouse = 1;
accel_profile = "flat";
scroll_factor = 0.8;
touchpad.natural_scroll = false;
};
gestures.workspace_swipe = false;
device = {
name = "sinowealth-game-mouse";
sensitivity = "-0.9";
};
};
}

View file

@ -0,0 +1,36 @@
{ config, ... }:
{
# Monitors
wayland.windowManager.hyprland.settings = {
monitor = [
"${config.displays.d1},1920x1080@143.980, 3840x405, 1"
"${config.displays.d2},1920x1080@60, 1920x405, 1"
"${config.displays.d3},1680x1050@59.883, 5760x0, 1, transform, 1"
"${config.displays.d4},1920x1080@60, 0x405, 1"
];
workspace = [
"name:${config.ws.w1}, monitor:${config.displays.d1}, default:true"
"name:${config.ws.w2}, monitor:${config.displays.d1}"
"name:${config.ws.w3}, monitor:${config.displays.d1}"
"name:${config.ws.w1a}, monitor:${config.displays.d1}"
"name:${config.ws.w2a}, monitor:${config.displays.d1}"
"name:${config.ws.w3a}, monitor:${config.displays.d1}"
"name:${config.ws.w4}, monitor:${config.displays.d2}, default:true"
"name:${config.ws.w5}, monitor:${config.displays.d2}"
"name:${config.ws.w6}, monitor:${config.displays.d2}"
"name:${config.ws.w4a}, monitor:${config.displays.d2}"
"name:${config.ws.w5a}, monitor:${config.displays.d2}"
"name:${config.ws.w7}, monitor:${config.displays.d3}, default:true"
"name:${config.ws.w8}, monitor:${config.displays.d3}"
"name:${config.ws.w9}, monitor:${config.displays.d3}"
"name:${config.ws.w7a}, monitor:${config.displays.d3}"
"name:${config.ws.w8a}, monitor:${config.displays.d3}"
"name:${config.ws.w6a}, monitor:${config.displays.d4}, default:true"
"name:${config.ws.w9a}, monitor:${config.displays.d4}"
];
};
}

View file

@ -0,0 +1,22 @@
{ config, ... }:
{
wayland.windowManager.hyprland.settings.plugin = {
hy3 = {
no_gaps_when_only = 0;
node_collapse_policy = 0;
group_inset = 5;
tabs = {
text_font = config.look.fonts.main;
text_height = 10;
height = 17;
padding = 0;
rounding = 0;
"col.active" = "rgba(${config.look.colors.prime}FF)";
"col.inactive" = "rgba(${config.look.colors.split}FF)";
"col.urgent" = "rgba(${config.look.colors.urgent}FF)";
"col.text.active" = "rgba(${config.look.colors.text}FF)";
"col.text.inactive" = "rgba(${config.look.colors.text}FF)";
};
};
};
}

View file

@ -0,0 +1,5 @@
{ pkgs, ... }:
{
imports = [
];
}

View file

@ -0,0 +1,37 @@
{ config, ... }:
{
wayland.windowManager.hyprland.settings = {
windowrulev2 = [
# Scratchpads
"workspace special:btop silent, class:^(btop)$"
"workspace special:music silent, class:^(music)$"
"workspace special:sound silent, class:^(sound)$"
# Browsers
"workspace name:${config.ws.w1} silent, class:(MainBrowser)"
"workspace name:${config.ws.w1a} silent, class:(AltBrowser)"
# Communication
"workspace name:${config.ws.w7} silent, class:(MiscBrowser)"
"workspace name:${config.ws.w7} silent, class:(vesktop)"
"workspace name:${config.ws.w8} silent, class:(org.gnome.Fractal)"
"workspace name:${config.ws.w8} silent, class:(org.telegram.desktop)"
"workspace name:${config.ws.w9} silent, class:(thunderbird)"
# Etc
"workspace name:${config.ws.w2} silent, class:(steam)"
"workspace name:${config.ws.w2} silent, class:(heroic)"
"workspace name:${config.ws.w2a} silent, class:(looking-glass-client)"
"workspace name:${config.ws.w4a} silent, class:(com.obsproject.Studio)"
# Borderless single window part 1
"bordersize 0, floating:0, onworkspace:w[tv1]"
];
# Borderless on single window part 2
workspace = [ "w[tv1], gapsout:0, gapsin:0" ];
# Borderless screenshots
layerrule = "noanim, selection";
};
}

View file

@ -0,0 +1,51 @@
{ config, ... }:
{
wayland.windowManager.hyprland.settings = {
general = {
"col.active_border" = "rgba(${config.look.colors.prime}FF)";
"col.inactive_border" = "rgba(${config.look.colors.split}FF)";
gaps_in = 4;
gaps_out = 10;
border_size = config.look.border.string;
allow_tearing = true;
layout = "hy3";
};
misc = {
disable_hyprland_logo = true;
font_family = config.look.fonts.main;
middle_click_paste = false;
vrr = 2;
};
decoration.blur.enabled = false;
animations = {
bezier = [
"easeOutQuint,0.23,1,0.32,1"
"easeInOutCubic,0.65,0.05,0.36,1"
"linear,0,0,1,1"
"almostLinear,0.5,0.5,0.75,1.0"
"quick,0.15,0,0.1,1"
];
animation = [
"global, 1, 10, default"
"border, 1, 5.39, easeOutQuint"
"windows, 1, 4.79, easeOutQuint"
"windowsIn, 1, 4.1, easeOutQuint, popin 87%"
"windowsOut, 1, 1.49, linear, popin 87%"
"fadeIn, 1, 1.73, almostLinear"
"fadeOut, 1, 1.46, almostLinear"
"fade, 1, 3.03, quick"
"layers, 1, 3.81, easeOutQuint"
"layersIn, 1, 4, easeOutQuint, fade"
"layersOut, 1, 1.5, linear, fade"
"fadeLayersIn, 1, 1.79, almostLinear"
"fadeLayersOut, 1, 1.39, almostLinear"
"workspaces, 1, 1.94, almostLinear, fade"
"workspacesIn, 1, 1.21, almostLinear, fade"
"workspacesOut, 1, 1.94, almostLinear, fade"
];
};
};
}

View file

@ -1,23 +1,22 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
config.home.niri.settings.autostart = pkgs.writeText "autostart" '' config.home.niri.settings.autostart = pkgs.writeText "autostart" ''
// Everpresent bar
spawn-at-startup "waybar" spawn-at-startup "waybar"
// Daemons and tray apps // Daemons and tray
spawn-at-startup "hyprpaper" spawn-at-startup "hyprpaper"
spawn-at-startup "wl-paste" "-t" "text" "--watch" "clipman" "store" "-P" spawn-at-startup "wl-paste" "-t" "text" "--watch" "clipman" "store" "-P"
spawn-at-startup "wl-copy" spawn-at-startup "wl-copy"
spawn-at-startup "mako" spawn-at-startup "mako"
spawn-at-startup "sunshine" spawn-at-startup "sunshine"
spawn-at-startup "xwayland-satellite"
spawn-at-startup "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1" spawn-at-startup "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
spawn-at-startup "${pkgs.xwayland-satellite}/bin/xwayland-satellite"
// Foreground apps // Foreground
spawn-at-startup "librewolf" "-p" "Misc" "--name" "MiscBrowser" spawn-at-startup "librewolf" "-p" "Misc" "--name" "MiscBrowser"
spawn-at-startup "thunderbird"
spawn-at-startup "vesktop" spawn-at-startup "vesktop"
spawn-at-startup "fractal" spawn-at-startup "fractal"
spawn-at-startup "telegram-desktop" spawn-at-startup "telegram-desktop"
spawn-at-startup "thunderbird"
''; '';
} }

View file

@ -17,21 +17,21 @@
${primeMod}+F4 { spawn "sh" "-c" "virt-manager | notify-send \"Virtual Machines\""; } ${primeMod}+F4 { spawn "sh" "-c" "virt-manager | notify-send \"Virtual Machines\""; }
${primeMod}+F5 { spawn "sh" "-c" "looking-glass-client input:rawMouse=yes | notify-send \"Looking Glass\""; } ${primeMod}+F5 { spawn "sh" "-c" "looking-glass-client input:rawMouse=yes | notify-send \"Looking Glass\""; }
// ${primeMod} + key // Prime + key
${primeMod}+s { spawn "sh" "-c" "rofi -show run -p Command"; } ${primeMod}+s { spawn "sh" "-c" "rofi -show run -p Command"; }
${primeMod}+c { spawn "sh" "-c" "clipman pick -t rofi"; } ${primeMod}+c { spawn "sh" "-c" "clipman pick -t rofi"; }
${primeMod}+x { spawn "sh" "-c" "rofiscripts --power"; } ${primeMod}+x { spawn "sh" "-c" "rofiscripts --power"; }
${primeMod}+b { spawn "sh" "-c" "pkill -USR1 waybar"; } ${primeMod}+b { spawn "sh" "-c" "pkill -USR1 waybar"; }
${primeMod}+Return { spawn "sh" "-c" "foot"; } ${primeMod}+Return { spawn "sh" "-c" "foot"; }
// ${primeMod} + shift + key // Prime + shift + key
${primeMod}+Shift+s { spawn "sh" "-c" "rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history"; } ${primeMod}+Shift+s { spawn "sh" "-c" "rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history"; }
${primeMod}+Shift+t { spawn "sh" "-c" "pcmanfm"; } ${primeMod}+Shift+t { spawn "sh" "-c" "pcmanfm"; }
${primeMod}+Shift+e { spawn "sh" "-c" "bemoji -n -P 0"; } ${primeMod}+Shift+e { spawn "sh" "-c" "bemoji -n -P 0"; }
${primeMod}+Shift+b { spawn "sh" "-c" "rofi-bluetooth"; } ${primeMod}+Shift+b { spawn "sh" "-c" "rofi-bluetooth"; }
${primeMod}+Shift+Return { spawn "sh" "-c" "foot ranger"; } ${primeMod}+Shift+Return { spawn "sh" "-c" "foot ranger"; }
// ${primeMod} + ctrl + key // Prime + ctrl + key
${primeMod}+Ctrl+s { spawn "sh" "-c" "rofiscripts --scratchpads"; } ${primeMod}+Ctrl+s { spawn "sh" "-c" "rofiscripts --scratchpads"; }
${primeMod}+Ctrl+c { spawn "sh" "-c" "wlpicker && notify-send \"Color copied to clipboard\""; } ${primeMod}+Ctrl+c { spawn "sh" "-c" "wlpicker && notify-send \"Color copied to clipboard\""; }

View file

@ -12,11 +12,9 @@
clipman clipman
hyprpicker hyprpicker
libnotify libnotify
grim grimblast
slurp
wl-clipboard wl-clipboard
wdisplays wdisplays
xwayland-satellite
jq jq
]; ];
} }

View file

@ -11,10 +11,10 @@
if [[ "$mode_line" == "do-not-disturb" ]]; then if [[ "$mode_line" == "do-not-disturb" ]]; then
# Notifications are disabled, so we enable them # Notifications are disabled, so we enable them
makoctl mode -r do-not-disturb makoctl mode -r do-not-disturb
notify-send --expire-time=1500 'Notifications Enabled' notify-send 'Notifications Enabled'
else else
# Notifications are enabled, so we disable them # Notifications are enabled, so we disable them
notify-send --expire-time=1500 'Notifications Disabled' notify-send 'Notifications Disabled'
sleep 2 sleep 2
makoctl mode -a do-not-disturb makoctl mode -a do-not-disturb
fi fi

View file

@ -9,7 +9,7 @@
disable-scroll-wraparound = true; disable-scroll-wraparound = true;
}; };
swayWindowsModule = { windowModule = {
icon = true; icon = true;
icon-size = 15; icon-size = 15;
all-outputs = true; all-outputs = true;
@ -219,6 +219,8 @@
"sway/window" "sway/window"
"niri/workspaces" "niri/workspaces"
"niri/window" "niri/window"
"hyprland/workspaces"
"hyprland/window"
]; ];
modules-right = [ modules-right = [
"pulseaudio" "pulseaudio"
@ -234,8 +236,9 @@
"network" "network"
]; ];
"sway/workspaces" = swayWorkspaceModule; "sway/workspaces" = swayWorkspaceModule;
"sway/window" = swayWindowsModule; "sway/window" = windowModule;
"niri/window" = swayWindowsModule; "niri/window" = windowModule;
"hyprland/window" = windowModule;
"pulseaudio" = pulseModule; "pulseaudio" = pulseModule;
"cpu" = cpuModule; "cpu" = cpuModule;
"memory" = ramModule; "memory" = ramModule;
@ -259,6 +262,8 @@
"sway/window" "sway/window"
"niri/workspaces" "niri/workspaces"
"niri/window" "niri/window"
"hyprland/workspaces"
"hyprland/window"
]; ];
modules-right = [ modules-right = [
"pulseaudio" "pulseaudio"
@ -270,8 +275,9 @@
"custom/clock-long" "custom/clock-long"
]; ];
"sway/workspaces" = swayWorkspaceModule; "sway/workspaces" = swayWorkspaceModule;
"sway/window" = swayWindowsModule; "sway/window" = windowModule;
"niri/window" = swayWindowsModule; "niri/window" = windowModule;
"hyprland/window" = windowModule;
"pulseaudio" = pulseModule; "pulseaudio" = pulseModule;
"mpd" = mediaModule; "mpd" = mediaModule;
"custom/notifs" = notificationModule; "custom/notifs" = notificationModule;
@ -291,6 +297,8 @@
"sway/window" "sway/window"
"niri/workspaces" "niri/workspaces"
"niri/window" "niri/window"
"hyprland/workspaces"
"hyprland/window"
]; ];
modules-right = [ modules-right = [
"pulseaudio" "pulseaudio"
@ -301,8 +309,9 @@
"custom/clock-short" "custom/clock-short"
]; ];
"sway/workspaces" = swayWorkspaceModule; "sway/workspaces" = swayWorkspaceModule;
"sway/window" = swayWindowsModule; "sway/window" = windowModule;
"niri/window" = swayWindowsModule; "niri/window" = windowModule;
"hyprland/window" = windowModule;
"pulseaudio" = pulseModule; "pulseaudio" = pulseModule;
"custom/weather" = weatherModule; "custom/weather" = weatherModule;
"cpu" = cpuModule; "cpu" = cpuModule;
@ -325,6 +334,8 @@
"sway/window" "sway/window"
"niri/workspaces" "niri/workspaces"
"niri/window" "niri/window"
"hyprland/workspaces"
"hyprland/window"
]; ];
modules-right = [ modules-right = [
"pulseaudio" "pulseaudio"
@ -344,8 +355,9 @@
"network" "network"
]; ];
"sway/workspaces" = swayWorkspaceModule; "sway/workspaces" = swayWorkspaceModule;
"sway/window" = swayWindowsModule; "sway/window" = windowModule;
"niri/window" = swayWindowsModule; "niri/window" = windowModule;
"hyprland/window" = windowModule;
"pulseaudio" = pulseModule; "pulseaudio" = pulseModule;
"mpd" = mediaModule; "mpd" = mediaModule;
"custom/notifs" = notificationModule; "custom/notifs" = notificationModule;

View file

@ -9,21 +9,20 @@
{ command = "foot -a music -T Music ncmpcpp"; } { command = "foot -a music -T Music ncmpcpp"; }
{ command = "foot -a sound -T Sound pulsemixer"; } { command = "foot -a sound -T Sound pulsemixer"; }
# Daemons and tray apps # Daemons and tray
{ command = "hyprpaper"; } { command = "hyprpaper"; }
{ command = "wl-paste -t text --watch clipman store -P"; } { command = "wl-paste -t text --watch clipman store -P"; }
{ command = "wl-copy"; } { command = "wl-copy"; }
{ command = "mako"; } { command = "mako"; }
{ command = "sunshine"; } { command = "sunshine"; }
{ command = "xwayland-satellite"; }
{ command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"; } { command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"; }
# Foreground apps # Foreground
{ command = "librewolf -P Misc --name=MiscBrowser"; } { command = "librewolf -P Misc --name=MiscBrowser"; }
{ command = "thunderbird"; }
{ command = "vesktop"; } { command = "vesktop"; }
{ command = "fractal"; } { command = "fractal"; }
{ command = "telegram-desktop"; } { command = "telegram-desktop"; }
{ command = "thunderbird"; }
]; ];
}; };
} }

View file

@ -21,12 +21,6 @@
titlebar_padding 10 1 titlebar_padding 10 1
primary_selection disabled primary_selection disabled
mouse_warping container mouse_warping container
# Include extra window icons
include ${pkgs.fetchurl {
url = "https://raw.githubusercontent.com/iguanajuice/sway-font-awesome/6b7a9d08974eea1b9cddb8d444e1c89d6837083a/icons";
sha256 = "09ki5qw1h91kd33k3fwzq7cb6ck8sq4haswgizrsy387sfr2a75x";
}}
''; '';
}; };
} }

View file

@ -20,23 +20,22 @@
"${primeMod}+F4" = ''exec virt-manager | notify-send "Virtual Machines"''; "${primeMod}+F4" = ''exec virt-manager | notify-send "Virtual Machines"'';
"${primeMod}+F5" = ''exec looking-glass-client input:rawMouse=yes | notify-send "Looking Glass"''; "${primeMod}+F5" = ''exec looking-glass-client input:rawMouse=yes | notify-send "Looking Glass"'';
# Mod + key # Prime + key
"${primeMod}+s" = ''exec rofi -show run -p Command''; "${primeMod}+s" = ''exec rofi -show run -p Command'';
"${primeMod}+c" = ''exec clipman pick -t rofi''; "${primeMod}+c" = ''exec clipman pick -t rofi'';
"${primeMod}+x" = ''exec rofiscripts --power''; "${primeMod}+x" = ''exec rofiscripts --power'';
"${primeMod}+b" = ''exec pkill -USR1 waybar''; "${primeMod}+b" = ''exec pkill -USR1 waybar'';
"${primeMod}+Return" = ''exec foot''; "${primeMod}+Return" = ''exec foot'';
"${primeMod}+Escape" = ''exec tools-sway --kill'';
# Mod + shift + key # Prime + shift + key
"${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history''; "${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history'';
"${primeMod}+Shift+t" = ''exec pcmanfm''; "${primeMod}+Shift+t" = ''exec pcmanfm'';
"${primeMod}+Shift+e" = ''exec bemoji -n -P 0''; "${primeMod}+Shift+e" = ''exec bemoji -n -P 0'';
"${primeMod}+Shift+b" = ''exec rofi-bluetooth''; "${primeMod}+Shift+b" = ''exec rofi-bluetooth'';
"${primeMod}+Shift+Return" = ''exec foot ranger''; "${primeMod}+Shift+Return" = ''exec foot ranger'';
# Mod + ctrl + key # Prime + ctrl + key
"${primeMod}+Ctrl+x" = ''exec tools-sway --prop''; "${primeMod}+Ctrl+x" = ''exec prop-sway'';
"${primeMod}+Ctrl+s" = ''exec rofiscripts --scratchpads''; "${primeMod}+Ctrl+s" = ''exec rofiscripts --scratchpads'';
"${primeMod}+Ctrl+c" = ''exec wlpicker && notify-send "Color copied to clipboard"''; "${primeMod}+Ctrl+c" = ''exec wlpicker && notify-send "Color copied to clipboard"'';
@ -61,8 +60,8 @@
"${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a''; "${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a'';
# Screenshots # Screenshots
"${secMod}+f" = ''exec screen-sway --swappy''; "${secMod}+f" = ''exec shot-sway --swappy'';
"${secMod}+Shift+f" = ''exec screen-sway --screen''; "${secMod}+Shift+f" = ''exec shot-sway --screen'';
# Display and keyboard brightness # Display and keyboard brightness
"${primeMod}+equal" = ''exec light -A 5''; "${primeMod}+equal" = ''exec light -A 5'';
@ -140,20 +139,15 @@
"${primeMod}+${secMod}+k" = ''resize grow height ${resizeAmount} px or 5 ppt''; "${primeMod}+${secMod}+k" = ''resize grow height ${resizeAmount} px or 5 ppt'';
"${primeMod}+${secMod}+l" = ''resize grow width ${resizeAmount} px or 5 ppt''; "${primeMod}+${secMod}+l" = ''resize grow width ${resizeAmount} px or 5 ppt'';
# Change focus between floating/tiled, toggle floating # Floating
"${primeMod}+space" = ''focus mode_toggle''; "${primeMod}+space" = ''focus mode_toggle'';
"${primeMod}+Shift+space" = ''floating toggle''; "${primeMod}+Shift+space" = ''floating toggle'';
# Toggle fullscreen # Change layout
"${primeMod}+f" = ''fullscreen toggle''; "${primeMod}+f" = ''fullscreen toggle'';
"${primeMod}+${secMod}+Ctrl+f" = ''fullscreen toggle global'';
# Change container layout
"${primeMod}+w" = ''layout toggle split''; "${primeMod}+w" = ''layout toggle split'';
"${primeMod}+e" = ''layout toggle tabbed stacking'';
# Change split direction
"${primeMod}+v" = ''split v''; "${primeMod}+v" = ''split v'';
"${primeMod}+e" = ''layout toggle tabbed stacking'';
# Focus parent / child # Focus parent / child
"${primeMod}+a" = ''focus parent''; "${primeMod}+a" = ''focus parent'';

View file

@ -1,8 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
./screen-sway ./prop-sway
./sleep-sway ./sleep-sway
./tools-sway
]; ];
} }

View file

@ -0,0 +1,13 @@
{ pkgs, config, ... }:
{
home.packages = with pkgs; [
(pkgs.writeScriptBin "prop-sway" ''
selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | ${pkgs.slurp}/bin/slurp -r -c ${config.look.colors.prime} -B 00000066 -b 00000000)
if [ -n "$selected_window" ]; then
app_id=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .app_id')
system=$(sed 's/xdg_shell/Wayland/g; s/xwayland/Xorg/g' < <(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .shell'))
notify-send "$(echo -e "Window's app_id: $app_id\nWindow System: $system")"
fi
'')
];
}

View file

@ -1,44 +0,0 @@
{ pkgs, config, ... }:
{
home.packages = with pkgs; [
(pkgs.writeScriptBin "screen-sway" ''
swappy() {
# Create an imv window to act as a static screen
grim -t jpeg -q 90 - | imv -w "GlobalShot" - & imv_pid=$!
# Capture the screenshot of the selected area and save to a temporary file
selected_area=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"'\
| XCURSOR_SIZE=40 slurp -w ${config.look.border.string} -c ${config.look.colors.prime} -B 00000066 -b 00000099)
temp_file=$(mktemp -u).png
grim -g "$selected_area" "$temp_file"
kill $imv_pid
# Copy the screenshot to the clipboard and clear the temp
${pkgs.swappy}/bin/swappy -f - < "$temp_file"
rm "$temp_file"
}
screen() {
temp_file=$(mktemp -u).png
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') "$temp_file"
# Check if the screenshot was successfully taken
if [ $? -eq 0 ]; then
wl-copy < "$temp_file"
notify-send -i "$temp_file" "Current screen copied."
rm "$temp_file"
else
notify-send "Error: Unable to capture screenshot."
fi
}
if [ "$1" == "--swappy" ]; then
swappy
elif [ "$1" == "--screen" ]; then
screen
else
echo "Please use the arguments --swappy or --screen."
fi
'')
];
}

View file

@ -1,33 +0,0 @@
{ pkgs, config, ... }:
{
home.packages = with pkgs; [
(pkgs.writeScriptBin "tools-sway" ''
# List the app name and whether or not it uses wayland
prop() {
selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | slurp -r -c ${config.look.colors.prime} -B 00000066 -b 00000000)
if [ -n "$selected_window" ]; then
app_id=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .app_id')
system=$(sed 's/xdg_shell/Wayland/g; s/xwayland/Xorg/g' < <(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .shell'))
notify-send "$(echo -e "Window's app_id: $app_id\nWindow System: $system")"
fi
}
# Kill a selected window
kill() {
selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | slurp -r -c ${config.look.colors.prime} -B 00000066 -b 00000000)
if [ -n "$selected_window" ]; then
pid=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .pid')
kill -9 "$pid"
fi
}
if [ "$1" == "--prop" ]; then
prop
elif [ "$1" == "--kill" ]; then
kill
else
echo "Please use the arguments --prop or --kill."
fi
'')
];
}

View file

@ -67,7 +67,6 @@
"7:${config.ws.w7}" = [ "7:${config.ws.w7}" = [
{ app_id = "MiscBrowser"; } { app_id = "MiscBrowser"; }
{ app_id = "vesktop"; } { app_id = "vesktop"; }
{ class = "vesktop"; }
]; ];
"8:${config.ws.w8}" = [ "8:${config.ws.w8}" = [
{ app_id = "org.gnome.Fractal"; } { app_id = "org.gnome.Fractal"; }

View file

@ -32,7 +32,7 @@
}; };
}; };
fonts = { fonts = {
names = ["${config.look.fonts.main}"]; names = [ config.look.fonts.main ];
size = 10.5; size = 10.5;
}; };
gaps = { gaps = {

View file

@ -0,0 +1,6 @@
{ ... }:
{
users.groups.admin = {
gid = 515;
};
}

View file

@ -1,6 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./admin
./nfsShare ./nfsShare
]; ];
} }

View file

@ -8,5 +8,8 @@
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
]; ];
users.mutableUsers = false; users = {
mutableUsers = false;
allowNoPasswordLogin = true;
};
} }

View file

@ -19,7 +19,7 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9"
]; ];
extraGroups = [ extraGroups = [
"wheel" "admin"
"audio" "audio"
"video" "video"
"input" "input"

View file

@ -16,6 +16,7 @@
".thunderbird" ".thunderbird"
".config/blender" ".config/blender"
".config/dconf"
".config/vesktop" ".config/vesktop"
".config/sunshine" ".config/sunshine"
".config/heroic" ".config/heroic"
@ -35,7 +36,6 @@
".zsh_history" ".zsh_history"
".local/share/clipman.json" ".local/share/clipman.json"
".local/state/lazygit/state.yml" ".local/state/lazygit/state.yml"
".local/share/applications" # Create this so nothing gets generated inside of it ".local/share/applications" # Create this so nothing gets generated inside of it
]; ];
}; };

View file

@ -3,7 +3,8 @@
programs = { programs = {
sway.enable = config.system.desktop.enable; sway.enable = config.system.desktop.enable;
niri.enable = config.system.desktop.enable; niri.enable = config.system.desktop.enable;
xwayland.enable = false; hyprland.enable = config.system.desktop.enable;
xwayland.enable = lib.mkForce true;
}; };
services.dbus.enable = config.system.desktop.enable; services.dbus.enable = config.system.desktop.enable;

View file

@ -2,8 +2,8 @@
{ {
imports = [ imports = [
./apparmor ./apparmor
./doas
./polkit ./polkit
./privilege
./rtprio ./rtprio
]; ];
} }

View file

@ -1,16 +0,0 @@
{ ... }:
{
security = {
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{ # Give wheel root access
groups = [ "wheel" ];
keepEnv = true;
persist = true;
}
];
};
};
}

View file

@ -0,0 +1,31 @@
{ ... }:
{
security.sudo-rs = {
enable = true;
extraRules = [
{ # Admin gets certain commands
groups = [ "admin" ];
commands = [
"/run/current-system/sw/bin/nix"
"/run/current-system/sw/bin/nh"
"/run/current-system/sw/bin/nixos-rebuild"
"/run/current-system/sw/bin/nixos-enter"
"/run/current-system/sw/bin/nix-collect-garbage"
"/run/current-system/sw/bin/nix-store"
"/run/current-system/sw/bin/systemctl"
"/run/current-system/sw/bin/pkill"
"/run/current-system/sw/bin/dd"
"/run/current-system/sw/bin/eject"
"/run/current-system/sw/bin/vgchange"
"/run/current-system/sw/bin/cp"
"/run/current-system/sw/bin/ls"
"/run/current-system/sw/bin/cat"
"/run/current-system/sw/bin/mount"
];
}
];
};
}

View file

@ -0,0 +1,31 @@
{ ... }:
{
security.sudo-rs = {
enable = true;
extraRules = [
{ # Admin gets certain commands
groups = [ "admin" ];
commands = [
"/run/current-system/sw/bin/nix"
"/run/current-system/sw/bin/nh"
"/run/current-system/sw/bin/nixos-rebuild"
"/run/current-system/sw/bin/nixos-enter"
"/run/current-system/sw/bin/nix-collect-garbage"
"/run/current-system/sw/bin/nix-store"
"/run/current-system/sw/bin/systemctl"
"/run/current-system/sw/bin/pkill"
"/run/current-system/sw/bin/dd"
"/run/current-system/sw/bin/eject"
"/run/current-system/sw/bin/vgchange"
"/run/current-system/sw/bin/cp"
"/run/current-system/sw/bin/ls"
"/run/current-system/sw/bin/cat"
"/run/current-system/sw/bin/mount"
];
}
];
};
}

View file

@ -25,5 +25,10 @@
Name=Niri Name=Niri
Exec=niri-session Exec=niri-session
''; '';
"greetd/environments/hyprland.desktop".text = ''
[Desktop Entry]
Name=Hyprland
Exec=Hyprland
'';
}; };
} }

View file

@ -9,6 +9,9 @@
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099"; chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099";
}; };
}; };
extraPortals = with pkgs; [ xdg-desktop-portal-gnome ]; extraPortals = with pkgs; [
xdg-desktop-portal-gnome
xdg-desktop-portal-hyprland
];
}; };
} }