1
0
Fork 0
forked from foxora/nix
This commit is contained in:
foxora 2026-02-12 18:53:24 +00:00
commit a07bd5fd9b
66 changed files with 6115 additions and 0 deletions

View file

@ -0,0 +1,43 @@
# a submap for emulating keys/buttons/functions on the keyboard or mouse
bind = $mod+shift+alt, a, submap, virtual
submap = virtual
# exit submap
bind = , escape, submap, reset
# emulates mouse buttons
bind = , z, exec, wlrctl pointer click left
bind = , x, exec, wlrctl pointer click right
bind = , s, exec, wlrctl pointer click middle
bind = , i, exec, wlrctl pointer click forward
bind = , o, exec, wlrctl pointer click back
# emulates the arrow keys using hjkl
#binde = , h, exec, wtype -k Left
#binde = , j, exec, wtype -k Down
#binde = , k, exec, wtype -k Up
#binde = , l, exec, wtype -k Right
# moves the mouse pointer
binde = , h, exec, wlrctl pointer move -30 0
binde = , j, exec, wlrctl pointer move 0 30
binde = , k, exec, wlrctl pointer move 0 -30
binde = , l, exec, wlrctl pointer move 30 0
# moves the mouse pointer in little steps
binde = alt, h, exec, wlrctl pointer move -15 0
binde = alt, j, exec, wlrctl pointer move 0 15
binde = alt, k, exec, wlrctl pointer move 0 -15
binde = alt, l, exec, wlrctl pointer move 15 0
# emulates scrolling with mouse
binde = , e, exec, wlrctl pointer scroll 0 -15 # scroll up
binde = , y, exec, wlrctl pointer scroll 0 15 # scroll down
binde = alt, e, exec, wlrctl pointer scroll -15 0 # scroll left
binde = alt, y, exec, wlrctl pointer scroll 0 15 # scroll right
# catches all other keys and keeps us in the submap
bind = , catchall, submap, virtual
submap = reset

View file

@ -0,0 +1,19 @@
general {
# border colors that works in most situations
col.inactive_border = rgb($colorbg) rgb($color09) 45deg
col.active_border = rgb($colorfg) rgb($color11) 45deg
# transparent inactive border colors
# col.inactive_border = rgba($color01,0.0) rgba($color03,0.0) 45deg
# experimental border colors that may not look good all the time
# col.inactive_border = rgba($color01,0.6) rgba($color03,0.6) 45deg
# col.active_border = rgb($color09) rgb($color11) 45deg
}
decoration {
shadow {
enabled = false
range = 2
}
}

View file

@ -0,0 +1,61 @@
# window rules
# ---------------------------------------------------------------------------- #
# task manager
windowrule {
name = task-manager
match:class = ^(kitty)$
match:title = ^(btop)$
float = true
center = true
size = (monitor_w*0.65) (monitor_h*0.65)
}
# ---------------------------------------------------------------------------- #
# terminal filechooser
windowrule {
name = terminal-filechooser
match:class = ^(kitty)$
match:title = ^(filechooser)$
float = true
center = true
size = (monitor_w*0.85) (monitor_h*0.85)
}
# ---------------------------------------------------------------------------- #
# yazi explorer
#windowrule {
#name = yazi
#match:class = ^(kitty)$
#match:title = ^(yazi)$
#float = true
#center = true
#size = (monitor_w*0.85) (monitor_h*0.85)
#}
# ---------------------------------------------------------------------------- #
# kitty - blur
windowrule {
name = kitty-blur
match:class = ^(kitty)$
match:fullscreen = false
opacity = 0.95
}
# ---------------------------------------------------------------------------- #
# imhex - blur
windowrule {
name = imhex-blur
match:class = ^(imhex)$
match:fullscreen = false
opacity = 0.97
}
# ---------------------------------------------------------------------------- #
# discord - blur
windowrule {
name = discord-blur
match:initial_title = ^(Discord|Discord Popout)$
match:fullscreen = false
opacity = 0.97
}

View file

