Compare commits
12 commits
dde8a27a7e
...
79746de69a
Author | SHA1 | Date | |
---|---|---|---|
79746de69a | |||
1a78c1cf19 | |||
f5b9f5ae6b | |||
fcd5000e6a | |||
078943a122 | |||
b48fe4f845 | |||
b1534fac93 | |||
58fba557c5 | |||
a35083ff1e | |||
82d7fab51e | |||
9670caae7d | |||
ad69f97952 |
13 changed files with 295 additions and 24 deletions
11
flake.lock
11
flake.lock
|
@ -730,15 +730,16 @@
|
||||||
"zdwm": {
|
"zdwm": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732446345,
|
"lastModified": 1732925486,
|
||||||
"narHash": "sha256-HtHnjdziKjdfcYqBeNileZqMYLxEl+8GM/3AHTxvng8=",
|
"narHash": "sha256-DBd1mEjPgve2D4ZpnCpdOM5fH1VbrvwGE2++rlOXVuk=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "preanybar",
|
||||||
"rev": "17cdd846fcc168b80a01b9373d9f9f8a9cb6f523",
|
"rev": "8e5ac03764e9fecd0800198bc583488eb128ce05",
|
||||||
"revCount": 1738,
|
"revCount": 1731,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.zynh.me/Zynh0722/dwm"
|
"url": "https://git.zynh.me/Zynh0722/dwm"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "preanybar",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.zynh.me/Zynh0722/dwm"
|
"url": "https://git.zynh.me/Zynh0722/dwm"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
nix-darwin = { url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; };
|
nix-darwin = { url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||||
|
|
||||||
repo-clone.url = "git+https://git.zynh.me/Zynh0722/repo-clone";
|
repo-clone.url = "git+https://git.zynh.me/Zynh0722/repo-clone";
|
||||||
zdwm = { url = "git+https://git.zynh.me/Zynh0722/dwm"; flake = false; };
|
zdwm = { url = "git+https://git.zynh.me/Zynh0722/dwm?ref=preanybar"; flake = false; };
|
||||||
fish_theme = { url = "git+https://git.zynh.me/Zynh0722/omf-theme"; flake = false; };
|
fish_theme = { url = "git+https://git.zynh.me/Zynh0722/omf-theme"; flake = false; };
|
||||||
backgrounds = { url = "git+https://git.zynh.me/Zynh0722/backgrounds"; inputs.nixpkgs.follows = "nixpkgs"; };
|
backgrounds = { url = "git+https://git.zynh.me/Zynh0722/backgrounds"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||||
umu = { url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging\/nix&submodules=1"; inputs.nixpkgs.follows = "nixpkgs"; };
|
umu = { url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging\/nix&submodules=1"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.snowhawk.kitty;
|
cfg = config.snowhawk.kitty;
|
||||||
|
@ -22,9 +22,20 @@ in
|
||||||
background = "#050505";
|
background = "#050505";
|
||||||
background_opacity = 0.98;
|
background_opacity = 0.98;
|
||||||
font_size = 12;
|
font_size = 12;
|
||||||
|
|
||||||
|
# FIXME: I really should remove this
|
||||||
|
allow_remote_control = "yes";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = "include ${../../home/kitty/alacritty-colors.conf}";
|
extraConfig =
|
||||||
|
let
|
||||||
|
kitten = "${pkgs.kitty}/bin/kitten";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
include ${../../home/kitty/alacritty-colors.conf}
|
||||||
|
|
||||||
|
map ctrl+k ${pkgs.writeShellScript "kitten-snap" "${kitten} @ get-text --self --ansi > /tmp/test"}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,8 @@ in
|
||||||
taplo
|
taplo
|
||||||
gnumake
|
gnumake
|
||||||
zig
|
zig
|
||||||
|
clang-tools
|
||||||
|
coreutils
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
33
home/modules/wezterm.nix
Normal file
33
home/modules/wezterm.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.snowhawk.wezterm;
|
||||||
|
macos = config.snowhawk.macos.enable;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.snowhawk.wezterm = {
|
||||||
|
enable = lib.mkEnableOption "kitty home-manager module";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
wezterm
|
||||||
|
fd
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.wezterm = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = /* lua */''
|
||||||
|
return require 'modules'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile = {
|
||||||
|
wezterm = {
|
||||||
|
source = ../../home/wezterm;
|
||||||
|
recursive = true;
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
50
home/wezterm/modules/colors.lua
Normal file
50
home/wezterm/modules/colors.lua
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
local wezterm = require("wezterm")
|
||||||
|
|
||||||
|
-- This is the M table that we will export
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
-- define a function in the M table.
|
||||||
|
-- Only functions defined in `M` will be exported to
|
||||||
|
-- code that imports this M.
|
||||||
|
-- The suggested convention for making Ms that update
|
||||||
|
-- the config is for them to export an `apply_to_config`
|
||||||
|
-- function that accepts the config object, like this:
|
||||||
|
function M.apply_to_config(config)
|
||||||
|
config.colors = {
|
||||||
|
foreground = "#d8d8d8",
|
||||||
|
background = "#050505",
|
||||||
|
|
||||||
|
selection_fg = "#e0def4",
|
||||||
|
selection_bg = "#403d52",
|
||||||
|
|
||||||
|
cursor_bg = "#524f67",
|
||||||
|
cursor_fg = "#e0def4",
|
||||||
|
|
||||||
|
cursor_border = "#524f67",
|
||||||
|
|
||||||
|
ansi = {
|
||||||
|
"#181818",
|
||||||
|
"#ac4242",
|
||||||
|
"#90a959",
|
||||||
|
"#f4bf75",
|
||||||
|
"#6a8fb5",
|
||||||
|
"#aa759f",
|
||||||
|
"#75b5aa",
|
||||||
|
"#d8d8d8",
|
||||||
|
},
|
||||||
|
|
||||||
|
brights = {
|
||||||
|
"#6b6b6b",
|
||||||
|
"#c55555",
|
||||||
|
"#aac474",
|
||||||
|
"#fcea88",
|
||||||
|
"#82b8c8",
|
||||||
|
"#c28cb8",
|
||||||
|
"#93d3c3",
|
||||||
|
"#f8f8f8",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- return our M table
|
||||||
|
return M
|
49
home/wezterm/modules/init.lua
Normal file
49
home/wezterm/modules/init.lua
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
local wezterm = require("wezterm")
|
||||||
|
local config = wezterm.config_builder()
|
||||||
|
|
||||||
|
local colors = require("modules/colors")
|
||||||
|
colors.apply_to_config(config)
|
||||||
|
|
||||||
|
config.unix_domains = { { name = "unix" } }
|
||||||
|
config.default_gui_startup_args = { "connect", "unix" }
|
||||||
|
|
||||||
|
config.font = wezterm.font("JetBrainsMono Nerd Font")
|
||||||
|
|
||||||
|
config.use_fancy_tab_bar = false
|
||||||
|
config.tab_bar_at_bottom = true
|
||||||
|
|
||||||
|
-- https://github.com/wez/wezterm/issues/5990
|
||||||
|
config.front_end = "WebGpu"
|
||||||
|
|
||||||
|
local act = wezterm.action
|
||||||
|
local sessionizer = require("modules/sessionizer")
|
||||||
|
local navigator = require("modules/navigator")
|
||||||
|
|
||||||
|
-- timeout_milliseconds defaults to 1000 and can be omitted
|
||||||
|
config.leader = { key = "b", mods = "CTRL", timeout_milliseconds = 1000 }
|
||||||
|
|
||||||
|
config.keys = {
|
||||||
|
{ key = "b", mods = "LEADER|CTRL", action = act.ActivateLastTab },
|
||||||
|
{ key = "p", mods = "LEADER", action = act.ActivateTabRelative(-1) },
|
||||||
|
{ key = "p", mods = "LEADER|CTRL", action = act.ActivateTabRelative(-1) },
|
||||||
|
{ key = "n", mods = "LEADER", action = act.ActivateTabRelative(1) },
|
||||||
|
{ key = "n", mods = "LEADER|CTRL", action = act.ActivateTabRelative(1) },
|
||||||
|
{ key = "s", mods = "LEADER", action = act.ShowLauncherArgs({ flags = "WORKSPACES" }) },
|
||||||
|
|
||||||
|
{ key = "\\", mods = "LEADER", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
|
||||||
|
{ key = "-", mods = "LEADER", action = act.SplitVertical({ domain = "CurrentPaneDomain" }) },
|
||||||
|
{ key = "c", mods = "LEADER", action = act.SpawnTab("CurrentPaneDomain") },
|
||||||
|
|
||||||
|
{ key = "a", mods = "LEADER", action = act.AttachDomain("unix") },
|
||||||
|
{ key = "d", mods = "LEADER|CTRL", action = act.DetachDomain("CurrentPaneDomain") },
|
||||||
|
|
||||||
|
-- Integration with neovim panes
|
||||||
|
-- { key = "h", mods = "CTRL", action = act.EmitEvent("ActivatePaneDirection-left") },
|
||||||
|
-- { key = "j", mods = "CTRL", action = act.EmitEvent("ActivatePaneDirection-down") },
|
||||||
|
-- { key = "k", mods = "CTRL", action = act.EmitEvent("ActivatePaneDirection-up") },
|
||||||
|
-- { key = "l", mods = "CTRL", action = act.EmitEvent("ActivatePaneDirection-right") },
|
||||||
|
|
||||||
|
{ key = "f", mods = "LEADER", action = wezterm.action_callback(sessionizer.toggle) },
|
||||||
|
}
|
||||||
|
|
||||||
|
return config
|
53
home/wezterm/modules/navigator.lua
Normal file
53
home/wezterm/modules/navigator.lua
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
local wezterm = require("wezterm")
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
-- https://github.com/lrvdijk/dotfiles/blob/master/wezterm/wezterm.lua
|
||||||
|
-- Integration with neovim panes
|
||||||
|
function M.isViProcess(pane)
|
||||||
|
-- get_foreground_process_name On Linux, macOS and Windows,
|
||||||
|
-- the process can be queried to determine this path. Other operating systems
|
||||||
|
-- (notably, FreeBSD and other unix systems) are not currently supported
|
||||||
|
-- return pane:get_foreground_process_name():find('n?vim') ~= nil
|
||||||
|
-- Use get_title as it works for multiplexed sessions too
|
||||||
|
return pane:get_title():find("n?vim") ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.conditionalActivatePane(window, pane, pane_direction, vim_direction)
|
||||||
|
local vim_pane_changed = false
|
||||||
|
|
||||||
|
if M.isViProcess(pane) then
|
||||||
|
local before = pane:get_cursor_position()
|
||||||
|
window:perform_action(
|
||||||
|
-- This should match the keybinds you set in Neovim.
|
||||||
|
wezterm.action.SendKey({ key = vim_direction, mods = "CTRL" }),
|
||||||
|
pane
|
||||||
|
)
|
||||||
|
wezterm.sleep_ms(50)
|
||||||
|
local after = pane:get_cursor_position()
|
||||||
|
|
||||||
|
if before.x ~= after.x and before.y ~= after.y then
|
||||||
|
vim_pane_changed = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if not vim_pane_changed then
|
||||||
|
window:perform_action(wezterm.action.ActivatePaneDirection(pane_direction), pane)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.apply_to_config(config)
|
||||||
|
wezterm.on("ActivatePaneDirection-right", function(window, pane)
|
||||||
|
M.conditionalActivatePane(window, pane, "Right", "l")
|
||||||
|
end)
|
||||||
|
wezterm.on("ActivatePaneDirection-left", function(window, pane)
|
||||||
|
M.conditionalActivatePane(window, pane, "Left", "h")
|
||||||
|
end)
|
||||||
|
wezterm.on("ActivatePaneDirection-up", function(window, pane)
|
||||||
|
M.conditionalActivatePane(window, pane, "Up", "k")
|
||||||
|
end)
|
||||||
|
wezterm.on("ActivatePaneDirection-down", function(window, pane)
|
||||||
|
M.conditionalActivatePane(window, pane, "Down", "j")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
52
home/wezterm/modules/sessionizer.lua
Normal file
52
home/wezterm/modules/sessionizer.lua
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
local wezterm = require("wezterm")
|
||||||
|
local act = wezterm.action
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local fd = "/home/ravenshade/.nix-profile/bin/fd"
|
||||||
|
|
||||||
|
M.toggle = function(window, pane)
|
||||||
|
local projects = {}
|
||||||
|
|
||||||
|
local success, stdout, stderr = wezterm.run_child_process({
|
||||||
|
fd,
|
||||||
|
"-HI",
|
||||||
|
"^.git$",
|
||||||
|
"--max-depth=4",
|
||||||
|
"--prune",
|
||||||
|
os.getenv("HOME") .. "/projects",
|
||||||
|
os.getenv("HOME") .. "/.config",
|
||||||
|
os.getenv("HOME") .. "/src",
|
||||||
|
})
|
||||||
|
|
||||||
|
if not success then
|
||||||
|
wezterm.log_error("Failed to run fd: " .. stderr)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
for line in stdout:gmatch("([^\n]*)\n?") do
|
||||||
|
local project = line:gsub("/.git.*$", "")
|
||||||
|
local label = project
|
||||||
|
local id = project:gsub(".*/", "")
|
||||||
|
table.insert(projects, { label = tostring(label), id = tostring(id) })
|
||||||
|
end
|
||||||
|
|
||||||
|
window:perform_action(
|
||||||
|
act.InputSelector({
|
||||||
|
action = wezterm.action_callback(function(win, _, id, label)
|
||||||
|
if not id and not label then
|
||||||
|
wezterm.log_info("Cancelled")
|
||||||
|
else
|
||||||
|
wezterm.log_info("Selected " .. label)
|
||||||
|
win:perform_action(act.SwitchToWorkspace({ name = id, spawn = { cwd = label } }), pane)
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
fuzzy = true,
|
||||||
|
title = "Select project",
|
||||||
|
choices = projects,
|
||||||
|
}),
|
||||||
|
pane
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
|
@ -28,24 +28,28 @@
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
dwmNVK.configuration = {
|
# dwmNVK.configuration = {
|
||||||
snowhawk.dwm.enable = true;
|
# snowhawk.dwm.enable = true;
|
||||||
|
#
|
||||||
home-manager.sharedModules = [{ snowhawk.dunst.enable = lib.mkDefault true; }];
|
# home-manager.sharedModules = [{ snowhawk.dunst.enable = lib.mkDefault true; }];
|
||||||
} // nvkConfig;
|
# } // nvkConfig;
|
||||||
|
#
|
||||||
dwl.configuration = {
|
# dwl.configuration = {
|
||||||
snowhawk.dwl.enable = true;
|
# snowhawk.dwl.enable = true;
|
||||||
|
#
|
||||||
home-manager.sharedModules = [{ snowhawk.dunst.enable = lib.mkDefault true; }];
|
# home-manager.sharedModules = [{ snowhawk.dunst.enable = lib.mkDefault true; }];
|
||||||
};
|
# };
|
||||||
dwlNVK.configuration = {
|
# dwlNVK.configuration = {
|
||||||
snowhawk.dwl.enable = true;
|
# snowhawk.dwl.enable = true;
|
||||||
|
#
|
||||||
home-manager.sharedModules = [{ snowhawk.dunst.enable = lib.mkDefault true; }];
|
# home-manager.sharedModules = [{ snowhawk.dunst.enable = lib.mkDefault true; }];
|
||||||
} // nvkConfig;
|
# } // nvkConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
snowhawk.dwm.enable = true;
|
||||||
|
|
||||||
|
home-manager.sharedModules = [{ snowhawk.dunst.enable = lib.mkDefault true; }];
|
||||||
|
|
||||||
snowhawk = {
|
snowhawk = {
|
||||||
filesystem.enable = true;
|
filesystem.enable = true;
|
||||||
plymouth.enable = true;
|
plymouth.enable = true;
|
||||||
|
@ -61,6 +65,12 @@
|
||||||
user = "ravenshade";
|
user = "ravenshade";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
documentation = {
|
||||||
|
enable = true;
|
||||||
|
dev.enable = true;
|
||||||
|
man.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
users = { "ravenshade" = import ./home.nix; };
|
users = { "ravenshade" = import ./home.nix; };
|
||||||
backupFileExtension = "backup";
|
backupFileExtension = "backup";
|
||||||
|
@ -72,6 +82,8 @@
|
||||||
curl
|
curl
|
||||||
git
|
git
|
||||||
killall
|
killall
|
||||||
|
|
||||||
|
linux-manual
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts.packages = with pkgs; [
|
fonts.packages = with pkgs; [
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
flameshot.enable = true;
|
flameshot.enable = true;
|
||||||
playerctl.enable = true;
|
playerctl.enable = true;
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
|
wezterm.enable = true;
|
||||||
defaultPrograms.enable = true;
|
defaultPrograms.enable = true;
|
||||||
pipewire-controller.enable = true;
|
pipewire-controller.enable = true;
|
||||||
|
|
||||||
|
@ -131,6 +132,11 @@
|
||||||
|
|
||||||
pcmanfm
|
pcmanfm
|
||||||
geeqie
|
geeqie
|
||||||
|
|
||||||
|
jq
|
||||||
|
|
||||||
|
eww
|
||||||
|
dwm-msg
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.nix-index.enable = true;
|
programs.nix-index.enable = true;
|
||||||
|
|
|
@ -26,6 +26,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.dwm.overrideAttrs (oldAttrs: {
|
package = pkgs.dwm.overrideAttrs (oldAttrs: {
|
||||||
src = inputs.zdwm;
|
src = inputs.zdwm;
|
||||||
|
buildInputs = oldAttrs.buildInputs ++ [ pkgs.yajl ];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,5 @@ in
|
||||||
borderlessBrowser = callDefaultPackage ./borderlessBrowser;
|
borderlessBrowser = callDefaultPackage ./borderlessBrowser;
|
||||||
zenBrowser = callDefaultPackage ./zenBrowser;
|
zenBrowser = callDefaultPackage ./zenBrowser;
|
||||||
rose-pine-grub = callDefaultPackage ./rosePineGrub;
|
rose-pine-grub = callDefaultPackage ./rosePineGrub;
|
||||||
|
dwm-msg = callDefaultPackage ./dwm-msg;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue