added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 236b8c2a6b
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{
imports = [
./i3
./hyprland
./sway
];
}

View file

@ -0,0 +1,117 @@
{
inputs',
osConfig,
defaults,
pkgs,
lib,
...
}: let
inherit (lib.meta) getExe;
inherit (osConfig) modules;
env = modules.usrEnv;
# nix advantages
inherit (import ../packages {inherit inputs' pkgs;}) propaganda;
terminal =
if (defaults.terminal == "foot")
then "footclient"
else "${defaults.terminal}";
locker = getExe env.programs.screenlock.package;
in {
wayland.windowManager.hyprland.settings = {
# define the mod key
"$MOD" = "SUPER";
# keyword to toggle "monocle" - a.k.a no_gaps_when_only
"$kw" = "dwindle:no_gaps_when_only";
"$disable" = ''act_opa=$(hyprctl getoption "decoration:active_opacity" -j | jq -r ".float");inact_opa=$(hyprctl getoption "decoration:inactive_opacity" -j | jq -r ".float");hyprctl --batch "keyword decoration:active_opacity 1;keyword decoration:inactive_opacity 1"'';
"$enable" = ''hyprctl --batch "keyword decoration:active_opacity $act_opa;keyword decoration:inactive_opacity $inact_opa"'';
#"$screenshotarea" = ''hyprctl keyword animation "fadeOut,0,0,default"; grimblast --notify copysave area; hyprctl keyword animation "fadeOut,1,4,default"''
bind = [
# Misc
"$MODSHIFT, Escape, exec, wlogout -p layer-shell" # logout menu
"$MODSHIFT, L, exec, ${locker}" # lock the screen with swaylock
"$MODSHIFT,E,exit," # exit Hyprland session
''$MODSHIFT,H,exec,cat ${propaganda} | ${pkgs.wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Propaganda" "ready to spread!" && sleep 0.3 && ${lib.getExe pkgs.wtype} -M ctrl -M shift -k v -m shift -m ctrl -s 300 -k Return'' # spread hyprland propaganda
# Daily Applications
"$MOD,F1,exec,firefox" # browser
''$MOD,F2,exec,run-as-service "${defaults.fileManager}"'' # file manager
''$MOD,RETURN,exec,run-as-service "${terminal}"'' # terminal
''$MODSHIFT,RETURN,exec,run-as-service "${terminal}"'' # floating terminal (TODO)
''$MOD,D,exec, killall rofi || run-as-service $(rofi -show drun)'' # application launcher
"$MOD,equal,exec, killall rofi || rofi -show calc" # calc plugin for rofi
"$MOD,period,exec, killall rofi || rofi -show emoji" # emoji plugin for rofi
''$MOD,R,exec, killall tofi || run-as-service $(tofi-drun --prompt-text " Run")'' # alternative app launcher
''$MODSHIFT,R,exec, killall anyrun || run-as-service $(anyrun)'' # alternative application launcher with more features
# window operators
"$MODSHIFT,Q,killactive," # kill focused window
"$MOD,T,togglegroup," # group focused window
"$MODSHIFT,G,changegroupactive," # switch within the active group
"$MOD,V,togglefloating," # toggle floating for the focused window
"$MOD,P,pseudo," # pseudotile focused window
"$MOD,F,fullscreen," # fullscreen focused window
"$MOD,M,exec,hyprctl keyword $kw $(($(hyprctl getoption $kw -j | jaq -r '.int') ^ 1))" # toggle no_gaps_when_only
# workspace controls
"$MODSHIFT,right,movetoworkspace,+1" # move focused window to the next ws
"$MODSHIFT,left,movetoworkspace,-1" # move focused window to the previous ws
"$MOD,mouse_down,workspace,e+1" # move to the next ws
"$MOD,mouse_up,workspace,e-1" # move to the previous ws
# focus controls
"$MOD, left, movefocus, l" # move focus to the window on the left
"$MOD, right, movefocus, r" # move focus to the window on the right
"$MOD, up, movefocus, u" # move focus to the window above
"$MOD, down, movefocus, d" # move focus to the window below
# screenshot and receording binds
''$MODSHIFT,P,exec,$disable; grim - | wl-copy --type image/png && notify-send "Screenshot" "Screenshot copied to clipboard"; $enable''
"$MODSHIFT,S,exec,$disable; hyprshot; $enable" # screenshot and then pipe it to swappy
"$MOD, Print, exec, grimblast --notify --cursor copysave output" # copy all active outputs
"$ALTSHIFT, S, exec, grimblast --notify --cursor copysave screen" # copy active screen
"$ALTSHIFT, R, exec, grimblast --notify --cursor copysave area" # copy selection area
# OCR
"$MODSHIFT,O,exec,ocr"
# Toggle Statusbar
"$MODSHIFT,B,exec, ags -t bar"
/*
, Print, exec, $screenshotarea
$ALTSHIFT, S, exec, $screenshotarea
*/
];
bindm = [
"$MOD,mouse:272,movewindow"
"$MOD,mouse:273,resizewindow"
];
# binds that will be repeated, a.k.a can be held to toggle multiple times
binde = [
# volume controls
",XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+"
",XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-"
# brightness controls
'',XF86MonBrightnessUp,exec,ags --run-js "brightness.screen += 0.05"''
'',XF86MonBrightnessDown,exec, ags --run-js "brightness.screen -= 0.05"''
];
# binds that are locked, a.k.a will activate even while an input inhibitor is active
bindl = [
# media controls
",XF86AudioPlay,exec,playerctl play-pause"
",XF86AudioPrev,exec,playerctl previous"
",XF86AudioNext,exec,playerctl next"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
];
};
}

View file

@ -0,0 +1,72 @@
{
wayland.windowManager.hyprland.settings = {
decoration = {
# fancy corners
rounding = 7;
# blur
blur = {
enabled = true;
size = 5;
passes = 3;
ignore_opacity = true;
new_optimizations = 1;
xray = true;
contrast = 0.7;
brightness = 0.8;
vibrancy = 0.2;
special = true; # expensive, but helps distinguish special workspaces
};
# shadow config
drop_shadow = "yes";
shadow_range = 10;
shadow_render_power = 3;
"col.shadow" = "rgba(292c3cee)";
};
group = {
# new windows in a group spawn after current or at group tail
insert_after_current = true;
# focus on the window that has just been moved out of the group
focus_removed_window = true;
"col.border_active" = "rgba(88888888)";
"col.border_inactive" = "rgba(00000088)";
groupbar = {
# groupbar stuff
# this removes the ugly gradient around grouped windows - which sucks
gradients = false;
font_size = 14;
# titles look ugly, and I usually know what I'm looking at
render_titles = false;
# scrolling in the groupbar changes group active window
scrolling = true;
};
};
animations = {
enabled = true; # we want animations, half the reason why we're on Hyprland innit
first_launch_animation = true; # fade in on first launch
bezier = [
"smoothOut, 0.36, 0, 0.66, -0.56"
"smoothIn, 0.25, 1, 0.5, 1"
"overshot, 0.4,0.8,0.2,1.2"
];
animation = [
"windows, 1, 4, overshot, slide"
"windowsOut, 1, 4, smoothOut, slide"
"border,1,10,default"
"fade, 1, 10, smoothIn"
"fadeDim, 1, 10, smoothIn"
"workspaces,1,4,overshot,slidevert"
];
};
};
}

View file

@ -0,0 +1,13 @@
{osConfig, ...}: let
inherit (osConfig) modules;
# theming
inherit (modules.style) pointerCursor;
in {
wayland.windowManager.hyprland.settings = {
exec-once = [
# set cursor for HL itself
"hyprctl setcursor ${pointerCursor.name} ${toString pointerCursor.size}"
];
};
}

View file

@ -0,0 +1,81 @@
{
osConfig,
lib,
...
}: let
inherit (lib) imap0;
inherit (osConfig) modules;
inherit (modules.device) monitors;
in {
wayland.windowManager.hyprland.extraConfig = let
# divide workspaces between monitors
mapMonitorsToWs = builtins.concatStringsSep "\n" (
builtins.genList (
x: ''
workspace = ${toString (x + 1)}, monitor:${
if (x + 1) <= 5
then "${builtins.elemAt monitors 0} ${
if (x + 1) == 1
then ", default:true"
else ""
}"
else "${builtins.elemAt monitors 1}"
}
''
)
10
);
# generate monitor config strings
mapMonitors = builtins.concatStringsSep "\n" (imap0 (i: monitor: ''monitor=${monitor},${
if monitor == "DP-1"
then "1920x1080@144"
else "preferred"
}, ${toString (i * 1920)}x0,1'')
monitors);
in ''
# generate a list of monitors automatically, like so
#monitor=HDMI-A-1,preferred,0x0,1
# monitor=DP-1,preferred,1920x0,1
${mapMonitors}
# if I have a second monitor, indicated by the element count of the monitors list, divide the workspaces
# inbetween two workspaces -> 1-5 on mon1 and 6-10 on mon2
# if not, then don't divide workspaces
# P.S. I really don't know what I will do if I get a third monitor
${lib.optionalString (builtins.length monitors != 1) "${mapMonitorsToWs}"}
# a submap for resizing windows
bind = $MOD, S, submap, resize # enter resize window to resize the active window
submap=resize
binde=,right,resizeactive,10 0
binde=,left,resizeactive,-10 0
binde=,up,resizeactive,0 -10
binde=,down,resizeactive,0 10
bind=,escape,submap,reset
submap=reset
# workspace binds
# binds * (asterisk) to special workspace
bind = $MOD, KP_Multiply, togglespecialworkspace
bind = $MODSHIFT, KP_Multiply, movetoworkspace, special
# and mod + [shift +] {1..10} to [move to] ws {1..10}
${
builtins.concatStringsSep "\n"
(builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in ''
bind = $MOD, ${ws}, workspace, ${toString (x + 1)}
bind = $MOD SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}
''
)
10)
}
'';
}