@ -0,0 +1,314 @@
{ config, inputs, pkgs, ... }:
let
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
hyprland-git = inputs.hyprland-git.packages.${pkgs.stdenv.hostPlatform.system};
in
{
wayland.windowManager.hyprland = {
enable = true;
package = null;
portalPackage = null;
plugins = [
#inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprscrolling
];
xwayland.enable = true;
extraConfig = ''
source = ./colors.conf
source = ./theme.conf
source = ./windowrules.conf
source = ./keybinds/virtual.conf
'';
settings = {
# shorthand command keywords
"$mod" = "SUPER";
# applications
"$terminal" = "kitty";
"$explorer" = "kitty -e yazi";
"$browser" = "zen";
# menu
"$menu" = "rofi";
# startup programs
exec-once = [
"waybar"
"awww-daemon"
"wl-paste --type text --watch cliphist store"
"wl-paste --type image --watch cliphist store"
"wl-clip-persist --clipboard regular"
"playerctld daemon"
# swaps around the 3rd and 4th workspace because they always start
# in the wrong order
"hyprctl dispatch workspace 4 && hyprctl dispatch workspace 5 && hyprctl dispatch workspace 3 && hyprctl dispatch workspace 4 && hyprctl dispatch workspace 5 && hyprctl dispatch workspace 3 && hyprctl dispatch workspace 1"
];
# monitor configuration
monitor = [
# note: display stream compression pending for open source
# amd gpu driver and my monitor (VG279QM) only supports DP 1.2
# so no >240hz atm
"DP-2, 1920x1080@239.76, 0x0, 1" # main monitor
"DP-3, 1920x1080@143.61, 1920x0, 1" # second monitor
"HDMI-A-2, 2560x1440@59.95, 3840x0, 1" # third monitor (drawing tablet)
"HDMI-A-1, 1920x1080@60.00, -1920x0, 1" # tv
];
general = {
gaps_in = 5;
gaps_out = "0, 10, 10, 10";
border_size = 2;
layout = "dwindle";
};
plugin = {
# options at https://github.com/hyprwm/hyprland-plugins/tree/main/hyprscrolling
hyprscrolling = {
fullscreen_on_one_column = false;
column_width = 1.0;
};
};
dwindle = {
preserve_split = true;
};
decoration = {
rounding = 8;
active_opacity = 1.00;
inactive_opacity = 1.00;
blur = {
xray = true;
size = 6;
passes = 2;
#vibrancy = 0.3;
special = true;
};
};
bezier = [
"workspace_curve, 0.56,0.19,0.24,0.58"
"workspace_in_curve, 0.56,0.19,0.56,0.99"
];
animation = [
#"workspaces, 1, 1.94, workspace_in_curve, slide"
#"workspacesIn, 1, 1.21, workspace_in_curve, slide"
#"workspacesOut, 1, 1.94, workspace_in_curve, slide"
];
input = {
repeat_rate = 50;
repeat_delay = 300;
sensitivity = 0; # 0 = no modification
accel_profile = "flat";
force_no_accel = false; # not recommended to turn on
};
cursor.no_hardware_cursors = true;
misc = {
enable_anr_dialog = false;
font_family = "DepartureMono Nerd Font";
};
# bindings
bind = [
# binds for applications
"$mod, t, exec, $terminal"
"$mod, r, exec, $browser"
"$mod, e, exec, $explorer"
# binds for rofi
"$mod, d, exec, pkill -x rofi || rofi -show drun -show-icons"
"alt, tab, exec, pkill -x rofi || rofi -modi window -show window -show-icons"
"$mod, v, exec, pkill -x rofi || cliphist list | rofi -dmenu | cliphist decode | wl-copy"
# screenshots
# todo: add active monitor
"$mod, s, exec, grim -g \"\$(slurp -d)\" - | wl-copy" # region
"$mod+alt, s, exec, grim -g \"\$(slurp -o)\" - | wl-copy" # monitor
"$mod+ctrl, s, exec, grim - | wl-copy" # all monitors
# hyprpicker
"$mod, n, exec, hyprpicker -v"
# hyprlock
"$mod+alt, y, exec, hyprlock"
# task manager
"$mod+ctrl, escape, exec, task-manager.sh"
"$mod+ctrl, grave, exec, task-manager.sh"
# media binds (more in binde below)
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioNext, exec, playerctl next"
", XF86AudioPrev, exec, playerctl previous"
"Shift_R, XF86AudioPlay, exec, playerctl shuffle toggle"
"Shift_R, XF86AudioNext, exec, playerctl loop track"
# manage windows / session
"$mod+alt, c, killactive"
"$mod, f, fullscreen"
"$mod, x, togglefloating"
"$mod, i, togglesplit"
"$mod+Alt, Delete, exit" # exit hyprland
# move focus
"$mod, h, movefocus, l"
"$mod, j, movefocus, d"
"$mod, k, movefocus, u"
"$mod, l, movefocus, r"
# move window
"$mod+alt, h, movewindow, l"
"$mod+alt, j, movewindow, d"
"$mod+alt, k, movewindow, u"
"$mod+alt, l, movewindow, r"
# swap window
"$mod+ctrl, h, swapwindow, l"
"$mod+ctrl, j, swapwindow, d"
"$mod+ctrl, k, swapwindow, u"
"$mod+ctrl, l, swapwindow, r"
# move column (hyprscrolling)
"$mod, period, layoutmsg, move +col"
"$mod, comma, layoutmsg, move -col"
# focus monitor
#"$mod+Ctrl+Tab, 1, focusmonitor, DP-2"
#"$mod+Ctrl+Tab, 2, focusmonitor, DP-3"
#"$mod+Ctrl+Tab, 3, focusmonitor, HDMI-A-2"
#"$mod+Ctrl+Tab, 4, focusmonitor, HDMI-A-1"
# move workspace to monitor
#"$mod+Tab, 1, movecurrentworkspacetomonitor, DP-2"
#"$mod+Tab, 2, movecurrentworkspacetomonitor, DP-3"
#"$mod+Tab, 3, movecurrentworkspacetomonitor, HDMI-A-2"
#"$mod+Tab, 4, movecurrentworkspacetomonitor, HDMI-A-1"
# special workspace
"$mod, escape, togglespecialworkspace"
"$mod+shift, escape, movetoworkspace, special"
"$mod+alt, escape, movetoworkspacesilent, special"
"$mod, grave, togglespecialworkspace"
"$mod+shift, grave, movetoworkspace, special"
"$mod+alt, grave, movetoworkspacesilent, special"
# switch workspaces
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod, minus, workspace, 11"
"$mod, equal, workspace, 12"
# move focused window to workspace
"$mod+shift, 1, movetoworkspace, 1"
"$mod+shift, 2, movetoworkspace, 2"
"$mod+shift, 3, movetoworkspace, 3"
"$mod+shift, 4, movetoworkspace, 4"
"$mod+shift, 5, movetoworkspace, 5"
"$mod+shift, 6, movetoworkspace, 6"
"$mod+shift, 7, movetoworkspace, 7"
"$mod+shift, 8, movetoworkspace, 8"
"$mod+shift, 9, movetoworkspace, 9"
"$mod+shift, 0, movetoworkspace, 10"
"$mod+shift, minus, movetoworkspace, 11"
"$mod+shift, equal, movetoworkspace, 12"
# move focused window to workspace silently
"$mod+alt, 1, movetoworkspacesilent, 1"
"$mod+alt, 2, movetoworkspacesilent, 2"
"$mod+alt, 3, movetoworkspacesilent, 3"
"$mod+alt, 4, movetoworkspacesilent, 4"
"$mod+alt, 5, movetoworkspacesilent, 5"
"$mod+alt, 6, movetoworkspacesilent, 6"
"$mod+alt, 7, movetoworkspacesilent, 7"
"$mod+alt, 8, movetoworkspacesilent, 8"
"$mod+alt, 9, movetoworkspacesilent, 9"
"$mod+alt, 0, movetoworkspacesilent, 10"
"$mod+alt, minus, movetoworkspacesilent, 11"
"$mod+alt, equal, movetoworkspacesilent, 12"
# move current workspace to monitor
"$mod+shift+alt, 1, movecurrentworkspacetomonitor, DP-2"
"$mod+shift+alt, 2, movecurrentworkspacetomonitor, DP-3"
"$mod+shift+alt, 3, movecurrentworkspacetomonitor, HDMI-A-2"
"$mod+shift+alt, 4, movecurrentworkspacetomonitor, HDMI-A-1"
];
# bindings for mouse
bindm = [
"$mod, mouse:272, movewindow" # left click
"$mod, mouse:273, resizewindow" # right click
];
# repeating binds, repeats when held
binde = [
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%-"
"Shift_R, XF86AudioRaiseVolume, exec, playerctl volume 0.05+"
"Shift_R, XF86AudioLowerVolume, exec, playerctl volume 0.05-"
# resize window
# variable for `resizeactive` is (x, y)
# starting at 0, 0 in the top left
# meaning:
# -x = left
# +x = right
# -y = up
# +y = down
"$mod+ctrl+shift, h, resizeactive, -10 0"
"$mod+ctrl+shift, j, resizeactive, 0 10"
"$mod+ctrl+shift, k, resizeactive, 0 -10"
"$mod+ctrl+shift, l, resizeactive, 10 0"
];
layerrule = [
#"blur, rofi"
#"ignorezero, rofi"
#"blur, aurorashell"
#"ignorealpha 0.7, aurorashell"
"blur on, match:namespace waybar"
"ignore_alpha 0, match:namespace waybar"
];
env = [
"EDITOR,auravim"
"XCURSOR_THEME,Bunny (Icy) and Strawberries"
"XCURSOR_SIZE,24"
"HYPRCURSOR_THEME,Bunny (Icy) and Strawberries"
"HYPRCURSOR_SIZE,24"
"QT_QPA_PLATFORM,wayland"
];
};
};
# extra hyprland config for organisation,
# and to load colors.conf
# writes ./hypr to ~/.config/hypr
xdg.configFile."hypr" = {
recursive = true;
source = ./hypr;
};
}

