feat: sway & i3 overhaul

This commit is contained in:
winston 2023-03-28 12:59:48 +02:00
parent a6531caa7f
commit ae60d53eba
Signed by: winston
GPG key ID: 3786770EDBC2B481
9 changed files with 118 additions and 124 deletions

1
.gitattributes vendored
View file

@ -1,3 +1,4 @@
flake.lock -diff flake.lock -diff
home/secrets/**/*.json -diff home/secrets/**/*.json -diff
lazy-lock.json -diff lazy-lock.json -diff
*.png filter=lfs diff=lfs merge=lfs -text

View file

@ -111,11 +111,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1679684476, "lastModified": 1679786039,
"narHash": "sha256-WTYZFt9cJmOSp1n3hxAS+BQnu7smcBsC98RSgdp2qsE=", "narHash": "sha256-VNjswu0Q4bZOkWNuc0+dHvRdjUCj+MnDlRfw/Q0R3vI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "db37c537603d1d45d022cc0666ad45197455b364", "rev": "cf662b6c98a0da81e06066fff0ecf9cbd4627727",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -146,11 +146,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1679472241, "lastModified": 1679748960,
"narHash": "sha256-VK2YDic2NjPvfsuneJCLIrWS38qUfoW8rLLimx0rWXA=", "narHash": "sha256-BP8XcYHyj1NxQi04RpyNW8e7KiXSoI+Fy1tXIK2GfdA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9ef6e7727f4c31507627815d4f8679c5841efb00", "rev": "da26ae9f6ce2c9ab380c0f394488892616fc5a6a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -160,22 +160,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-master": {
"locked": {
"lastModified": 1679784606,
"narHash": "sha256-n5wGxz4KN90Wv00PgH1R1ZxaSDmdPeZ/rA9+FKM5mPo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2f0ff93fcff3f9675a7c6875742e7d16ad0d80a3",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1678872516, "lastModified": 1678872516,
@ -194,11 +178,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1679163677, "lastModified": 1679748960,
"narHash": "sha256-VC0tc3EjJZFPXgucFQAYMIHce5nJWYR0kVCk4TVg6gg=", "narHash": "sha256-BP8XcYHyj1NxQi04RpyNW8e7KiXSoI+Fy1tXIK2GfdA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c3912035d00ef755ab19394488b41feab95d2e40", "rev": "da26ae9f6ce2c9ab380c0f394488892616fc5a6a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -210,11 +194,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1679614379, "lastModified": 1679793451,
"narHash": "sha256-2KddLHHmcIlJu0PuS/vISLKxihTyICUwKWGn0R//028=", "narHash": "sha256-JafTtgMDATE8dZOImBhWMA9RCn9AP8FVOpN+9K/tTlg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "994e2ef9e9c70b4dd7257f73452a94e871723685", "rev": "0cd51a933d91078775b300cf0f29aa3495231aa2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -242,11 +226,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1678987615, "lastModified": 1679734080,
"narHash": "sha256-lF4agoB7ysQGNHRXvOqxtSKIZrUZwClA85aASahQlYM=", "narHash": "sha256-z846xfGLlon6t9lqUzlNtBOmsgQLQIZvR6Lt2dImk1M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "194c2aa446b2b059886bb68be15ef6736d5a8c31", "rev": "dbf5322e93bcc6cfc52268367a8ad21c09d76fea",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -274,11 +258,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1679694339, "lastModified": 1679974621,
"narHash": "sha256-KkoBTJK7XBUVWGYPFh4cHys2NHO6p5Jh5NLP1KYA+AQ=", "narHash": "sha256-oKr2h7gH6xOwr8pQs0EEJelQ1vddfqs2SLWuZVSTIOs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "2cd23c2a269fd3ebbb3a312e19e2e56ad770da7f", "rev": "56069a9944ea44cc1bb7fe2459b4ec5afa696611",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -316,7 +300,6 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"nekowinston-nur": "nekowinston-nur", "nekowinston-nur": "nekowinston-nur",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur", "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
@ -330,11 +313,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1679377997, "lastModified": 1679799335,
"narHash": "sha256-O8rmc/b/qgNgoHj2tL5+3Ovkj7A+Sok7gazRoWbpnqg=", "narHash": "sha256-YrnDyftm0Mk4JLuw3sDBPNfSjk054N0dqQx8FW4JqDM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "d8827a8368c307fbc6ed594c9a31d619e7360bed", "rev": "4740f80ca6e756915aaaa0a9c5fbb61ba09cc145",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -349,11 +332,11 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1679331631, "lastModified": 1679872473,
"narHash": "sha256-tMoiwFO/AVTV7GoGMSu3XQimFnK8vv3yzf+D41kTJoE=", "narHash": "sha256-N9DbdFj4iehocp/Ysb29+UTbUGEdwjZNWGbeaFL9hQ4=",
"owner": "willpower3309", "owner": "willpower3309",
"repo": "swayfx", "repo": "swayfx",
"rev": "7d5d7a3022eb17835cea7af7290b1a5d2fe4b03a", "rev": "4d1af6500491bdc301b590916fd04f5d8ec6a2c2",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -4,7 +4,6 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
darwin = { darwin = {
url = "github:lnl7/nix-darwin"; url = "github:lnl7/nix-darwin";
@ -34,7 +33,6 @@
nekowinston-nur, nekowinston-nur,
nixpkgs, nixpkgs,
nixpkgs-unstable, nixpkgs-unstable,
nixpkgs-master,
nur, nur,
pre-commit-hooks, pre-commit-hooks,
sops, sops,
@ -46,10 +44,6 @@
system = prev.system; system = prev.system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
master = import nixpkgs-master {
system = prev.system;
config.allowUnfree = true;
};
nur = import nur { nur = import nur {
nurpkgs = prev; nurpkgs = prev;
pkgs = prev; pkgs = prev;

View file

@ -27,6 +27,9 @@
{ {
command = "${lib.getExe pkgs._1password-gui} --silent"; command = "${lib.getExe pkgs._1password-gui} --silent";
} }
{
command = "${pkgs.volnoti}/bin/volnoti";
}
]; ];
workspaceAutoBackAndForth = true; workspaceAutoBackAndForth = true;
terminal = "wezterm start --always-new-process"; terminal = "wezterm start --always-new-process";
@ -46,9 +49,24 @@
screenshot = screenshot =
if wayland if wayland
then "${lib.getExe pkgs.sway-contrib.grimshot} copy area" then "${lib.getExe pkgs.sway-contrib.grimshot} copy area"
else "${lib.getExe pkgs.flameshot} gui"; else "${pkgs.flameshot}/bin/flameshot gui";
playerctl = lib.getExe pkgs.playerctl; playerctl = lib.getExe pkgs.playerctl;
wpctl = pkgs.wireplumber + "/bin/wpctl"; wpctl = pkgs.wireplumber + "/bin/wpctl";
volnotify = pkgs.writeShellScript "volnotify" ''
volumeRaw=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | head -n1)
volume=$(echo $volumeRaw | sed 's/Volume: //' | awk '{printf "%.0f\n", $1 * 100}')
if [[ "$volumeRaw" =~ "MUTED" ]]; then
volnoti-show -m
else
volnoti-show $volume
fi
'';
gopassRofi = pkgs.writeShellScript "gopass-rofi" ''
${gopass} ls --flat | \
${rofi} -dmenu -dpi $dpi | \
${xargs} --no-run-if-empty ${gopass} show -o | \
${xdotool} type --clearmodifiers --file -
'';
in { in {
"${mod}+Shift+b" = "border none"; "${mod}+Shift+b" = "border none";
"${mod}+b" = "border pixel 2"; "${mod}+b" = "border pixel 2";
@ -62,8 +80,8 @@
"${mod}+e" = "exec --no-startup-id ${thunar}"; "${mod}+e" = "exec --no-startup-id ${thunar}";
"${mod}+Ctrl+x" = "exec --no-startup-id ${lib.getExe pkgs.xorg.xkill}"; "${mod}+Ctrl+x" = "exec --no-startup-id ${lib.getExe pkgs.xorg.xkill}";
# TODO: replace xdotool with wayland equivalent # TODO: replace xdotool with wayland equivalent
"${hyper}+space" = "exec --no-startup-id ${gopass} ls --flat | ${rofi} -dmenu -dpi $dpi | ${xargs} --no-run-if-empty ${gopass} show -o | ${xdotool} type --clearmodifiers --file -"; "${hyper}+space" = "exec --no-startup-id ${gopassRofi}";
"${hyper}+p" = "--release exec --no-startup-id ${screenshot}"; "${hyper}+p" = "exec --no-startup-id ${screenshot}";
# change focus # change focus
"${modFocus}+h" = "focus left"; "${modFocus}+h" = "focus left";
@ -143,9 +161,9 @@
"${mod}+Shift+space" = "exec ${lib.getExe pkgs._1password-gui} --quick-access"; "${mod}+Shift+space" = "exec ${lib.getExe pkgs._1password-gui} --quick-access";
# audio # audio
"XF86AudioRaiseVolume" = "exec --no-startup-id ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0"; "XF86AudioRaiseVolume" = "exec --no-startup-id ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0 && ${volnotify}";
"XF86AudioLowerVolume" = "exec --no-startup-id ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0"; "XF86AudioLowerVolume" = "exec --no-startup-id ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0 && ${volnotify}";
"XF86AudioMute" = "exec --no-startup-id ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"; "XF86AudioMute" = "exec --no-startup-id ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle && ${volnotify}";
"XF86AudioNext" = "exec --no-startup-id ${playerctl} next"; "XF86AudioNext" = "exec --no-startup-id ${playerctl} next";
"XF86AudioPrev" = "exec --no-startup-id ${playerctl} previous"; "XF86AudioPrev" = "exec --no-startup-id ${playerctl} previous";
"XF86AudioPause" = "exec --no-startup-id ${playerctl} play-pause"; "XF86AudioPause" = "exec --no-startup-id ${playerctl} play-pause";
@ -190,8 +208,6 @@
mode = "hide"; mode = "hide";
# use waybar if wayland # use waybar if wayland
command = lib.mkIf wayland "${lib.getExe config.programs.waybar.package}"; command = lib.mkIf wayland "${lib.getExe config.programs.waybar.package}";
# otherwise use i3status-rust
statusCommand = lib.mkIf (!wayland) "${config.programs.i3status-rust.package}/bin/i3status-rs ${config.xdg.configHome}/i3status-rust/config-default.toml";
position = "top"; position = "top";
workspaceNumbers = false; workspaceNumbers = false;
inherit fonts; inherit fonts;
@ -331,70 +347,22 @@ in {
packages = with pkgs; [ packages = with pkgs; [
arandr arandr
blueberry blueberry
flameshot
pavucontrol pavucontrol
sway-contrib.grimshot
volnoti
xclip xclip
]; ];
}; };
programs = lib.mkIf isLinux {
i3status-rust = {
enable = true;
bars.default = {
blocks = [
{
block = "taskwarrior";
data_location = config.programs.taskwarrior.dataLocation;
}
{
block = "pomodoro";
notifier = "notifysend";
notifier_path = "${lib.getExe pkgs.libnotify}";
}
{
block = "sound";
max_vol = 100;
on_click = "${lib.getExe pkgs.pavucontrol}";
}
{
block = "time";
interval = 5;
format = "%R";
}
];
settings = {
icons.name = "material-nf";
icons.overrides = {
pomodoro = " ";
pomodoro_break = " ";
};
theme.overrides = {
idle_fg = "#cdd6f4";
info_fg = "#89b4fa";
good_fg = "#a6e3a1";
warning_fg = "#fab387";
critical_fg = "#f38ba8";
separator = " ";
separator_bg = "auto";
separator_fg = "auto";
};
};
};
};
zathura.enable = true;
};
services = lib.mkIf isLinux { services = lib.mkIf isLinux {
dunst.enable = true; dunst.enable = true;
flameshot = {
enable = true;
settings.General.showStartupLaunchMessage = false;
};
gnome-keyring = { gnome-keyring = {
enable = true; enable = true;
components = ["secrets"]; components = ["secrets"];
}; };
picom = { picom = {
enable = true; enable = false;
package = pkgs.nur.repos.nekowinston.picom-ft-labs; package = pkgs.nur.repos.nekowinston.picom-ft-labs;
fade = false; fade = false;
backend = "glx"; backend = "glx";
@ -425,13 +393,8 @@ in {
]; ];
}; };
}; };
redshift = {
enable = true;
latitude = 48.2;
longitude = 16.366667;
};
screen-locker = { screen-locker = {
enable = true; enable = false;
inactiveInterval = 5; inactiveInterval = 5;
lockCmd = "${lib.getExe pkgs.i3lock} -n -c 000000"; lockCmd = "${lib.getExe pkgs.i3lock} -n -c 000000";
}; };
@ -453,7 +416,15 @@ in {
windowManager.i3 = { windowManager.i3 = {
enable = true; enable = true;
package = pkgs.unstable.i3; package = pkgs.unstable.i3;
config = commonConfig {wayland = false;}; config =
commonConfig {wayland = false;}
// {
startup = [
{
command = "${lib.getExe pkgs.flameshot}";
}
];
};
extraConfig = '' extraConfig = ''
set_from_resource $dpi Xft.dpi 140 set_from_resource $dpi Xft.dpi 140
${commonExtraConfig} ${commonExtraConfig}
@ -470,10 +441,15 @@ in {
input."type:keyboard" = { input."type:keyboard" = {
xkb_options = "ctrl:nocaps"; xkb_options = "ctrl:nocaps";
}; };
output = {"*" = {scale = "2";};}; output = {
"*" = {
scale = "2";
bg = "${flakePath}/home/wallpapers/dhm_1610.png fill #171320";
};
};
startup = [ startup = [
{ {
command = "${lib.getExe pkgs.nur.repos.nekowinston.swww} init"; command = "wl-paste -t text --watch clipman store";
} }
]; ];
}; };

View file

@ -6,11 +6,10 @@
inherit (pkgs.stdenv.hostPlatform) isLinux; inherit (pkgs.stdenv.hostPlatform) isLinux;
in { in {
home.packages = lib.mkIf isLinux (with pkgs; [ home.packages = lib.mkIf isLinux (with pkgs; [
cliphist clipman
grim grim
slurp slurp
wl-clipboard wl-clipboard
nur.repos.nekowinston.swww
]); ]);
programs.waybar = lib.mkIf isLinux { programs.waybar = lib.mkIf isLinux {

View file

@ -86,6 +86,7 @@ in {
enable = isLinux && machine.personal; enable = isLinux && machine.personal;
package = pkgs.unstable.mangohud; package = pkgs.unstable.mangohud;
}; };
zathura.enable = true;
}; };
xdg.configFile."ideavim/ideavimrc".source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/ideavim/ideavimrc"; xdg.configFile."ideavim/ideavimrc".source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/ideavim/ideavimrc";

BIN
home/wallpapers/dhm_1610.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -9,4 +9,30 @@
services.dbus.packages = [pkgs.gcr]; services.dbus.packages = [pkgs.gcr];
xdg.portal.enable = true; xdg.portal.enable = true;
xdg.portal.wlr.enable = true; xdg.portal.wlr.enable = true;
console.colors = [
"1e1e2e"
"585b70"
"bac2de"
"a6adc8"
"f38ba8"
"f38ba8"
"a6e3a1"
"a6e3a1"
"f9e2af"
"f9e2af"
"89b4fa"
"89b4fa"
"f5c2e7"
"f5c2e7"
"94e2d5"
"94e2d5"
];
} }

View file

@ -28,6 +28,21 @@
udisks2.enable = true; udisks2.enable = true;
devmon.enable = true; devmon.enable = true;
greetd = {
enable = true;
settings = {
default_session = let
swaycmd = pkgs.writeShellScript "swaycmd" ''
export NIXOS_OZONE_WL=1 XDG_CURRENT_DESKTOP=sway
sway > /tmp/sway.log 2>&1
'';
in {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${swaycmd}";
user = "greeter";
};
};
};
# thumbnails # thumbnails
tumbler.enable = true; tumbler.enable = true;
@ -35,7 +50,7 @@
kanata = { kanata = {
enable = true; enable = true;
package = pkgs.master.kanata; package = pkgs.unstable.kanata;
keyboards.keychron-k6 = { keyboards.keychron-k6 = {
devices = ["/dev/input/by-id/usb-Keychron_Keychron_K6-event-kbd"]; devices = ["/dev/input/by-id/usb-Keychron_Keychron_K6-event-kbd"];
config = '' config = ''
@ -62,11 +77,7 @@
xserver = { xserver = {
enable = true; enable = true;
desktopManager.xterm.enable = false; desktopManager.xterm.enable = false;
displayManager = { displayManager.startx.enable = true;
gdm.enable = true;
# one of these days, it'll be sway :COPIUM:
defaultSession = "none+i3";
};
libinput.enable = true; libinput.enable = true;
windowManager.i3 = { windowManager.i3 = {
enable = true; enable = true;