View file

@ -0,0 +1,27 @@
{osConfig, ...}: let
inherit (osConfig) modules;
# theming
inherit (modules.style) colorScheme;
inherit (colorScheme) colors;
in {
wayland.windowManager.hyprland.settings = {
general = {
# sensitivity of the mouse cursor
sensitivity = 0.8;
# gaps
gaps_in = 4;
gaps_out = 8;
# border thiccness
border_size = 2;
# active border color
"col.active_border" = "0xff${colors.base07}";
# whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse)
apply_sens_to_raw = 0;
};
};
}

View file

@ -0,0 +1,8 @@
{
wayland.windowManager.hyprland.settings = {
gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;
};
};
}

View file

@ -0,0 +1,14 @@
{
wayland.windowManager.hyprland.settings = {
input = {
# keyboard layout
kb_layout = "tr";
# self explanatory, I hope?
follow_mouse = 1;
# do not imitate natural scroll
touchpad.natural_scroll = "no";
# ez numlock enable
numlock_by_default = true;
};
};
}

View file

@ -0,0 +1,10 @@
{
wayland.windowManager.hyprland.settings = {
dwindle = {
pseudotile = false;
preserve_split = "yes";
no_gaps_when_only = false;
special_scale_factor = 0.9; # restore old special workspace behaviour
};
};
}