View file

@ -0,0 +1,83 @@
{ config, inputs, pkgs, upkgs, ... }:
let
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
wayland.windowManager.river = let
layout = "rivertile";
in {
enable = true;
xwayland.enable = true;
package = upkgs.river-classic; # FIX: using upkgs version as zls is broken rn ;-;
settings = let
main = "Super";
# applications
terminal = "kitty";
browser = "firefox";
in {
default-layout = "${layout}";
output-layout = "${layout}";
border-width = 1;
spawn = [
''${layout}''
"awww-daemon"
"waybar"
];
map.normal = {
"${main} C" = "close"; # close focused window
"${main}+Alt Delete" = "exit"; # exit river
# app launcher
"${main} D" = ''spawn "pkill -x rofi || rofi -show drun -show-icons"'';
"Alt Tab" = ''spawn "pkill -x rofi || rofi -modi window -show window -show-icons"'';
# spawn applications
"${main} T" = ''spawn "${terminal}"'';
"${main} R" = ''spawn "${browser}"'';
# move focused view to top of layout stack
"${main} N" = ''zoom'';
# focus next/previous view
"${main} J" = "focus-view previous";
"${main} K" = "focus-view next";
# move to next/previous output
"${main} H" = "focus-output previous";
"${main} L" = "focus-output next";
# swap next/previous view
"${main}+Alt J" = "swap previous";
"${main}+Alt K" = "swap next";
# send view to next/previous output
# and switch to that output (wip)
"${main}+Alt H" = "send-to-output previous";
#"${main}+Alt H" = "focus-output previous";
"${main}+Alt L" = "send-to-output next";
#"${main}+Alt L" = "focus-output next";
# move views
#"${main}+Alt H" = "move left 100";
#"${main}+Alt J" = "move down 100";
#"${main}+Alt K" = "move up 100";
#"${main}+Alt L" = "move right 100";
# snap views
#"${main}+Control H" = "snap left";
#"${main}+Control J" = "snap down";
#"${main}+Control K" = "snap up";
#"${main}+Control L" = "snap right";
# resize views
#"${main}+Shift H" = "resize horizontal -100";
#"${main}+Shift J" = "resize vertical -100";
#"${main}+Shift K" = "resize vertical 100";
#"${main}+Shift L" = "resize horizontal 100";
};
};
};
}

