Add Niri, a scrolling tiling window manager.
This commit is contained in:
parent
325c176464
commit
b3d9d2f396
38 changed files with 758 additions and 376 deletions
|
@ -1,14 +1,28 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
options.home.sway.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable SwayWM";
|
||||
options.home = {
|
||||
sway.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable SwayWM";
|
||||
};
|
||||
|
||||
niri = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable SwayWM";
|
||||
};
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./niri
|
||||
./programs
|
||||
./sway
|
||||
./swaylock
|
||||
./waybar
|
||||
];
|
||||
}
|
||||
|
|
23
modules/home/wms/niri/autostart/default.nix
Normal file
23
modules/home/wms/niri/autostart/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.autostart = pkgs.writeText "autostart" ''
|
||||
// Everpresent bar
|
||||
spawn-at-startup "waybar"
|
||||
|
||||
// Daemons and tray apps
|
||||
spawn-at-startup "hyprpaper"
|
||||
spawn-at-startup "wl-paste" "-t" "text --watch clipman store -P"
|
||||
spawn-at-startup "wl-copy"
|
||||
spawn-at-startup "mako"
|
||||
spawn-at-startup "sunshine"
|
||||
spawn-at-startup "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
|
||||
spawn-at-startup "${pkgs.xwayland-satellite}/bin/xwayland-satellite"
|
||||
|
||||
// Foreground apps
|
||||
spawn-at-startup "librewolf" "-p" "Misc" "--name" "MiscBrowser"
|
||||
spawn-at-startup "vesktop"
|
||||
spawn-at-startup "fractal"
|
||||
spawn-at-startup "telegram-desktop"
|
||||
spawn-at-startup "thunderbird"
|
||||
'';
|
||||
}
|
22
modules/home/wms/niri/default.nix
Normal file
22
modules/home/wms/niri/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./autostart
|
||||
./hotkeys
|
||||
./inputs
|
||||
./outputs
|
||||
./rules
|
||||
./settings
|
||||
./theme
|
||||
];
|
||||
|
||||
home.file.".config/niri/config.kdl".text = ''
|
||||
${builtins.readFile config.home.niri.settings.autostart}
|
||||
${builtins.readFile config.home.niri.settings.hotkeys}
|
||||
${builtins.readFile config.home.niri.settings.inputs}
|
||||
${builtins.readFile config.home.niri.settings.outputs}
|
||||
${builtins.readFile config.home.niri.settings.rules}
|
||||
${builtins.readFile config.home.niri.settings.settings}
|
||||
${builtins.readFile config.home.niri.settings.theme}
|
||||
'';
|
||||
}
|
151
modules/home/wms/niri/hotkeys/default.nix
Normal file
151
modules/home/wms/niri/hotkeys/default.nix
Normal file
|
@ -0,0 +1,151 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
config.home.niri.settings.hotkeys = let
|
||||
primeMod = "Mod";
|
||||
secMod = "Alt";
|
||||
resizeAmount = "5";
|
||||
in pkgs.writeText "hotkeys" ''
|
||||
binds {
|
||||
//// Launchers
|
||||
|
||||
// Browser
|
||||
${primeMod}+F1 { spawn "sh" "-c" "librewolf -p Main --name MainBrowser | notify-send \"Main Browser\""; }
|
||||
${primeMod}+F2 { spawn "sh" "-c" "librewolf -p Alt --name AltBrowser | notify-send \"Alternate Browser\""; }
|
||||
${primeMod}+F3 { spawn "sh" "-c" "librewolf -p Misc --name MiscBrowser | notify-send \"Miscellaneous Browser\""; }
|
||||
|
||||
// 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} + key
|
||||
${primeMod}+s { spawn "sh" "-c" "rofi -show run -p Command"; }
|
||||
${primeMod}+c { spawn "sh" "-c" "clipman pick -t rofi"; }
|
||||
${primeMod}+x { spawn "sh" "-c" "rofiscripts --power"; }
|
||||
${primeMod}+b { spawn "sh" "-c" "pkill -USR1 waybar"; }
|
||||
${primeMod}+Return { spawn "sh" "-c" "foot"; }
|
||||
|
||||
// ${primeMod} + shift + key
|
||||
${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+e { spawn "sh" "-c" "bemoji -n -P 0"; }
|
||||
${primeMod}+Shift+b { spawn "sh" "-c" "rofi-bluetooth"; }
|
||||
${primeMod}+Shift+Return { spawn "sh" "-c" "foot ranger"; }
|
||||
|
||||
// ${primeMod} + ctrl + key
|
||||
${primeMod}+Ctrl+s { spawn "sh" "-c" "rofiscripts --scratchpads"; }
|
||||
${primeMod}+Ctrl+c { spawn "sh" "-c" "wlpicker && notify-send \"Color copied to clipboard\""; }
|
||||
|
||||
//// Media
|
||||
|
||||
// Volume
|
||||
${secMod}+j { spawn "sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; }
|
||||
${secMod}+k { spawn "sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; }
|
||||
|
||||
// MPD
|
||||
${primeMod}+Backslash { spawn "sh" "-c" "mpc toggle"; }
|
||||
${secMod}+Shift+h { spawn "sh" "-c" "mpc prev"; }
|
||||
${secMod}+Shift+j { spawn "sh" "-c" "mpc volume -3"; }
|
||||
${secMod}+Shift+k { spawn "sh" "-c" "mpc volume +3"; }
|
||||
${secMod}+Shift+l { spawn "sh" "-c" "mpc next"; }
|
||||
|
||||
//// Miscellaneous
|
||||
|
||||
// Notifications
|
||||
${primeMod}+n { spawn "sh" "-c" "makotoggle"; }
|
||||
${primeMod}+Shift+n { spawn "sh" "-c" "makoctl restore"; }
|
||||
${primeMod}+Ctrl+n { spawn "sh" "-c" "makoctl dismiss -a"; }
|
||||
|
||||
// Screenshots
|
||||
${secMod}+F { screenshot; }
|
||||
${secMod}+Shift+F { screenshot-screen; }
|
||||
${secMod}+Ctrl+F { screenshot-window; }
|
||||
|
||||
// Display and keyboard brightness
|
||||
${primeMod}+equal { spawn "sh" "-c" "light -A 5"; }
|
||||
${primeMod}+minus { spawn "sh" "-c" "light -U 5"; }
|
||||
${primeMod}+Shift+equal { spawn "sh" "-c" "light -A 1"; }
|
||||
${primeMod}+Shift+minus { spawn "sh" "-c" "light -U 1"; }
|
||||
XF86KbdBrightnessUp { spawn "sh" "-c" "light -s sysfs/leds/smc::kbd_backlight -A 5"; }
|
||||
XF86KbdBrightnessDown { spawn "sh" "-c" "light -s sysfs/leds/smc::kbd_backlight -U 5"; }
|
||||
|
||||
//// Window manager
|
||||
${primeMod}+q { close-window; }
|
||||
|
||||
// Switch to workspaces
|
||||
${primeMod}+grave { focus-workspace "${config.ws.w0}"; }
|
||||
${primeMod}+1 { focus-workspace "${config.ws.w1}"; }
|
||||
${primeMod}+2 { focus-workspace "${config.ws.w2}"; }
|
||||
${primeMod}+3 { focus-workspace "${config.ws.w3}"; }
|
||||
${primeMod}+4 { focus-workspace "${config.ws.w4}"; }
|
||||
${primeMod}+5 { focus-workspace "${config.ws.w5}"; }
|
||||
${primeMod}+6 { focus-workspace "${config.ws.w6}"; }
|
||||
${primeMod}+7 { focus-workspace "${config.ws.w7}"; }
|
||||
${primeMod}+8 { focus-workspace "${config.ws.w8}"; }
|
||||
${primeMod}+9 { focus-workspace "${config.ws.w9}"; }
|
||||
|
||||
// Switch to alternate workspaces
|
||||
${secMod}+F1 { focus-workspace "${config.ws.w1a}"; }
|
||||
${secMod}+F2 { focus-workspace "${config.ws.w2a}"; }
|
||||
${secMod}+F3 { focus-workspace "${config.ws.w3a}"; }
|
||||
${secMod}+F4 { focus-workspace "${config.ws.w4a}"; }
|
||||
${secMod}+F5 { focus-workspace "${config.ws.w5a}"; }
|
||||
${secMod}+F6 { focus-workspace "${config.ws.w6a}"; }
|
||||
${secMod}+F7 { focus-workspace "${config.ws.w7a}"; }
|
||||
${secMod}+F8 { focus-workspace "${config.ws.w8a}"; }
|
||||
${secMod}+F9 { focus-workspace "${config.ws.w9a}"; }
|
||||
|
||||
// Move window to and focus workspace
|
||||
${primeMod}+Shift+grave { move-window-to-workspace "${config.ws.w0}"; }
|
||||
${primeMod}+Shift+1 { move-window-to-workspace "${config.ws.w1}"; }
|
||||
${primeMod}+Shift+2 { move-window-to-workspace "${config.ws.w2}"; }
|
||||
${primeMod}+Shift+3 { move-window-to-workspace "${config.ws.w3}"; }
|
||||
${primeMod}+Shift+4 { move-window-to-workspace "${config.ws.w4}"; }
|
||||
${primeMod}+Shift+5 { move-window-to-workspace "${config.ws.w5}"; }
|
||||
${primeMod}+Shift+6 { move-window-to-workspace "${config.ws.w6}"; }
|
||||
${primeMod}+Shift+7 { move-window-to-workspace "${config.ws.w7}"; }
|
||||
${primeMod}+Shift+8 { move-window-to-workspace "${config.ws.w8}"; }
|
||||
${primeMod}+Shift+9 { move-window-to-workspace "${config.ws.w9}"; }
|
||||
|
||||
// Move window to and focus workspace
|
||||
${secMod}+Shift+F1 { move-window-to-workspace "${config.ws.w1a}"; }
|
||||
${secMod}+Shift+F2 { move-window-to-workspace "${config.ws.w2a}"; }
|
||||
${secMod}+Shift+F3 { move-window-to-workspace "${config.ws.w3a}"; }
|
||||
${secMod}+Shift+F4 { move-window-to-workspace "${config.ws.w4a}"; }
|
||||
${secMod}+Shift+F5 { move-window-to-workspace "${config.ws.w5a}"; }
|
||||
${secMod}+Shift+F6 { move-window-to-workspace "${config.ws.w6a}"; }
|
||||
${secMod}+Shift+F7 { move-window-to-workspace "${config.ws.w7a}"; }
|
||||
${secMod}+Shift+F8 { move-window-to-workspace "${config.ws.w8a}"; }
|
||||
${secMod}+Shift+F9 { move-window-to-workspace "${config.ws.w9a}"; }
|
||||
|
||||
// Change focused window
|
||||
${primeMod}+h { focus-column-or-monitor-left; }
|
||||
${primeMod}+j { focus-window-down; }
|
||||
${primeMod}+k { focus-window-up; }
|
||||
${primeMod}+l { focus-column-or-monitor-right; }
|
||||
|
||||
// Move focused window
|
||||
${primeMod}+Shift+h { move-column-left-or-to-monitor-left; }
|
||||
${primeMod}+Shift+j { move-window-down; }
|
||||
${primeMod}+Shift+k { move-window-up; }
|
||||
${primeMod}+Shift+l { move-column-right-or-to-monitor-right; }
|
||||
|
||||
// Resize window
|
||||
${primeMod}+${secMod}+h { set-column-width "-${resizeAmount}%"; }
|
||||
${primeMod}+${secMod}+j { set-window-height "-${resizeAmount}%"; }
|
||||
${primeMod}+${secMod}+k { set-window-height "+${resizeAmount}%"; }
|
||||
${primeMod}+${secMod}+l { set-column-width "+${resizeAmount}%"; }
|
||||
|
||||
// There are also commands that consume or expel a single window to the side.
|
||||
${primeMod}+Ctrl+h { consume-or-expel-window-left; }
|
||||
${primeMod}+Ctrl+l { consume-or-expel-window-right; }
|
||||
|
||||
// Toggle fullscreen
|
||||
${primeMod}+f { maximize-column; }
|
||||
${primeMod}+Shift+f { fullscreen-window; }
|
||||
|
||||
// Niri specific
|
||||
${primeMod}+Shift+r { reset-window-height; }
|
||||
${primeMod}+Shift+c { center-column; }
|
||||
}
|
||||
'';
|
||||
}
|
20
modules/home/wms/niri/inputs/default.nix
Normal file
20
modules/home/wms/niri/inputs/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.inputs = pkgs.writeText "inputs" ''
|
||||
input {
|
||||
mouse {
|
||||
accel-profile "flat"
|
||||
accel-speed -0.9
|
||||
}
|
||||
touchpad {
|
||||
accel-profile "flat"
|
||||
scroll-method "two-finger"
|
||||
}
|
||||
trackpoint {
|
||||
off
|
||||
}
|
||||
warp-mouse-to-focus
|
||||
focus-follows-mouse
|
||||
}
|
||||
'';
|
||||
}
|
88
modules/home/wms/niri/outputs/default.nix
Normal file
88
modules/home/wms/niri/outputs/default.nix
Normal file
|
@ -0,0 +1,88 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.outputs = pkgs.writeText "outputs" ''
|
||||
// Workspace 1
|
||||
workspace "${config.ws.w0}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w1}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w2}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w3}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w1a}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w2a}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
workspace "${config.ws.w3a}" {
|
||||
open-on-output "${config.displays.d1}"
|
||||
}
|
||||
|
||||
// Workspace 2
|
||||
workspace "${config.ws.w4}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w5}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w6}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w4a}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
workspace "${config.ws.w5a}" {
|
||||
open-on-output "${config.displays.d2}"
|
||||
}
|
||||
|
||||
// Workspace 3
|
||||
workspace "${config.ws.w7}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w8}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w9}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w7a}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
workspace "${config.ws.w8a}" {
|
||||
open-on-output "${config.displays.d3}"
|
||||
}
|
||||
|
||||
// Workspace 4
|
||||
workspace "${config.ws.w6a}" {
|
||||
open-on-output "${config.displays.d4}"
|
||||
}
|
||||
workspace "${config.ws.w9a}" {
|
||||
open-on-output "${config.displays.d4}"
|
||||
}
|
||||
|
||||
// Monitors
|
||||
output "${config.displays.d1}" {
|
||||
mode "1920x1080@143.980"
|
||||
position x=3840 y=405
|
||||
}
|
||||
output "${config.displays.d2}" {
|
||||
mode "1920x1080@60"
|
||||
position x=1920 y=405
|
||||
}
|
||||
output "${config.displays.d3}" {
|
||||
mode "1680x1050@59.883"
|
||||
transform "90"
|
||||
position x=5760 y=0
|
||||
}
|
||||
output "${config.displays.d4}" {
|
||||
mode "1920x1080@60"
|
||||
position x=0 y=405
|
||||
}
|
||||
'';
|
||||
}
|
42
modules/home/wms/niri/rules/default.nix
Normal file
42
modules/home/wms/niri/rules/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
config.home.niri.settings.rules = pkgs.writeText "rules" ''
|
||||
// Browsers
|
||||
window-rule {
|
||||
match app-id="MainBrowser"
|
||||
open-on-workspace "${config.ws.w1}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="AltBrowser"
|
||||
open-on-workspace "${config.ws.w1a}"
|
||||
}
|
||||
|
||||
// Communication
|
||||
window-rule {
|
||||
match app-id="MiscBrowser"
|
||||
match app-id="vesktop"
|
||||
block-out-from "screencast"
|
||||
open-on-workspace "${config.ws.w7}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="org.gnome.Fractal"
|
||||
match app-id="org.telegram.desktop"
|
||||
open-on-workspace "${config.ws.w8}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="thunderbird"
|
||||
open-maximized true
|
||||
open-on-workspace "${config.ws.w9}"
|
||||
}
|
||||
|
||||
// Etc
|
||||
window-rule {
|
||||
match app-id="looking-glass-client"
|
||||
open-on-workspace "${config.ws.w2a}"
|
||||
}
|
||||
window-rule {
|
||||
match app-id="com.obsproject.Studio"
|
||||
open-on-workspace "${config.ws.w4a}"
|
||||
}
|
||||
'';
|
||||
}
|
14
modules/home/wms/niri/settings/default.nix
Normal file
14
modules/home/wms/niri/settings/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config.home.niri.settings.settings = pkgs.writeText "settings" ''
|
||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||
|
||||
hotkey-overlay {
|
||||
skip-at-startup
|
||||
}
|
||||
|
||||
environment {
|
||||
DISPLAY ":0"
|
||||
}
|
||||
'';
|
||||
}
|
22
modules/home/wms/niri/theme/default.nix
Normal file
22
modules/home/wms/niri/theme/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
config.home.niri.settings.theme = pkgs.writeText "theme" ''
|
||||
prefer-no-csd
|
||||
|
||||
layout {
|
||||
gaps 7
|
||||
center-focused-column "never"
|
||||
default-column-width { proportion 0.5; }
|
||||
|
||||
focus-ring {
|
||||
off
|
||||
}
|
||||
|
||||
border {
|
||||
width 3
|
||||
active-color "#${config.look.colors.prime}"
|
||||
inactive-color "#${config.look.colors.split}"
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
21
modules/home/wms/programs/default.nix
Normal file
21
modules/home/wms/programs/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hyprpaper
|
||||
./mako
|
||||
./swaylock
|
||||
./waybar
|
||||
./wlpicker
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
clipman
|
||||
hyprpicker
|
||||
libnotify
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
wdisplays
|
||||
jq
|
||||
];
|
||||
}
|
21
modules/home/wms/programs/hyprpaper/default.nix
Normal file
21
modules/home/wms/programs/hyprpaper/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [ hyprpaper ];
|
||||
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
settings = {
|
||||
splash = false;
|
||||
preload = [
|
||||
"~/.assets/wallpapers/1.png"
|
||||
"~/.assets/wallpapers/2.png"
|
||||
"~/.assets/wallpapers/3.png"
|
||||
];
|
||||
wallpaper = [
|
||||
",~/.assets/wallpapers/1.png"
|
||||
"${config.displays.d2},~/.assets/wallpapers/2.png"
|
||||
"${config.displays.d3},~/.assets/wallpapers/3.png"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
28
modules/home/wms/programs/mako/default.nix
Normal file
28
modules/home/wms/programs/mako/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./makotoggle
|
||||
];
|
||||
|
||||
services.mako = {
|
||||
enable = true;
|
||||
borderColor = "#${config.look.colors.accent}";
|
||||
backgroundColor = "#${config.look.colors.dark}D9";
|
||||
output = "${config.displays.d1}";
|
||||
sort = "+time";
|
||||
layer = "overlay";
|
||||
padding = "8";
|
||||
margin = "0";
|
||||
borderSize = config.look.border.int;
|
||||
maxIconSize = 40;
|
||||
defaultTimeout = 4500;
|
||||
font = "${config.look.fonts.main} 12";
|
||||
anchor = "bottom-right";
|
||||
extraConfig = ''
|
||||
on-button-right=dismiss-all
|
||||
outer-margin=10
|
||||
[mode=do-not-disturb]
|
||||
invisible=1
|
||||
'';
|
||||
};
|
||||
}
|
23
modules/home/wms/programs/mako/makotoggle/default.nix
Normal file
23
modules/home/wms/programs/mako/makotoggle/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.writeScriptBin "makotoggle" ''
|
||||
# Run makoctl mode and store the output in a variable
|
||||
mode_output=$(makoctl mode)
|
||||
|
||||
# Extract the second line after "default"
|
||||
mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}')
|
||||
|
||||
if [[ "$mode_line" == "do-not-disturb" ]]; then
|
||||
# Notifications are disabled, so we enable them
|
||||
makoctl mode -r do-not-disturb
|
||||
notify-send --expire-time=1500 'Notifications Enabled'
|
||||
else
|
||||
# Notifications are enabled, so we disable them
|
||||
notify-send --expire-time=1500 'Notifications Disabled'
|
||||
sleep 2
|
||||
makoctl mode -a do-not-disturb
|
||||
fi
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
programs.waybar = let
|
||||
swayWorkspacesModule = {
|
||||
swayWorkspaceModule = {
|
||||
format = "{name}";
|
||||
enable-bar-scroll = true;
|
||||
warp-on-scroll = false;
|
||||
|
@ -207,6 +207,8 @@
|
|||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
"niri/workspaces"
|
||||
"niri/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
|
@ -220,8 +222,9 @@
|
|||
"bluetooth"
|
||||
"network"
|
||||
];
|
||||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/workspaces" = swayWorkspaceModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"niri/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"cpu" = cpuModule;
|
||||
"memory" = ramModule;
|
||||
|
@ -241,6 +244,8 @@
|
|||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
"niri/workspaces"
|
||||
"niri/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
|
@ -251,8 +256,9 @@
|
|||
"custom/vram"
|
||||
"custom/clock-long"
|
||||
];
|
||||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/workspaces" = swayWorkspaceModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"niri/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"mpd" = mediaModule;
|
||||
"custom/notifs" = notificationModule;
|
||||
|
@ -269,6 +275,8 @@
|
|||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
"niri/workspaces"
|
||||
"niri/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
|
@ -278,8 +286,9 @@
|
|||
"custom/vram"
|
||||
"custom/clock-short"
|
||||
];
|
||||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/workspaces" = swayWorkspaceModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"niri/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"custom/weather" = weatherModule;
|
||||
"cpu" = cpuModule;
|
||||
|
@ -300,6 +309,8 @@
|
|||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
"niri/workspaces"
|
||||
"niri/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
|
@ -318,8 +329,9 @@
|
|||
"bluetooth"
|
||||
"network"
|
||||
];
|
||||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/workspaces" = swayWorkspaceModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"niri/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"mpd" = mediaModule;
|
||||
"custom/notifs" = notificationModule;
|
||||
|
@ -370,7 +382,7 @@
|
|||
border-bottom: 3px solid transparent;
|
||||
min-width: 20px;
|
||||
}
|
||||
#workspaces button.visible {
|
||||
#workspaces button.visible, #workspaces button.active {
|
||||
border-bottom: 3px solid #${config.look.colors.prime};
|
||||
background: #${config.look.colors.mid};
|
||||
}
|
15
modules/home/wms/programs/wlpicker/default.nix
Normal file
15
modules/home/wms/programs/wlpicker/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.writeScriptBin "wlpicker" ''
|
||||
# Get color position
|
||||
position=$(slurp -b 00000000 -p)
|
||||
|
||||
# Sleep to prevet grim always returning improper color
|
||||
sleep 1
|
||||
|
||||
# Store the hex color value using imagemagick
|
||||
grim -g "$position" -t png - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n 1 | cut -d ' ' -f 4 | wl-copy -n
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -4,16 +4,13 @@
|
|||
bars = [{ command = "waybar"; }];
|
||||
|
||||
startup = [
|
||||
# Lock on startup
|
||||
{ command = "swaylock"; }
|
||||
|
||||
# Scratchpads
|
||||
{ command = "foot -a gotop -T Gotop gotop"; }
|
||||
{ command = "foot -a music -T Music ncmpcpp"; }
|
||||
{ command = "foot -a sound -T Sound pulsemixer"; }
|
||||
{ command = "easyeffects"; }
|
||||
|
||||
# Daemons and tray apps
|
||||
{ command = "hyprpaper"; }
|
||||
{ command = "wl-paste -t text --watch clipman store -P"; }
|
||||
{ command = "wl-copy"; }
|
||||
{ command = "mako"; }
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
{
|
||||
imports = [
|
||||
./autostart
|
||||
./hardware
|
||||
./hotkeys
|
||||
./inputs
|
||||
./outputs
|
||||
./programs
|
||||
./rules
|
||||
./theme
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
wayland.windowManager.sway.config = {
|
||||
# Define monitors
|
||||
output = {
|
||||
${config.displays.d1} = {
|
||||
pos = "3840 405";
|
||||
mode = "1920x1080@143.980Hz";
|
||||
max_render_time = "3";
|
||||
bg = "~/.assets/wallpapers/1.png fill";
|
||||
adaptive_sync = "on";
|
||||
};
|
||||
${config.displays.d2} = {
|
||||
pos = "1920 405";
|
||||
mode = "1920x1080@60Hz";
|
||||
max_render_time = "3";
|
||||
bg = "~/.assets/wallpapers/2.png fill";
|
||||
};
|
||||
${config.displays.d3} = {
|
||||
pos = "5760 0";
|
||||
mode = "1680x1050@59.883Hz";
|
||||
transform = "270";
|
||||
max_render_time = "3";
|
||||
bg = "~/.assets/wallpapers/3.png fill";
|
||||
};
|
||||
${config.displays.d4} = {
|
||||
pos = "0 405";
|
||||
mode = "1920x1080@60Hz";
|
||||
max_render_time = "3";
|
||||
};
|
||||
"*" = {
|
||||
bg = "~/.assets/wallpapers/1.png fill";
|
||||
};
|
||||
};
|
||||
|
||||
# HID device config
|
||||
input = {
|
||||
"9610:4103:SINOWEALTH_Game_Mouse" = {
|
||||
pointer_accel = "-0.9";
|
||||
};
|
||||
"9639:64097:Compx_2.4G_Receiver_Mouse" = {
|
||||
pointer_accel = "-0.82";
|
||||
};
|
||||
"1452:627:bcm5974" = {
|
||||
scroll_factor = "0.3";
|
||||
};
|
||||
"*" = {
|
||||
accel_profile = "flat";
|
||||
dwt = "disabled";
|
||||
natural_scroll = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,120 +5,66 @@
|
|||
primeMod = "Mod4";
|
||||
secMod = "Mod1";
|
||||
resizeAmount = "55";
|
||||
sendNotif = "notify-send --expire-time=1500";
|
||||
in {
|
||||
# Hotkeys
|
||||
modifier = "${primeMod}";
|
||||
keybindings = let
|
||||
# Define scripts specific to Sway
|
||||
pinWindow = pkgs.writeScript "pin-window" ''
|
||||
# Get the current border style of the focused window
|
||||
current_style=$(swaymsg -t get_tree | jq -r '.. | select(.focused?).border')
|
||||
keybindings = {
|
||||
## Launchers
|
||||
|
||||
# Toggle between "normal" (default) and "pixel ${config.look.border.string}" border styles
|
||||
if [ "$current_style" == "none" ]; then
|
||||
swaymsg "sticky disable, border pixel ${config.look.border.string}"
|
||||
else
|
||||
swaymsg "sticky enable, border none"
|
||||
fi
|
||||
'';
|
||||
# Browser profiles
|
||||
"${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"'';
|
||||
|
||||
# Kill a window or probe it for info
|
||||
swayTools = pkgs.writeScript "swaytools" ''
|
||||
# List the app name and whether or not it uses wayland
|
||||
swayprop() {
|
||||
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
|
||||
}
|
||||
# Virtual machines
|
||||
"${primeMod}+F4" = ''exec virt-manager | notify-send "Virtual Machines"'';
|
||||
"${primeMod}+F5" = ''exec looking-glass-client input:rawMouse=yes | notify-send "Looking Glass"'';
|
||||
|
||||
# Kill a selected window
|
||||
swaykill() {
|
||||
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
|
||||
}
|
||||
|
||||
# Handle which tool we use
|
||||
if [ "$1" == "--prop" ]; then
|
||||
swayprop
|
||||
elif [ "$1" == "--kill" ]; then
|
||||
swaykill
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
## Launcher keys
|
||||
|
||||
# LibreWolf profiles
|
||||
"${primeMod}+F1" = ''exec librewolf -P Main --name=MainBrowser | ${sendNotif} "Main Browser"'';
|
||||
"${primeMod}+F2" = ''exec librewolf -P Alt --name=AltBrowser | ${sendNotif} "Alternate Browser"'';
|
||||
"${primeMod}+F3" = ''exec librewolf -P Misc --name=MiscBrowser | ${sendNotif} "Miscellaneous Browser"'';
|
||||
|
||||
# Virtual Machines
|
||||
"${primeMod}+F4" = ''exec virt-manager | ${sendNotif} "Virtual Machines"'';
|
||||
"${primeMod}+F5" = ''exec looking-glass-client input:rawMouse=yes | ${sendNotif} "Looking Glass"'';
|
||||
|
||||
# BeMenu scripts
|
||||
"${primeMod}+${secMod}+s" = ''exec rofiscripts --scratchpads'';
|
||||
"${primeMod}+${secMod}+r" = ''exec rofiscripts --resolutions'';
|
||||
|
||||
# Mod + Key
|
||||
# Mod + 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'';
|
||||
"${primeMod}+Escape" = ''exec ${swayTools} --kill'';
|
||||
"${primeMod}+Delete" = ''exec foot ranger /etc/nixos | ${sendNotif} "Nix Config"'';
|
||||
"${primeMod}+Escape" = ''exec swaytools --kill'';
|
||||
|
||||
# Mod + shift + key
|
||||
"${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history'';
|
||||
"${primeMod}+Shift+t" = ''exec pcmanfm-qt'';
|
||||
"${primeMod}+Shift+e" = ''exec BEMOJI_PICKER_CMD="rofi -dmenu -i -p Emoji" bemoji -n -P 0'';
|
||||
"${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'';
|
||||
|
||||
# Mod + ctrl + key
|
||||
"${primeMod}+Ctrl+x" = ''exec ${swayTools} --prop'';
|
||||
"${primeMod}+Ctrl+c" = ''exec ${pkgs.hyprpicker}/bin/hyprpicker -an && ${sendNotif} "Color copied to clipboard"'';
|
||||
"${primeMod}+Ctrl+Prior" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Main"'';
|
||||
"${primeMod}+Ctrl+Next" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Guest"'';
|
||||
"${primeMod}+Ctrl+x" = ''exec swaytools --prop'';
|
||||
"${primeMod}+Ctrl+s" = ''exec rofiscripts --scratchpads'';
|
||||
"${primeMod}+Ctrl+c" = ''exec wlpicker && notify-send "Color copied to clipboard"'';
|
||||
|
||||
## Media keys
|
||||
## Media
|
||||
|
||||
# Volume control
|
||||
# Volume
|
||||
"${secMod}+j" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-'';
|
||||
"${secMod}+k" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+'';
|
||||
|
||||
# MPD Controls
|
||||
# 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'';
|
||||
|
||||
## Notification keys
|
||||
## Miscellaneous
|
||||
|
||||
# Toggle mako
|
||||
# Notifications
|
||||
"${primeMod}+n" = ''exec makotoggle'';
|
||||
"${primeMod}+Shift+n" = ''exec makoctl restore'';
|
||||
"${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a'';
|
||||
|
||||
## Miscellaneous keys
|
||||
|
||||
# Screenshots
|
||||
"${secMod}+f" = ''exec swayshot --swappy'';
|
||||
"${secMod}+Shift+f" = ''exec swayshot --screen'';
|
||||
|
||||
# SSH
|
||||
"${primeMod}+${secMod}+Return" = ''exec foot ssh ${config.ips.server}'';
|
||||
|
||||
# Display Brightness and Keyboard Brightness
|
||||
# Display and keyboard brightness
|
||||
"${primeMod}+equal" = ''exec light -A 5'';
|
||||
"${primeMod}+minus" = ''exec light -U 5'';
|
||||
"${primeMod}+Shift+equal" = ''exec light -A 1'';
|
||||
|
@ -126,7 +72,7 @@
|
|||
"XF86KbdBrightnessUp" = ''exec light -s sysfs/leds/smc::kbd_backlight -A 5'';
|
||||
"XF86KbdBrightnessDown" = ''exec light -s sysfs/leds/smc::kbd_backlight -U 5'';
|
||||
|
||||
## Window manager keys
|
||||
## Window manager
|
||||
"${primeMod}+q" = ''kill'';
|
||||
"${primeMod}+Shift+r" = ''reload'';
|
||||
|
||||
|
@ -153,7 +99,7 @@
|
|||
"${secMod}+F8" = ''workspace ${config.ws.w8a}'';
|
||||
"${secMod}+F9" = ''workspace ${config.ws.w9a}'';
|
||||
|
||||
# Move window to and focus new workspace
|
||||
# Move window to and focus workspace
|
||||
"${primeMod}+Shift+grave" = ''move container to workspace ${config.ws.w0}; workspace ${config.ws.w0}'';
|
||||
"${primeMod}+Shift+1" = ''move container to workspace ${config.ws.w1}; workspace ${config.ws.w1}'';
|
||||
"${primeMod}+Shift+2" = ''move container to workspace ${config.ws.w2}; workspace ${config.ws.w2}'';
|
||||
|
@ -165,7 +111,7 @@
|
|||
"${primeMod}+Shift+8" = ''move container to workspace ${config.ws.w8}; workspace ${config.ws.w8}'';
|
||||
"${primeMod}+Shift+9" = ''move container to workspace ${config.ws.w9}; workspace ${config.ws.w9}'';
|
||||
|
||||
# Move window to and focus new alternate workspace
|
||||
# Move window to and focus alternate workspace
|
||||
"${secMod}+Shift+F1" = ''move container to workspace ${config.ws.w1a}; workspace ${config.ws.w1a}'';
|
||||
"${secMod}+Shift+F2" = ''move container to workspace ${config.ws.w2a}; workspace ${config.ws.w2a}'';
|
||||
"${secMod}+Shift+F3" = ''move container to workspace ${config.ws.w3a}; workspace ${config.ws.w3a}'';
|
||||
|
@ -176,31 +122,28 @@
|
|||
"${secMod}+Shift+F8" = ''move container to workspace ${config.ws.w8a}; workspace ${config.ws.w8a}'';
|
||||
"${secMod}+Shift+F9" = ''move container to workspace ${config.ws.w9a}; workspace ${config.ws.w9a}'';
|
||||
|
||||
# Change focus across windows
|
||||
# Change focused window
|
||||
"${primeMod}+h" = ''focus left'';
|
||||
"${primeMod}+j" = ''focus down'';
|
||||
"${primeMod}+k" = ''focus up'';
|
||||
"${primeMod}+l" = ''focus right'';
|
||||
|
||||
# Resize windows
|
||||
"${primeMod}+${secMod}+h" = ''resize shrink width ${resizeAmount} px or 5 ppt'';
|
||||
"${primeMod}+${secMod}+j" = ''resize shrink 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'';
|
||||
|
||||
# Move focused window
|
||||
"${primeMod}+Shift+h" = ''move left ${resizeAmount} px'';
|
||||
"${primeMod}+Shift+j" = ''move down ${resizeAmount} px'';
|
||||
"${primeMod}+Shift+k" = ''move up ${resizeAmount} px'';
|
||||
"${primeMod}+Shift+l" = ''move right ${resizeAmount} px'';
|
||||
|
||||
# Resize window
|
||||
"${primeMod}+${secMod}+h" = ''resize shrink width ${resizeAmount} px or 5 ppt'';
|
||||
"${primeMod}+${secMod}+j" = ''resize shrink 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'';
|
||||
|
||||
# Change focus between floating/tiled, toggle floating
|
||||
"${primeMod}+space" = ''focus mode_toggle'';
|
||||
"${primeMod}+Shift+space" = ''floating toggle'';
|
||||
|
||||
# Allow a window to be visible on all workspaces, toggle border
|
||||
"${primeMod}+0" = ''exec ${pinWindow}'';
|
||||
|
||||
# Toggle fullscreen
|
||||
"${primeMod}+f" = ''fullscreen toggle'';
|
||||
"${primeMod}+${secMod}+Ctrl+f" = ''fullscreen toggle global'';
|
||||
|
@ -220,7 +163,6 @@
|
|||
"Shift+Ctrl+Backslash" = ''[app_id="gotop"] scratchpad show, move position center, resize set 1216 888'';
|
||||
"${primeMod}+Shift+m" = ''[app_id="music"] scratchpad show, move position center, resize set 1006 657'';
|
||||
"${primeMod}+Shift+v" = ''[app_id="sound"] scratchpad show, move position center, resize set 1000 800'';
|
||||
"${primeMod}+Shift+Backslash" = ''[app_id="com.github.wwmm.easyeffects"] scratchpad show, move position center, resize set 1000 800'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
20
modules/home/wms/sway/inputs/default.nix
Normal file
20
modules/home/wms/sway/inputs/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
# HID devices
|
||||
wayland.windowManager.sway.config.input = {
|
||||
"9610:4103:SINOWEALTH_Game_Mouse" = {
|
||||
pointer_accel = "-0.9";
|
||||
};
|
||||
"9639:64097:Compx_2.4G_Receiver_Mouse" = {
|
||||
pointer_accel = "-0.82";
|
||||
};
|
||||
"1452:627:bcm5974" = {
|
||||
scroll_factor = "0.3";
|
||||
};
|
||||
"*" = {
|
||||
accel_profile = "flat";
|
||||
dwt = "disabled";
|
||||
natural_scroll = "disabled";
|
||||
};
|
||||
};
|
||||
}
|
70
modules/home/wms/sway/outputs/default.nix
Normal file
70
modules/home/wms/sway/outputs/default.nix
Normal file
|
@ -0,0 +1,70 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
# Monitors
|
||||
wayland.windowManager.sway.config = {
|
||||
workspaceOutputAssign = let
|
||||
workspaces1 = [
|
||||
"${config.ws.w0}"
|
||||
"${config.ws.w1}"
|
||||
"${config.ws.w2}"
|
||||
"${config.ws.w3}"
|
||||
"${config.ws.w1a}"
|
||||
"${config.ws.w2a}"
|
||||
"${config.ws.w3a}"
|
||||
];
|
||||
workspaces2 = [
|
||||
"${config.ws.w4}"
|
||||
"${config.ws.w5}"
|
||||
"${config.ws.w6}"
|
||||
"${config.ws.w4a}"
|
||||
"${config.ws.w5a}"
|
||||
];
|
||||
workspaces3 = [
|
||||
"${config.ws.w7}"
|
||||
"${config.ws.w8}"
|
||||
"${config.ws.w9}"
|
||||
"${config.ws.w7a}"
|
||||
"${config.ws.w8a}"
|
||||
];
|
||||
workspaces4 = [
|
||||
"${config.ws.w6a}"
|
||||
"${config.ws.w9a}"
|
||||
];
|
||||
assign = output: workspaces:
|
||||
map (workspace: {
|
||||
inherit workspace;
|
||||
inherit output;
|
||||
})
|
||||
workspaces;
|
||||
in
|
||||
(assign "${config.displays.d1}" workspaces1) ++
|
||||
(assign "${config.displays.d2}" workspaces2) ++
|
||||
(assign "${config.displays.d3}" workspaces3) ++
|
||||
(assign "${config.displays.d4}" workspaces4);
|
||||
|
||||
output = {
|
||||
${config.displays.d1} = {
|
||||
pos = "3840 405";
|
||||
mode = "1920x1080@143.980Hz";
|
||||
max_render_time = "3";
|
||||
adaptive_sync = "on";
|
||||
};
|
||||
${config.displays.d2} = {
|
||||
pos = "1920 405";
|
||||
mode = "1920x1080@60Hz";
|
||||
max_render_time = "3";
|
||||
};
|
||||
${config.displays.d3} = {
|
||||
pos = "5760 0";
|
||||
mode = "1680x1050@59.883Hz";
|
||||
transform = "270";
|
||||
max_render_time = "3";
|
||||
};
|
||||
${config.displays.d4} = {
|
||||
pos = "0 405";
|
||||
mode = "1920x1080@60Hz";
|
||||
max_render_time = "3";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -3,16 +3,6 @@
|
|||
imports = [
|
||||
./swayshot
|
||||
./swaysleep
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
clipman
|
||||
swaybg
|
||||
libnotify
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
wdisplays
|
||||
jq
|
||||
./swaytools
|
||||
];
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.writeScriptBin "swayshot" ''
|
||||
handle_swappy() {
|
||||
swappy() {
|
||||
# Create an imv window to act as a static screen
|
||||
grim -t jpeg -q 90 - | imv -w "GlobalShot" - & imv_pid=$!
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
|||
rm "$temp_file"
|
||||
}
|
||||
|
||||
handle_screen() {
|
||||
screen() {
|
||||
temp_file=$(mktemp -u).png
|
||||
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') "$temp_file"
|
||||
|
||||
|
@ -33,9 +33,9 @@
|
|||
}
|
||||
|
||||
if [ "$1" == "--swappy" ]; then
|
||||
handle_swappy
|
||||
swappy
|
||||
elif [ "$1" == "--screen" ]; then
|
||||
handle_screen
|
||||
screen
|
||||
else
|
||||
echo "Please use the arguments --swappy or --screen."
|
||||
fi
|
||||
|
|
33
modules/home/wms/sway/programs/swaytools/default.nix
Normal file
33
modules/home/wms/sway/programs/swaytools/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.writeScriptBin "swaytools" ''
|
||||
# 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
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -1,48 +1,6 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
wayland.windowManager.sway.config = {
|
||||
# Assign workspaces to config
|
||||
workspaceOutputAssign = let
|
||||
workspaces1 = [
|
||||
"${config.ws.w0}"
|
||||
"${config.ws.w1}"
|
||||
"${config.ws.w2}"
|
||||
"${config.ws.w3}"
|
||||
"${config.ws.w1a}"
|
||||
"${config.ws.w2a}"
|
||||
"${config.ws.w3a}"
|
||||
];
|
||||
workspaces2 = [
|
||||
"${config.ws.w4}"
|
||||
"${config.ws.w5}"
|
||||
"${config.ws.w6}"
|
||||
"${config.ws.w4a}"
|
||||
"${config.ws.w5a}"
|
||||
];
|
||||
workspaces3 = [
|
||||
"${config.ws.w7}"
|
||||
"${config.ws.w8}"
|
||||
"${config.ws.w9}"
|
||||
"${config.ws.w7a}"
|
||||
"${config.ws.w8a}"
|
||||
];
|
||||
workspaces4 = [
|
||||
"${config.ws.w6a}"
|
||||
"${config.ws.w9a}"
|
||||
];
|
||||
assign = output: workspaces:
|
||||
map (workspace: {
|
||||
inherit workspace;
|
||||
inherit output;
|
||||
})
|
||||
workspaces;
|
||||
in
|
||||
(assign "${config.displays.d1}" workspaces1) ++
|
||||
(assign "${config.displays.d2}" workspaces2) ++
|
||||
(assign "${config.displays.d3}" workspaces3) ++
|
||||
(assign "${config.displays.d4}" workspaces4);
|
||||
|
||||
# Rules
|
||||
defaultWorkspace = config.ws.w1;
|
||||
|
||||
window = {
|
||||
|
@ -66,10 +24,6 @@
|
|||
criteria = { app_id = "sound"; };
|
||||
command = ''mark scratchpad'';
|
||||
}
|
||||
{
|
||||
criteria = { app_id = "com.github.wwmm.easyeffects"; };
|
||||
command = ''mark scratchpad, opacity 0.9'';
|
||||
}
|
||||
|
||||
# Give apps that don't have them borders
|
||||
{
|
||||
|
@ -114,7 +68,6 @@
|
|||
"${config.ws.w1a}" = [{ app_id = "AltBrowser"; }];
|
||||
|
||||
# Communication
|
||||
"${config.ws.w3a}" = [{ class = "zoom"; }];
|
||||
"${config.ws.w7}" = [
|
||||
{ app_id = "MiscBrowser"; }
|
||||
{ app_id = "vesktop"; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue