1
1
Fork 0

Compare commits

...

7 commits

Author SHA1 Message Date
adb08d1aea
menu: add silent command to clear clipboard
Signed-off-by: Myned <dev@bjork.tech>
2025-02-12 13:21:58 -06:00
f65e7475e5
ghostty: add background service
Signed-off-by: Myned <dev@bjork.tech>
2025-02-12 13:21:31 -06:00
7be7cdef8e
zed: modify config
Signed-off-by: Myned <dev@bjork.tech>
2025-02-12 13:21:21 -06:00
4e2e43f1bb
xdg: fix niri windows not activating
Signed-off-by: Myned <dev@bjork.tech>
2025-02-12 13:21:09 -06:00
7094e69814
niri: launch apps at startup
Signed-off-by: Myned <dev@bjork.tech>
2025-02-12 13:20:53 -06:00
3d922f1dbc
niri: add todo
Signed-off-by: Myned <dev@bjork.tech>
2025-02-12 13:19:55 -06:00
77c7207d8b
nautilus: disable service by default
Signed-off-by: Myned <dev@bjork.tech>
2025-02-12 12:31:50 -06:00
10 changed files with 98 additions and 101 deletions

View file

@ -67,6 +67,9 @@ in {
]; ];
in in
listToAttrs (with hm.lib.niri.actions; [ listToAttrs (with hm.lib.niri.actions; [
# TODO: Focus window if already launched
# https://github.com/YaLTeR/niri/discussions/267
#?? niri msg action focus-window --id (niri msg -j windows | jq '.[] | select(.app_id == "").id')
(key "0" "Mod" (spawn [swayosd-client "--output-volume" "mute-toggle"])) (key "0" "Mod" (spawn [swayosd-client "--output-volume" "mute-toggle"]))
(key "1" "Ctrl+Alt" (spawn ["lifx" "state" "--brightness" "0.01"])) (key "1" "Ctrl+Alt" (spawn ["lifx" "state" "--brightness" "0.01"]))
(key "1" "Mod" (focus-workspace "1")) (key "1" "Mod" (focus-workspace "1"))

View file

@ -10,6 +10,9 @@ with lib; let
audio = config.home-manager.users.${config.custom.username}.home.file.".local/bin/audio".source; audio = config.home-manager.users.${config.custom.username}.home.file.".local/bin/audio".source;
bash = "${pkgs.bash}/bin/bash"; bash = "${pkgs.bash}/bin/bash";
chromium = getExe hm.programs.chromium.package;
loupe = "${pkgs.loupe}/bin/loupe";
nautilus = "${pkgs.nautilus}/bin/nautilus";
niri = "${config.programs.niri.package}/bin/niri"; niri = "${config.programs.niri.package}/bin/niri";
sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit"; sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit";
wallpaper = "${config.home-manager.users.${config.custom.username}.home.file.".local/bin/wallpaper".source}"; wallpaper = "${config.home-manager.users.${config.custom.username}.home.file.".local/bin/wallpaper".source}";
@ -52,8 +55,11 @@ in {
spawn-at-startup = spawn-at-startup =
[ [
{command = [audio "--init"];} # Enforce audio profile state {command = [audio "--init"];} # Enforce audio profile state
{command = [bash "-c" config.custom.menus.clipboard.clear];} # Clear clipboard history {command = [bash "-c" config.custom.menus.clipboard.clear-silent];} # Clear clipboard history
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing {command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
{command = [chromium];}
{command = [loupe];}
{command = [nautilus];}
] ]
++ optionals config.custom.wallpaper [ ++ optionals config.custom.wallpaper [
{command = [wallpaper];} {command = [wallpaper];}

View file

@ -53,7 +53,14 @@ in {
{ {
# Startup # Startup
#?? <= 60 secs after niri launches #?? <= 60 secs after niri launches
matches = [{at-startup = true;}]; matches = [
{at-startup = true;}
{app-id = "^org\.gnome\.Loupe$";}
{app-id = "^org\.gnome\.Nautilus$";}
];
open-focused = false;
open-on-workspace = "1";
} }
{ {
@ -76,7 +83,7 @@ in {
then 0.4 then 0.4
else 0.7; else 0.7;
#// open-on-workspace = "2"; open-on-workspace = "2";
} }
{ {
@ -101,7 +108,7 @@ in {
{app-id = "^obsidian$";} {app-id = "^obsidian$";}
]; ];
#// open-on-workspace = "2"; open-on-workspace = "2";
} }
{ {
@ -120,20 +127,24 @@ in {
]; ];
default-column-width = {}; # Window-defined default-column-width = {}; # Window-defined
#// open-on-workspace = "1"; open-on-workspace = "1";
variable-refresh-rate = true; variable-refresh-rate = true;
} }
{ {
# Media # Media
matches = [ matches = [
{app-id = "^org\.gnome\.Loupe$";} {
app-id = "^org\.gnome\.Loupe$";
title = "wallpaper.png";
}
{app-id = "^Spotify$";} {app-id = "^Spotify$";}
{app-id = "^totem$";} {app-id = "^totem$";}
{app-id = "^YouTube Music$";} {app-id = "^YouTube Music$";}
]; ];
#// open-on-workspace = "3"; open-on-workspace = "3";
} }
{ {
@ -144,7 +155,7 @@ in {
{app-id = "^ONLYOFFICE Desktop Editors$";} {app-id = "^ONLYOFFICE Desktop Editors$";}
]; ];
#// open-on-workspace = "2"; open-on-workspace = "2";
} }
(let (let
@ -199,7 +210,7 @@ in {
]; ];
open-floating = false; open-floating = false;
#// open-on-workspace = "1"; open-on-workspace = "1";
} }
### Overrides ### Overrides

View file

@ -12,8 +12,9 @@ in {
calculator.show = mkOption {default = "";}; calculator.show = mkOption {default = "";};
clipboard = { clipboard = {
clear = mkOption {default = "";};
show = mkOption {default = "";}; show = mkOption {default = "";};
clear = mkOption {default = "";};
clear-silent = mkOption {default = "";};
}; };
dmenu.show = mkOption {default = "";}; dmenu.show = mkOption {default = "";};

View file

@ -31,6 +31,7 @@ in {
clipboard = { clipboard = {
show = "${quit} || ${rofi} -show clipboard -show-icons"; show = "${quit} || ${rofi} -show clipboard -show-icons";
clear = "${cliphist} wipe && ${notify-send} '> cliphist' 'Clipboard cleared' --urgency low"; clear = "${cliphist} wipe && ${notify-send} '> cliphist' 'Clipboard cleared' --urgency low";
clear-silent = "${cliphist} wipe";
}; };
dmenu.show = "${quit} || ${rofi} -dmenu"; dmenu.show = "${quit} || ${rofi} -dmenu";

View file

@ -26,6 +26,7 @@ in {
clipboard = { clipboard = {
show = "${walker} --modules clipboard"; show = "${walker} --modules clipboard";
clear = "${rm} ~/.cache/walker/clipboard.gob && ${notify-send} '> walker' 'Clipboard cleared' --urgency low"; clear = "${rm} ~/.cache/walker/clipboard.gob && ${notify-send} '> walker' 'Clipboard cleared' --urgency low";
clear-silent = "${rm} ~/.cache/walker/clipboard.gob";
}; };
dmenu.show = "${walker} --modules dmenu"; dmenu.show = "${walker} --modules dmenu";

View file

@ -6,10 +6,14 @@
}: }:
with lib; let with lib; let
cfg = config.custom.programs.ghostty; cfg = config.custom.programs.ghostty;
hm = config.home-manager.users.${config.custom.username};
ghostty = getExe hm.programs.ghostty.package;
in { in {
options.custom.programs.ghostty = { options.custom.programs.ghostty = {
enable = mkOption {default = false;}; enable = mkOption {default = false;};
minimal = mkOption {default = false;}; minimal = mkOption {default = false;};
service = mkOption {default = true;};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -82,6 +86,27 @@ in {
window-padding-y = 4; window-padding-y = 4;
}; };
}; };
# HACK: Launch in background to decrease GTK startup delay
# https://github.com/ghostty-org/ghostty/discussions/2978
systemd.user.services = mkIf cfg.service {
ghostty = {
Unit = {
Description = "Ghostty Background Service";
After = ["xdg-desktop-autostart.target"];
};
Service = {
BusName = "com.mitchellh.ghostty";
ExecStart = "${ghostty} --initial-window=false --quit-after-last-window-closed=false";
Type = "dbus";
};
Install = {
WantedBy = ["xdg-desktop-autostart.target"];
};
};
};
} }
]; ];
}; };

View file

@ -11,7 +11,7 @@ in {
enable = mkOption {default = false;}; enable = mkOption {default = false;};
git = mkOption {default = false;}; git = mkOption {default = false;};
index = mkOption {default = true;}; index = mkOption {default = true;};
service = mkOption {default = true;}; service = mkOption {default = false;};
terminal = mkOption {default = "ghostty";}; terminal = mkOption {default = "ghostty";};
}; };
@ -44,6 +44,7 @@ in {
home-manager.users.${config.custom.username} = { home-manager.users.${config.custom.username} = {
# HACK: Partially fix startup delay with background service until module is available # HACK: Partially fix startup delay with background service until module is available
# BUG: --gapplication-service always exits without a window
systemd.user.services = let systemd.user.services = let
nautilus = "${pkgs.nautilus}/bin/nautilus"; nautilus = "${pkgs.nautilus}/bin/nautilus";
turtle_service = "${pkgs.turtle}/bin/turtle_service"; turtle_service = "${pkgs.turtle}/bin/turtle_service";
@ -56,7 +57,7 @@ in {
BusName = "org.gnome.Nautilus"; BusName = "org.gnome.Nautilus";
ExecStart = "${nautilus} --gapplication-service"; ExecStart = "${nautilus} --gapplication-service";
ExecStop = "${nautilus} --quit"; ExecStop = "${nautilus} --quit";
Restart = "always"; #!! Benign exceptions cause nautilus to exit Restart = "always"; #!! Exits when last window is closed
Type = "dbus"; Type = "dbus";
# HACK: Allow child processes to live, otherwise applications launched through service are killed on stop # HACK: Allow child processes to live, otherwise applications launched through service are killed on stop

View file

@ -38,69 +38,16 @@ in {
userKeymaps = [ userKeymaps = [
{ {
bindings = { bindings = {
"escape" = "menu::Cancel"; "alt-space" = "command_palette::Toggle";
"ctrl-," = "zed::OpenSettings";
"ctrl-o" = "workspace::Open";
}; };
} }
{ {
context = "Editor"; context = "Editor";
bindings = { bindings = {
"alt-enter" = "editor::DuplicateLineDown"; "alt-enter" = "editor::DuplicateLineDown";
"backspace" = "editor::Backspace"; "alt-left" = "editor::MoveToBeginningOfLine";
"shift-backspace" = "editor::Backspace"; "alt-right" = "editor::MoveToEndOfLine";
"delete" = "editor::Delete";
"tab" = "editor::Tab";
"shift-tab" = "editor::TabPrev";
"ctrl-k" = "editor::CutToEndOfLine";
"ctrl-k ctrl-q" = "editor::Rewrap";
"ctrl-k q" = "editor::Rewrap";
"ctrl-backspace" = "editor::DeleteToPreviousWordStart";
"ctrl-delete" = "editor::DeleteToNextWordEnd";
"shift-delete" = "editor::Cut";
"ctrl-insert" = "editor::Copy";
"shift-insert" = "editor::Paste";
"ctrl-y" = "editor::Redo";
"ctrl-z" = "editor::Undo";
"ctrl-shift-z" = "editor::Redo";
"up" = "editor::MoveUp";
"ctrl-up" = "editor::LineUp";
"ctrl-down" = "editor::LineDown";
"pageup" = "editor::MovePageUp";
"alt-pageup" = "editor::PageUp";
"shift-pageup" = "editor::SelectPageUp";
"home" = "editor::MoveToBeginningOfLine";
"down" = "editor::MoveDown";
"pagedown" = "editor::MovePageDown";
"alt-pagedown" = "editor::PageDown";
"shift-pagedown" = "editor::SelectPageDown";
"end" = "editor::MoveToEndOfLine";
"left" = "editor::MoveLeft";
"right" = "editor::MoveRight";
"ctrl-left" = "editor::MoveToPreviousWordStart";
"ctrl-right" = "editor::MoveToNextWordEnd";
"ctrl-home" = "editor::MoveToBeginning";
"ctrl-end" = "editor::MoveToEnd";
"shift-up" = "editor::SelectUp";
"shift-down" = "editor::SelectDown";
"shift-left" = "editor::SelectLeft";
"shift-right" = "editor::SelectRight";
"ctrl-shift-left" = "editor::SelectToPreviousWordStart";
"ctrl-shift-right" = "editor::SelectToNextWordEnd";
"ctrl-shift-home" = "editor::SelectToBeginning";
"ctrl-shift-end" = "editor::SelectToEnd";
"ctrl-a" = "editor::SelectAll";
"ctrl-l" = "editor::SelectLine";
"ctrl-shift-i" = "editor::Format";
"ctrl-alt-space" = "editor::ShowCharacterPalette";
"ctrl-;" = "editor::ToggleLineNumbers";
"ctrl-k ctrl-r" = "editor::RevertSelectedHunks";
"ctrl-'" = "editor::ToggleHunkDiff";
"ctrl-\"" = "editor::ExpandAllHunkDiffs";
"ctrl-i" = "editor::ShowSignatureHelp";
"alt-g b" = "editor::ToggleGitBlame";
"menu" = "editor::OpenContextMenu";
"shift-f10" = "editor::OpenContextMenu";
}; };
} }
]; ];
@ -192,7 +139,7 @@ in {
}; };
ui_font_family = config.custom.settings.fonts.sans-serif; ui_font_family = config.custom.settings.fonts.sans-serif;
ui_font_size = 18; ui_font_size = 20;
# Language-specific # Language-specific
# https://zed.dev/docs/configuring-languages # https://zed.dev/docs/configuring-languages
@ -216,7 +163,7 @@ in {
{ {
cursor = "#93a1a1"; cursor = "#93a1a1";
background = "#93a1a1"; background = "#93a1a1";
selection = "#93a1a11A"; # 10% selection = "#93a1a11a"; # 10%
} }
]; ];
@ -224,54 +171,54 @@ in {
"scrollbar.thumb.border" = "#00000000"; "scrollbar.thumb.border" = "#00000000";
syntax = { syntax = {
_expr.color = "#b58900"; "_expr".color = "#b58900";
_id.color = "#93a1a1"; "_id".color = "#93a1a1";
attribute.color = "#93a1a1"; "attribute".color = "#93a1a1";
boolean.color = "#cb4b16"; "boolean".color = "#cb4b16";
comment.color = "#586e75"; "comment".color = "#586e75";
"comment.doc".color = "#586e75"; "comment.doc".color = "#586e75";
constant.color = "#93a1a1"; "constant".color = "#93a1a1";
"constant.builtin".color = "#93a1a1"; "constant.builtin".color = "#93a1a1";
constructor.color = "#b58900"; "constructor".color = "#b58900";
embedded.color = "#657b83"; "embedded".color = "#657b83";
emphasis.color = "#93a1a1"; "emphasis".color = "#93a1a1";
"emphasis.strong".color = "#93a1a1"; "emphasis.strong".color = "#93a1a1";
enum.color = "#b58900"; "enum".color = "#b58900";
function.color = "#268bd2"; "function".color = "#268bd2";
"function.builtin".color = "#268bd2"; "function.builtin".color = "#268bd2";
"function.call".color = "#268bd2"; "function.call".color = "#268bd2";
hint.color = "#657b83"; "hint".color = "#657b83";
keyword.color = "#d33682"; "keyword".color = "#d33682";
"keyword.exception".color = "#d33682"; "keyword.exception".color = "#d33682";
label.color = "#93a1a1"; "label".color = "#93a1a1";
link_text.color = "#93a1a1"; "link_text".color = "#93a1a1";
link_uri.color = "#93a1a1"; "link_uri".color = "#93a1a1";
number.color = "#2aa198"; "number".color = "#2aa198";
operator.color = "#657b83"; "operator".color = "#657b83";
predictive.color = "#657b83"; "predictive".color = "#657b83";
preproc.color = "#93a1a1"; "preproc".color = "#93a1a1";
primary.color = "#93a1a1"; "primary".color = "#93a1a1";
property.color = "#93a1a1"; "property".color = "#93a1a1";
punctuation.color = "#657b83"; "punctuation".color = "#657b83";
"punctuation.bracket".color = "#657b83"; "punctuation.bracket".color = "#657b83";
"punctuation.delimiter".color = "#657b83"; "punctuation.delimiter".color = "#657b83";
"punctuation.list_marker".color = "#657b83"; "punctuation.list_marker".color = "#657b83";
"punctuation.special".color = "#657b83"; "punctuation.special".color = "#657b83";
string.color = "#859900"; "string".color = "#859900";
"string.escape".color = "#cb4b16"; "string.escape".color = "#cb4b16";
"string.regex".color = "#cb4b16"; "string.regex".color = "#cb4b16";
"string.special".color = "#cb4b16"; "string.special".color = "#cb4b16";
"string.special.symbol".color = "#cb4b16"; "string.special.symbol".color = "#cb4b16";
tag.color = "#93a1a1"; "tag".color = "#93a1a1";
"tag.doctype".color = "#93a1a1"; "tag.doctype".color = "#93a1a1";
"text.literal".color = "#93a1a1"; "text.literal".color = "#93a1a1";
title.color = "#93a1a1"; "title".color = "#93a1a1";
type.color = "#b58900"; "type".color = "#b58900";
variable.color = "#93a1a1"; "variable".color = "#93a1a1";
"variable.member".color = "#93a1a1"; "variable.member".color = "#93a1a1";
"variable.parameter".color = "#6c71c4"; "variable.parameter".color = "#6c71c4";
"variable.special".color = "#93a1a1"; "variable.special".color = "#93a1a1";
variant.color = "#93a1a1"; "variant".color = "#93a1a1";
}; };
}; };
}; };

View file

@ -27,7 +27,8 @@ in {
# Use portal for xdg-open # Use portal for xdg-open
# https://github.com/NixOS/nixpkgs/issues/160923 # https://github.com/NixOS/nixpkgs/issues/160923
xdgOpenUsePortal = true; # BUG: Window activation fails on niri
#// xdgOpenUsePortal = true;
}; };
home-manager.users.${config.custom.username}.xdg = { home-manager.users.${config.custom.username}.xdg = {