53
homes/modules/wm/sway.nix Normal file
View file

@ -0,0 +1,53 @@
{ config, inputs, pkgs, ... }:
let
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
wayland.windowManager.sway = {
enable = true;
config = rec {
modifier = "Mod4"; # Mod4 = Super/Meta
terminal = "kitty";
# disable sway bar
bars = [ ];
# set border colors
#colors = {
#focused =
startup = [
{ command = "awww-daemon"; }
{ command = "waybar"; }
];
keybindings = let
main = config.wayland.windowManager.sway.config.modifier;
terminal = config.wayland.windowManager.sway.config.terminal;
browser = "firefox";
in {
"${main}+c" = "kill"; # close focused window
"${main}+Alt+Delete" = "exit"; # exit sway
# open launcher
"${main}+d" = "exec pkill -x rofi || rofi -show drun -show-icons";
"Alt+Tab" = "exec pkill -x rofi || rofi -modi window -show window -show-icons";
"${main}+t" = "exec ${terminal}"; # open terminal
"${main}+r" = "exec ${browser}"; # open browser
# move focus
"${main}+h" = "focus left";
"${main}+j" = "focus down";
"${main}+k" = "focus up";
"${main}+l" = "focus right";
# move focused window
"${main}+Alt+h" = "move left";
"${main}+Alt+j" = "move down";
"${main}+Alt+k" = "move up";
"${main}+Alt+l" = "move right";
};
};
};
}