View file

@ -0,0 +1,18 @@
{
wayland.windowManager.hyprland.settings = {
misc = {
# disable redundant renders
disable_hyprland_logo = true; # wallpaper covers it anyway
disable_splash_rendering = true; # "
# window swallowing
enable_swallow = true; # hide windows that spawn other windows
swallow_regex = "foot|thunar|nemo|wezterm"; # windows for which swallow is applied
# dpms
mouse_move_enables_dpms = true; # enable dpms on mouse/touchpad action
key_press_enables_dpms = true; # enable dpms on keyboard action
disable_autoreload = true; # autoreload is unnecessary on nixos, because the config is readonly anyway
};
};
}

View file

@ -0,0 +1,64 @@
{
wayland.windowManager.hyprland.settings = {
windowrulev2 = [
# only allow shadows for floating windows
"noshadow, floating:0"
"float,class:udiskie"
# wlogout
"fullscreen,class:wlogout"
"fullscreen,title:wlogout"
"noanim, title:wlogout"
# spotify
"tile, title:Spotify"
"tile, class:^(Spotify)$"
# steam settings window
"float, title:^(Steam Settings)$"
# telegram media viewer
"float, title:^(Media viewer)$"
# bitwarden
"float,class:Bitwarden"
"size 800 600,class:Bitwarden"
"idleinhibit focus, class:^(mpv)$"
"idleinhibit focus,class:foot"
# firefox
"idleinhibit fullscreen, class:^(firefox)$"
"float,title:^(Firefox Sharing Indicator)$"
"move 0 0,title:^(Firefox Sharing Indicator)$"
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
# thunderbird
"workspace special silent, title:^(Write.*- Thunderbird)$"
# pavucontrol
"float,class:pavucontrol"
"float,title:^(Volume Control)$"
"size 800 600,title:^(Volume Control)$"
"move 75 44%,title:^(Volume Control)$"
"float, class:^(imv)$"
# Helldivers 2
"forceinput,class:^(steam_app_553850)$"
# throw sharing indicators away
"workspace special silent, title:^(Firefox Sharing Indicator)$"
"workspace special silent, title:^(.*is sharing (your screen|a window)\.)$"
# EA launcher puts a tiny window in the current workspae
# throw it away
"workspace special silent, title:^(title:Wine System Tray)$"
"workspace 3 silent, class:^(Spotify)$"
"workspace 4, title:^(.*(Disc|WebC)ord.*)$"
"workspace 10 silent, class:^(Nextcloud)$"
];
};
}

View file

@ -0,0 +1,40 @@
{
inputs',
osConfig,
pkgs,
lib,
...
}: let
inherit (builtins) filter map toString;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.modules) mkIf;
inherit (lib.strings) hasSuffix;
inherit (osConfig) modules;
inherit (import ./packages {inherit inputs' pkgs;}) grimblast hyprshot dbus-hyprland-env hyprpicker wrapper;
env = modules.usrEnv;
in {
imports = filter (hasSuffix ".nix") (
map toString (filter (p: p != ./default.nix) (listFilesRecursive ./config))
);
config = mkIf env.desktops.hyprland.enable {
home.packages = [
inputs'.hyprland.packages.hyprland
hyprshot
grimblast
hyprpicker
dbus-hyprland-env
];
wayland.windowManager.hyprland = {
enable = true;
package = wrapper;
xwayland.enable = true;
systemd = {
enable = true;
variables = ["--all"];
};
};
};
}

View file

@ -0,0 +1,11 @@
{pkgs, ...}:
pkgs.writeTextFile {
name = "dbus-hyprland-env";
destination = "/bin/dbus-hyprland-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire wireplumber pipewire-media-session xdg-desktop-portal xdg-desktop-portal-hyprland
'';
}

View file

@ -0,0 +1,16 @@
{
inputs',
pkgs,
...
}: let
packages = {
inherit (inputs'.hyprland-contrib.packages) grimblast;
inherit (inputs'.hyprpicker.packages) hyprpicker;
wrapper = pkgs.callPackage ./wrapper {inherit (inputs') hyprland;};
hyprshot = pkgs.callPackage ./hyprshot.nix {};
dbus-hyprland-env = pkgs.callPackage ./dbus-hyprland-env.nix {};
propaganda = pkgs.callPackage ./propaganda.nix {};
};
in
packages

View file

@ -0,0 +1,10 @@
{pkgs, ...}:
pkgs.writeShellApplication {
name = "hyprshot";
runtimeInputs = with pkgs; [grim slurp swappy];
text = ''
hyprctl keyword animation "fadeOut,0,8,slow" && \
grim -g "$(slurp -w 0 -b 5e81acd2)" - | swappy -f -; \
hyprctl keyword animation "fadeOut,1,8,slow"
'';
}

View file

@ -0,0 +1,38 @@
{pkgs, ...}:
pkgs.writeTextFile {
name = "propaganda";
text = ''
## Nix advantages:
- Correct and complete packaging
- Immutable & reproducible results
- Easy to cross and static compile
- Source-based (you can alter packages without forking anything)
- Single package manager to rule them all! (C, Python, Docker, NodeJS, etc)
- Great for development, easily switches between dev envs with direnv
- Easy to try out packages without installing using `nix shell` or `nix run`
- allows to create scripts that can do and depend on anything, so long as the host has nix, it'll download things automatically for them
- Uses binary caches so you almost never need to compile anything
- Easy to set up a binary cache
- Easy to set up remote building
- Distribute your builds accross an unlimited number of machines, without any hassle
- Excellent testing infrastructure
- Portable - runs on Linux and macOS
- Can be built statically and run anywhere without root permissions
- Mix and match different package versions without conflicts
- Want to have a package with openssl1.1 and another with openssl 3.0? No problem!
- Flakes let you pin versions to specific revisions
- Various alternatives for Flakes for version pinning, such as npins and niv
## NixOS advantages:
- Declarative configuration
- Meaning easier to configure your system(s)
- Easier to change, manage and maintain the configuration
- Easier to back up and share with people
- Easy to deploy machines and their configuration
- Out of the box Rollbacks.
- Configuration options for many programs & services
- Free of side effects - Actually uninstalls packages and their dependencies
- Easy to set up VMs
- People can test each other's configurations using `nix run` and `nix shell` by just having access to the source
'';
}

View file

@ -0,0 +1,12 @@
{
hyprland,
pkgs,
lib,
...
}: let
inherit (lib.meta) getExe';
in
pkgs.writeShellScriptBin "hyprland" ''
${builtins.readFile ./session.sh}
${getExe' hyprland.packages.default "Hyprland"} $@
''

View file

@ -0,0 +1,41 @@
# disable shellcheck's shell check
# it'll be provided by writeShellScript
# shellcheck disable=2148
# session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=hyprland
export XDG_CURRENT_DESKTOP=hyprland
# firefox
export MOZ_ENABLE_WAYLAND=1
export MOZ_DBUS_REMOTE=1
# qt
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# gtk
export GDK_BACKEND=wayland
# sdl
export SDL_VIDEODRIVER=wayland
# java
export _JAVA_AWT_WM_NONREPARENTING=1
export JDK_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
# other
export CLUTTER_BACKEND=wayland
export XCURSOR_SIZE=24
export NIXOS_OZONE_WL=1
# cursed dbus
dbus-update-activation-environment --systemd MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME QT_WAYLAND_DISABLE_WINDOWDECORATION SDL_VIDEODRIVER _JAVA_AWT_WM_NONREPARENTING JDK_JAVA_OPTIONS XCURSOR_SIZE XCURSOR_THEME
# theme in dbus:
# QT_PLUGIN_PATH=<qt5ct>/lib/qt-ver/plugins + breeze will correctly set the theme.
# HOWEVER it won't find thumbnailers. For now the easiest way to deal with this, though definitely not
# the right one, is to just throw $PATH into dbus.
dbus-update-activation-environment --systemd PATH

View file

@ -0,0 +1,195 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig) modules;
env = modules.usrEnv;
in {
config = mkIf env.desktops.i3.enable {
home.packages = [pkgs.maim];
# enable i3status for the bar
programs.i3status-rust = {
enable = true;
bars = {
bottom = {
theme = "modern";
icons = "awesome6";
blocks = [
{
block = "custom";
command = "${pkgs.rsstail}/bin/rsstail rsstail -n 1 -1 -N -u https://github.com/nixos/nixpkgs/commits/master.atom";
interval = 60;
}
{
block = "memory";
format = " $icon $mem_used_percents ";
format_alt = " $icon $swap_used_percents ";
}
{
block = "cpu";
interval = 1;
format = " CPU $barchart $utilization ";
format_alt = " CPU $frequency{ $boost|} ";
merge_with_next = true;
}
{
block = "load";
format = " Avg $5m ";
interval = 10;
merge_with_next = true;
}
{
block = "memory";
format = " MEM $mem_used_percents ";
format_alt = " MEM $swap_used_percents ";
}
{
block = "battery";
device = "BAT1";
format = " $icon $percentage $time $power ";
}
{
block = "net";
format = " $icon $ssid $signal_strength $ip $speed_down $speed_up ";
interval = 2;
}
{
block = "time";
interval = 1;
format = " $timestamp.datetime(f:'%F %T') ";
}
{
block = "sound";
}
];
};
};
};
# use i3 as the window manager
xsession.windowManager.i3 = let
mod = "Mod4";
in {
enable = true;
config = {
# status bar configuration
bars = [
{
position = "bottom";
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-bottom.toml";
}
];
workspaceLayout = "tabbed";
gaps = let
gaps_inner = 5;
gaps_outer = 5;
gaps_top = 5;
gaps_bottom = 5;
in {
# Set inner/outer gaps
outer = gaps_outer;
inner = gaps_inner;
top = gaps_top;
bottom = gaps_bottom;
};
# keybindings
keybindings = lib.mkOptionDefault {
"${mod}+r" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"${mod}+Return" = "exec ${pkgs.kitty}/bin/kitty";
"${mod}+p" = "exec sh -c '${pkgs.maim}/bin/maim -s | xclip -selection clipboard -t image/png'";
"${mod}+Shift+x" = "exec sh -c '${pkgs.i3lock}/bin/i3lock -c 222222 & sleep 5 && xset dpms force of'";
"${mod}+v" = "floating toggle";
"${mod}+g" = "sticky toggle";
"${mod}+f" = "fullscreen";
# Focus
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
"${mod}+l" = "focus right";
# Move
"${mod}+Shift+h" = "move left";
"${mod}+Shift+j" = "move down";
"${mod}+Shift+k" = "move up";
"${mod}+Shift+l" = "move right";
# workspace navigation
"${mod}+Shift+Right" = "workspace next";
"${mod}+Shift+Left" = "workspace prev";
# workspace selection
"${mod}+1" = "workspace number 1";
"${mod}+2" = "workspace number 2";
"${mod}+3" = "workspace number 3";
"${mod}+4" = "workspace number 4";
"${mod}+5" = "workspace number 5";
"${mod}+6" = "workspace number 6";
"${mod}+7" = "workspace number 7";
"${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9";
"${mod}+0" = "workspace number 0";
# keybindings for moving windows to different workspaces
"${mod}+Shift+1" = "move container to workspace number 1";
"${mod}+Shift+2" = "move container to workspace number 2";
"${mod}+Shift+3" = "move container to workspace number 3";
"${mod}+Shift+4" = "move container to workspace number 4";
"${mod}+Shift+5" = "move container to workspace number 5";
"${mod}+Shift+6" = "move container to workspace number 6";
"${mod}+Shift+7" = "move container to workspace number 7";
"${mod}+Shift+8" = "move container to workspace number 8";
"${mod}+Shift+9" = "move container to workspace number 9";
"${mod}+Shift+r" = ''restart; exec notify-send "i3 restarted"'';
"${mod}+Shif+q" = "kill";
"${mod}+Shift+e" = "exit";
# Move the currently focused window to scratchpad
"${mod}+Shift+BackSpace" = "move scratchpad";
# Show the first scratchpad window
"${mod}+BackSpace" = "scratchpad show, move position center";
};
startup = [
/*
{
command = "${pkgs.feh}/bin/feh --bg-scale 'some path'";
always = false;
notification = false;
}
*/
];
assigns = let
w1 = "1: TSK";
w2 = "2: MUS";
w3 = "3: CHAT";
w4 = "4: VIRT";
w5 = "5: TERM";
w6 = "6: GFX";
w7 = "7: WWW";
w8 = "8: TERM";
w9 = "9: DEV";
w0 = "0: TERM";
in {
"${w2}" = [{class = "Spotify";}];
"${w3}" = [{class = "Discord";}];
"${w7}" = [{class = "Google-chrome";} {class = "firefox";}];
"${w9}" = [{class = "VSCodium";}];
};
};
};
};
}

View file

@ -0,0 +1,78 @@
{
config,
lib,
defaults,
...
}: let
terminal =
if (defaults.terminal == "foot")
then "footclient"
else "${defaults.terminal}";
in {
config = {
wayland.windowManager.sway = {
config = {
assigns = {
"1: web" = [{class = "^Firefox$";}];
"9: steam" = [{class = "^Steam$";}];
};
workspaceAutoBackAndForth = true;
modifier = "Mod4";
keybindings = let
m = config.wayland.windowManager.sway.config.modifier;
in
lib.mkOptionDefault {
"${m}+Return" = "exec ${terminal}";
"${m}+space" = "exec anyrun";
# utilities
"${m}+q" = "kill";
"${m}+t" = "floating toggle";
# screenshots
"Print" = "grim -g \"$(slurp)\" - | wl-copy -t image/png";
"${m}+Shift+r" = "grim -g \"$(slurp)\" - | wl-copy -t image/png";
"Alt+Print" = "grim - | wl-copy -t image/png";
"${m}+Alt+Shift+r" = "grim - | wl-copy -t image/png";
};
keycodebindings = {
"--locked --no-repeat 121" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; # mute
"--locked 122" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%-"; # vol-
"--locked 123" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%+"; # vol+
"--locked 171" = "exec playerctl next"; # next song
"--locked --no-repeat 172" = "exec playerctl play-pause"; # play/pause
"--locked 173" = "exec playerctl previous"; # prev song
"--locked --no-repeat 198" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; # mic mute
"--locked 232" = "exec light -U 5"; # brightness-
"--locked 233" = "exec light -A 5"; # brightness+
};
menu = "anyrun";
bars = [];
gaps = {
smartBorders = "on";
outer = 5;
inner = 5;
};
startup = [{command = "dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY";}];
input = {
"type:pointer" = {
accel_profile = "flat";
pointer_accel = "0";
};
"type:touchpad" = {
middle_emulation = "enabled";
natural_scroll = "enabled";
tap = "enabled";
};
};
};
};
};
}

View file

@ -0,0 +1,18 @@
{
osConfig,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
env = osConfig.modules.usrEnv;
in {
imports = [./config.nix];
config = mkIf env.desktops.sway.enable {
wayland.windowManager.sway = {
enable = true;
package = pkgs.swayfx;
};
};
}