meta: Use separate home-manager modules

This makes it easier to use our modules with home-manager on non-NixOS
distributions as needed.
This commit is contained in:
Donovan Glover 2023-06-16 07:23:35 -04:00
parent 395dd8e3f3
commit cdf9652a34
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
13 changed files with 593 additions and 638 deletions

View File

@ -1,31 +1,34 @@
{ {
imports = [ imports = [
./dual-function-keys ./dual-function-keys
./dunst
./fcitx5-mozc ./fcitx5-mozc
./feh
./fish-starship ./fish-starship
./fonts ./fonts
./git
./gpg
./hyprland ./hyprland
./joshuto ./joshuto
./kitty
./librewolf ./librewolf
./mime-apps
./mpv
./ncmpcpp
./neovim ./neovim
./piper ./piper
./pipewire ./pipewire
./qutebrowser
./rofi
./stylix ./stylix
./swaylock ./swaylock
./thunar ./thunar
./waybar
./waycorner ./waycorner
./xdg-user-dirs ./xdg-user-dirs
];
home-manager.sharedModules = [
./dunst
./feh
./git
./gpg
./kitty
./mime-apps
./mpv
./ncmpcpp
./qutebrowser
./rofi
./waybar
./zathura ./zathura
]; ];
} }

View File

@ -1,30 +1,26 @@
{ pkgs, ... }: { { pkgs, ... }: {
environment.systemPackages = [ pkgs.libnotify ]; home.pkgs = with pkgs; [ libnotify ];
home-manager.sharedModules = [ services.dunst = {
{ enable = true;
services.dunst = {
enable = true;
settings = { settings = {
global = { global = {
geometry = "1870x5-25+45"; geometry = "1870x5-25+45";
width = 350; width = 350;
separator_height = 5; separator_height = 5;
padding = 24; padding = 24;
horizontal_padding = 24; horizontal_padding = 24;
frame_width = 3; frame_width = 3;
idle_threshold = 120; idle_threshold = 120;
alignment = "center"; alignment = "center";
word_wrap = "yes"; word_wrap = "yes";
transparency = 5; transparency = 5;
format = "<b>%s</b>: %b"; format = "<b>%s</b>: %b";
markup = "full"; markup = "full";
min_icon_size = 128; min_icon_size = 128;
max_icon_size = 128; max_icon_size = 128;
};
};
}; };
} };
]; };
} }

View File

@ -1,81 +1,77 @@
{ {
home-manager.sharedModules = [ programs.feh = {
{ enable = true;
programs.feh = {
enable = true;
keybindings = { keybindings = {
next_img = [ "k" "Right" ]; next_img = [ "k" "Right" ];
prev_img = [ "j" "Left" ]; prev_img = [ "j" "Left" ];
quit = "q"; quit = "q";
toggle_fullscreen = "f"; toggle_fullscreen = "f";
zoom_in = "h"; zoom_in = "h";
zoom_out = "l"; zoom_out = "l";
toggle_filenames = "d"; toggle_filenames = "d";
toggle_fixed_geometry = "g"; toggle_fixed_geometry = "g";
toggle_pause = "h"; toggle_pause = "h";
toggle_pointer = "a"; toggle_pointer = "a";
size_to_image = "w"; size_to_image = "w";
jump_random = "z"; jump_random = "z";
jump_first = "J"; jump_first = "J";
jump_last = "K"; jump_last = "K";
jump_fwd = "H"; jump_fwd = "H";
jump_back = "L"; jump_back = "L";
scroll_left = "b"; scroll_left = "b";
scroll_right = "n"; scroll_right = "n";
scroll_up = [ "u" "Up" ]; scroll_up = [ "u" "Up" ];
scroll_down = [ "d" "Down" ]; scroll_down = [ "d" "Down" ];
zoom_default = "o"; zoom_default = "o";
zoom_fill = "p"; zoom_fill = "p";
toggle_auto_zoom = "m"; toggle_auto_zoom = "m";
toggle_actions = null; toggle_actions = null;
toggle_aliasing = null; toggle_aliasing = null;
toggle_caption = null; toggle_caption = null;
toggle_exif = null; toggle_exif = null;
save_filelist = null; save_filelist = null;
toggle_info = null; toggle_info = null;
toggle_keep_vp = null; toggle_keep_vp = null;
toggle_menu = null; toggle_menu = null;
reload_image = null; reload_image = null;
save_image = null; save_image = null;
prev_dir = null; prev_dir = null;
next_dir = null; next_dir = null;
orient_3 = null; orient_3 = null;
orient_1 = null; orient_1 = null;
flip = null; flip = null;
mirror = null; mirror = null;
action_0 = null; action_0 = null;
action_1 = null; action_1 = null;
action_2 = null; action_2 = null;
action_3 = null; action_3 = null;
action_4 = null; action_4 = null;
action_5 = null; action_5 = null;
action_6 = null; action_6 = null;
action_7 = null; action_7 = null;
action_8 = null; action_8 = null;
action_9 = null; action_9 = null;
close = null; close = null;
reload_plus = null; reload_plus = null;
reload_minus = null; reload_minus = null;
remove = null; remove = null;
delete = null; delete = null;
scroll_left_page = null; scroll_left_page = null;
scroll_right_page = null; scroll_right_page = null;
scroll_up_page = null; scroll_up_page = null;
scroll_down_page = null; scroll_down_page = null;
render = null; render = null;
zoom_fit = null; zoom_fit = null;
menu_close = null; menu_close = null;
menu_up = null; menu_up = null;
menu_down = null; menu_down = null;
menu_parent = null; menu_parent = null;
menu_child = null; menu_child = null;
menu_select = null; menu_select = null;
}; };
}; };
}
];
} }

View File

@ -1,62 +1,58 @@
{ pkgs, ... }: { pkgs, ... }:
let VARIABLES = import ../../src/variables.nix; in { let VARIABLES = import ../../src/variables.nix; in {
environment.systemPackages = with pkgs; [ tig git ]; home.packages = with pkgs; [ tig ];
home-manager.sharedModules = [ xdg.configFile."tig/config".text = ''
{ color cursor black green bold
xdg.configFile."tig/config".text = '' color title-focus black blue bold
color cursor black green bold color title-blur black blue bold
color title-focus black blue bold '';
color title-blur black blue bold
'';
programs.git = { programs.git = {
enable = true; enable = true;
extraConfig = { extraConfig = {
include.path = "~/.gituser"; include.path = "~/.gituser";
commit.gpgsign = true; commit.gpgsign = true;
core = { core = {
editor = "nvim"; editor = "nvim";
autocrlf = false; autocrlf = false;
quotePath = false; quotePath = false;
};
web.browser = VARIABLES.defaultBrowser;
push.default = "simple";
branch.autosetuprebase = "always";
init.defaultBranch = "master";
rerere.enabled = true;
color.ui = true;
alias = {
contrib = "shortlog -n -s";
remotes = "remote -v";
praise = "blame";
verify = "log --show-signature";
};
"color \"diff-highlight\"" = {
oldNormal = "red bold";
oldHighlight = "red bold";
newNormal = "green bold";
newHighlight = "green bold";
};
"color \"diff\"" = {
meta = "yellow";
frag = "magenta bold";
commit = "yellow bold";
old = "red bold";
new = "green bold";
whitespace = "red reverse";
};
};
diff-so-fancy.enable = true;
}; };
}
]; web.browser = VARIABLES.defaultBrowser;
push.default = "simple";
branch.autosetuprebase = "always";
init.defaultBranch = "master";
rerere.enabled = true;
color.ui = true;
alias = {
contrib = "shortlog -n -s";
remotes = "remote -v";
praise = "blame";
verify = "log --show-signature";
};
"color \"diff-highlight\"" = {
oldNormal = "red bold";
oldHighlight = "red bold";
newNormal = "green bold";
newHighlight = "green bold";
};
"color \"diff\"" = {
meta = "yellow";
frag = "magenta bold";
commit = "yellow bold";
old = "red bold";
new = "green bold";
whitespace = "red reverse";
};
};
diff-so-fancy.enable = true;
};
} }

View File

@ -1,27 +1,23 @@
{ {
home-manager.sharedModules = [ programs.gpg = {
{ enable = true;
programs.gpg = { # homedir = "${config.xdg.dataHome}/gnupg"
enable = true; settings = {
# homedir = "${config.xdg.dataHome}/gnupg" personal-digest-preferences = "SHA512";
settings = { cert-digest-algo = "SHA512";
personal-digest-preferences = "SHA512"; cipher-algo = "AES256";
cert-digest-algo = "SHA512"; default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
cipher-algo = "AES256"; personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES";
default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed"; throw-keyids = true;
personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES"; keyid-format = "0xlong";
throw-keyids = true; with-fingerprint = true;
keyid-format = "0xlong"; };
with-fingerprint = true; };
};
};
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
pinentryFlavor = "curses"; pinentryFlavor = "curses";
defaultCacheTtl = 43200; defaultCacheTtl = 43200;
maxCacheTtl = 43200; maxCacheTtl = 43200;
}; };
}
];
} }

View File

@ -1,32 +1,28 @@
let VARIABLES = import ../../src/variables.nix; in { let VARIABLES = import ../../src/variables.nix; in {
home-manager.sharedModules = [ programs.kitty = {
{ enable = true;
programs.kitty = {
enable = true;
settings = { settings = {
enable_audio_bell = false; enable_audio_bell = false;
close_on_child_death = true; close_on_child_death = true;
cursor_blink_interval = 0; cursor_blink_interval = 0;
open_url_with = VARIABLES.defaultBrowser; open_url_with = VARIABLES.defaultBrowser;
wayland_titlebar_color = "background"; wayland_titlebar_color = "background";
allow_remote_control = true; allow_remote_control = true;
listen_on = "unix:/tmp/kitty"; listen_on = "unix:/tmp/kitty";
dynamic_background_opacity = true; dynamic_background_opacity = true;
window_padding_width = 5; window_padding_width = 5;
tab_bar_margin_width = 5; tab_bar_margin_width = 5;
}; };
}; };
xdg.configFile."kitty/diff.conf".text = '' xdg.configFile."kitty/diff.conf".text = ''
map d scroll_to next-page map d scroll_to next-page
map u scroll_to prev-page map u scroll_to prev-page
map g scroll_to start map g scroll_to start
map G scroll_to end map G scroll_to end
''; '';
}
];
} }

View File

@ -1,18 +1,14 @@
let VARIABLES = import ../../src/variables.nix; in { let VARIABLES = import ../../src/variables.nix; in {
home-manager.sharedModules = [ xdg.mimeApps = {
{ enable = true;
xdg.mimeApps = { defaultApplications = {
enable = true; "image/png" = "feh.desktop";
defaultApplications = { "image/jpeg" = "feh.desktop";
"image/png" = "feh.desktop"; "image/gif" = "org.qutebrowser.qutebrowser.desktop";
"image/jpeg" = "feh.desktop"; "application/x-wine-extension-osz" = "osu-stable.desktop";
"image/gif" = "org.qutebrowser.qutebrowser.desktop"; "application/x-vmware-vm" = "vmware-workstation.desktop";
"application/x-wine-extension-osz" = "osu-stable.desktop"; "x-scheme-handler/http" = "${VARIABLES.defaultBrowser}.desktop";
"application/x-vmware-vm" = "vmware-workstation.desktop"; "x-scheme-handler/https" = "${VARIABLES.defaultBrowser}.desktop";
"x-scheme-handler/http" = "${VARIABLES.defaultBrowser}.desktop"; };
"x-scheme-handler/https" = "${VARIABLES.defaultBrowser}.desktop"; };
};
};
}
];
} }

View File

@ -1,36 +1,34 @@
{ pkgs, ... }: { { pkgs, ... }: {
home-manager.sharedModules = [ programs.mpv = {
{ enable = true;
programs.mpv = {
enable = true; config = {
config = { screenshot-format = "png";
screenshot-format = "png"; profile = "gpu-hq";
profile = "gpu-hq"; scale = "ewa_lanczossharp";
scale = "ewa_lanczossharp"; cscale = "ewa_lanczossharp";
cscale = "ewa_lanczossharp"; video-sync = "display-resample";
video-sync = "display-resample"; interpolation = true;
interpolation = true; tscale = "oversample";
tscale = "oversample"; sub-auto = "fuzzy";
sub-auto = "fuzzy"; sub-font = "Noto Sans CJK JP Medium";
sub-font = "Noto Sans CJK JP Medium"; sub-blur = 10;
sub-blur = 10; sub-file-paths = "subs:subtitles:";
sub-file-paths = "subs:subtitles:"; fullscreen = "yes";
fullscreen = "yes"; title = "\${filename} - mpv";
title = "\${filename} - mpv"; script-opts = "osc-title=\${filename},osc-boxalpha=150,osc-showfullscreen=no,osc-boxvideo=yes";
script-opts = "osc-title=\${filename},osc-boxalpha=150,osc-showfullscreen=no,osc-boxvideo=yes"; osc = "no";
osc = "no"; osd-on-seek = "no";
osd-on-seek = "no"; osd-bar = "no";
osd-bar = "no"; osd-bar-w = 30;
osd-bar-w = 30; osd-bar-h = "0.2";
osd-bar-h = "0.2"; osd-duration = 750;
osd-duration = 750; really-quiet = "yes";
really-quiet = "yes"; };
};
scripts = with pkgs.mpvScripts; [ scripts = with pkgs.mpvScripts; [
mpris mpris
thumbnail thumbnail
]; ];
}; };
}
];
} }

View File

@ -1,65 +1,61 @@
{ pkgs, ... }: { pkgs, ... }:
let VARIABLES = import ../../src/variables.nix; in { let VARIABLES = import ../../src/variables.nix; in {
home-manager.sharedModules = [ home.packages = with pkgs; [ mpc-cli ];
{
services.mpd = {
enable = true;
musicDirectory = "/home/${VARIABLES.username}/Music";
};
xdg.configFile."mpd/mpd.conf".text = '' services.mpd = {
auto_update "yes" enable = true;
''; musicDirectory = "/home/${VARIABLES.username}/Music";
};
xdg.configFile."ncmpcpp/on-song-change.sh".source = ./on-song-change.sh; xdg.configFile."mpd/mpd.conf".text = ''
auto_update "yes"
'';
programs.ncmpcpp = { xdg.configFile."ncmpcpp/on-song-change.sh".source = ./on-song-change.sh;
enable = true;
bindings = [ programs.ncmpcpp = {
{ key = "mouse"; command = "dummy"; } enable = true;
{ key = "h"; command = [ "previous_column" "jump_to_parent_directory" ]; }
{ key = "j"; command = "scroll_down"; }
{ key = "k"; command = "scroll_up"; }
{ key = "l"; command = [ "next_column" "enter_directory" "play_item" ]; }
{ key = "H"; command = [ "select_item" "scroll_down" ]; }
{ key = "J"; command = [ "move_sort_order_down" "move_selected_items_down" ]; }
{ key = "K"; command = [ "move_sort_order_up" "move_selected_items_up" ]; }
{ key = "L"; command = [ "select_item" "scroll_up" ]; }
{ key = "'"; command = "remove_selection"; }
{ key = "ctrl-u"; command = "page_up"; }
{ key = "ctrl-d"; command = "page_down"; }
{ key = "u"; command = "page_up"; }
{ key = "d"; command = "page_down"; }
{ key = "n"; command = "next_found_item"; }
{ key = "N"; command = "previous_found_item"; }
{ key = "t"; command = "next_screen"; }
{ key = "g"; command = "move_home"; }
{ key = "G"; command = "move_end"; }
{ key = "w"; command = "next"; }
{ key = "b"; command = "previous"; }
{ key = ";"; command = "seek_forward"; }
{ key = ","; command = "seek_backward"; }
{ key = "f"; command = "apply_filter"; }
{ key = "i"; command = "select_item"; }
{ key = "x"; command = [ "delete_playlist_items" "delete_browser_items" "delete_stored_playlist" ]; }
{ key = "U"; command = "update_database"; }
{ key = "m"; command = "add_random_items"; }
];
settings = { bindings = [
ncmpcpp_directory = "~/.config/ncmpcpp"; { key = "mouse"; command = "dummy"; }
user_interface = "alternative"; { key = "h"; command = [ "previous_column" "jump_to_parent_directory" ]; }
autocenter_mode = "yes"; { key = "j"; command = "scroll_down"; }
allow_for_physical_item_deletion = "no"; { key = "k"; command = "scroll_up"; }
mouse_support = "no"; { key = "l"; command = [ "next_column" "enter_directory" "play_item" ]; }
execute_on_song_change = "~/.config/ncmpcpp/on-song-change.sh"; { key = "H"; command = [ "select_item" "scroll_down" ]; }
mpd_crossfade_time = 3; { key = "J"; command = [ "move_sort_order_down" "move_selected_items_down" ]; }
}; { key = "K"; command = [ "move_sort_order_up" "move_selected_items_up" ]; }
}; { key = "L"; command = [ "select_item" "scroll_up" ]; }
} { key = "'"; command = "remove_selection"; }
]; { key = "ctrl-u"; command = "page_up"; }
{ key = "ctrl-d"; command = "page_down"; }
{ key = "u"; command = "page_up"; }
{ key = "d"; command = "page_down"; }
{ key = "n"; command = "next_found_item"; }
{ key = "N"; command = "previous_found_item"; }
{ key = "t"; command = "next_screen"; }
{ key = "g"; command = "move_home"; }
{ key = "G"; command = "move_end"; }
{ key = "w"; command = "next"; }
{ key = "b"; command = "previous"; }
{ key = ";"; command = "seek_forward"; }
{ key = ","; command = "seek_backward"; }
{ key = "f"; command = "apply_filter"; }
{ key = "i"; command = "select_item"; }
{ key = "x"; command = [ "delete_playlist_items" "delete_browser_items" "delete_stored_playlist" ]; }
{ key = "U"; command = "update_database"; }
{ key = "m"; command = "add_random_items"; }
];
environment.systemPackages = with pkgs; [ mpc-cli ]; settings = {
ncmpcpp_directory = "~/.config/ncmpcpp";
user_interface = "alternative";
autocenter_mode = "yes";
allow_for_physical_item_deletion = "no";
mouse_support = "no";
execute_on_song_change = "~/.config/ncmpcpp/on-song-change.sh";
mpd_crossfade_time = 3;
};
};
} }

View File

@ -1,142 +1,138 @@
{ pkgs, ... }: { { pkgs, ... }: {
home-manager.sharedModules = [ programs.qutebrowser = {
{ enable = true;
programs.qutebrowser = { package = pkgs.qutebrowser-qt6;
enable = true;
package = pkgs.qutebrowser-qt6;
settings = { settings = {
confirm_quit = [ confirm_quit = [
"multiple-tabs" "multiple-tabs"
"downloads" "downloads"
]; ];
session.lazy_restore = true; session.lazy_restore = true;
tabs = { tabs = {
show = "multiple"; show = "multiple";
mousewheel_switching = false; mousewheel_switching = false;
last_close = "close"; last_close = "close";
new_position.unrelated = "next"; new_position.unrelated = "next";
};
content = {
persistent_storage = true;
notifications.enabled = true;
register_protocol_handler = true;
mute = true;
headers.accept_language = "ja,en-US;q=0.9,en;q=0.8";
};
fileselect = {
handler = "external";
folder.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
multiple_files.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
single_file.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
};
editor.command = [ "kitty" "-e" "nvim" "{}" ];
};
keyBindings = {
normal = {
d = "scroll-page 0 0.5";
u = "scroll-page 0 -0.5";
D = "scroll-page 0 0.5";
U = "scroll-page 0 -0.5";
"<Alt+Left>" = "back";
"<Alt+Right>" = "forward";
"<Ctrl+Shift+Tab>" = "tab-prev";
"<Ctrl+Tab>" = "tab-next";
J = "tab-prev";
K = "tab-next";
"<F12>" = "devtools";
zb = "bookmark-del";
x = "tab-close";
X = "undo";
st = "config-cycle tabs.show multiple switching";
sTh = "set tabs.position left";
sTj = "set tabs.position bottom";
sTk = "set tabs.position top";
sTl = "set tabs.position right";
};
};
extraConfig = /* python */ ''
# Mute tabs by default
from qutebrowser.mainwindow import tabwidget
tabwidget.TabWidget.MUTE_STRING = ""
tabwidget.TabWidget.AUDIBLE_STRING = "[A]"
# Better context menu colors
c.colors.contextmenu.disabled.fg = '#808080'
c.colors.contextmenu.menu.bg = '#353535'
c.colors.contextmenu.menu.fg = '#ffffff'
c.colors.contextmenu.selected.bg = '#909090'
# Chromium flags
c.qt.args = ["disable-backing-store-limit", "enable-accelerated-video-decode", "disable-gpu-driver-bug-workarounds"]
c.qt.chromium.low_end_device_mode = 'never'
# Download settings
c.downloads.location.directory = "$HOME/Downloads"
c.downloads.location.prompt = False
c.downloads.position = "bottom"
c.downloads.remove_finished = 5000
# Increase the default scroll offset of j/k
# NOTE: Unfortunately this breaks websites that use their own keybinds for j/k/etc
# config.bind('j', 'run-with-count 5 scroll down')
# config.bind('k', 'run-with-count 5 scroll up')
# NOTE: Use with smooth scrolling enabled to scroll smoothly
# config.bind('d', 'run-with-count 12 scroll down')
# config.bind('u', 'run-with-count 12 scroll up')
# Don't paste something by accident
config.unbind('pp', mode='normal')
config.unbind('pP', mode='normal')
config.unbind('Pp', mode='normal')
config.unbind('PP', mode='normal')
config.unbind('wp', mode='normal')
config.unbind('wP', mode='normal')
# Easily enter account information
# NOTE: I re-evaluated pass when I was focusing on a terminal-centric workflow.
config.bind('zl', 'spawn --userscript qute-pass')
config.bind('zpl', 'spawn --userscript qute-pass --password-only')
config.bind('zol', 'spawn --userscript qute-pass --otp-only')
# Hide the status bar except under exceptional circumstances
# NOTE: This broke more things than not, which is why I ultimately decided
# to always use the status bar. More information can be found in the
# following discussion: https://github.com/qutebrowser/qutebrowser/issues/2236
# config.bind('o', 'set statusbar.show always;; set-cmd-text -s :open')
# config.bind('O', 'set statusbar.show always;; set-cmd-text -s :open -t')
# config.bind('T', 'set statusbar.show always;; set-cmd-text -sr :tab-focus')
# config.bind(':', 'set statusbar.show always;; set-cmd-text :')
# config.bind('/', 'set statusbar.show always;; set-cmd-text /')
# config.bind('<Escape>', 'mode-enter normal;; set statusbar.show in-mode', mode='command')
config.bind('zM', 'spawn mpv --force-window=immediate {url}')
config.bind('zm', 'hint links spawn mpv --force-window=immediate {hint-url}')
# Use proxy websites for popular services
config.bind('zu', 'hint links spawn -u untrack-url -O {hint-url}')
# Don't automatically enter/leave insert mode
# NOTE: This was originally done to prevent insert mode from prematurely exiting
# in certain # cases (such as mouse usage), although keeping auto functionality
# seems to be more useful # long-term.
c.input.insert_mode.auto_enter = False
c.input.insert_mode.auto_leave = False
c.url.start_pages = ['about:blank']
c.url.default_page = "about:blank"
c.url.searchengines = {
'DEFAULT': 'https://search.goo.ne.jp/web.jsp?MT={}'
}
'';
}; };
}
]; content = {
persistent_storage = true;
notifications.enabled = true;
register_protocol_handler = true;
mute = true;
headers.accept_language = "ja,en-US;q=0.9,en;q=0.8";
};
fileselect = {
handler = "external";
folder.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
multiple_files.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
single_file.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
};
editor.command = [ "kitty" "-e" "nvim" "{}" ];
};
keyBindings = {
normal = {
d = "scroll-page 0 0.5";
u = "scroll-page 0 -0.5";
D = "scroll-page 0 0.5";
U = "scroll-page 0 -0.5";
"<Alt+Left>" = "back";
"<Alt+Right>" = "forward";
"<Ctrl+Shift+Tab>" = "tab-prev";
"<Ctrl+Tab>" = "tab-next";
J = "tab-prev";
K = "tab-next";
"<F12>" = "devtools";
zb = "bookmark-del";
x = "tab-close";
X = "undo";
st = "config-cycle tabs.show multiple switching";
sTh = "set tabs.position left";
sTj = "set tabs.position bottom";
sTk = "set tabs.position top";
sTl = "set tabs.position right";
};
};
extraConfig = /* python */ ''
# Mute tabs by default
from qutebrowser.mainwindow import tabwidget
tabwidget.TabWidget.MUTE_STRING = ""
tabwidget.TabWidget.AUDIBLE_STRING = "[A]"
# Better context menu colors
c.colors.contextmenu.disabled.fg = '#808080'
c.colors.contextmenu.menu.bg = '#353535'
c.colors.contextmenu.menu.fg = '#ffffff'
c.colors.contextmenu.selected.bg = '#909090'
# Chromium flags
c.qt.args = ["disable-backing-store-limit", "enable-accelerated-video-decode", "disable-gpu-driver-bug-workarounds"]
c.qt.chromium.low_end_device_mode = 'never'
# Download settings
c.downloads.location.directory = "$HOME/Downloads"
c.downloads.location.prompt = False
c.downloads.position = "bottom"
c.downloads.remove_finished = 5000
# Increase the default scroll offset of j/k
# NOTE: Unfortunately this breaks websites that use their own keybinds for j/k/etc
# config.bind('j', 'run-with-count 5 scroll down')
# config.bind('k', 'run-with-count 5 scroll up')
# NOTE: Use with smooth scrolling enabled to scroll smoothly
# config.bind('d', 'run-with-count 12 scroll down')
# config.bind('u', 'run-with-count 12 scroll up')
# Don't paste something by accident
config.unbind('pp', mode='normal')
config.unbind('pP', mode='normal')
config.unbind('Pp', mode='normal')
config.unbind('PP', mode='normal')
config.unbind('wp', mode='normal')
config.unbind('wP', mode='normal')
# Easily enter account information
# NOTE: I re-evaluated pass when I was focusing on a terminal-centric workflow.
config.bind('zl', 'spawn --userscript qute-pass')
config.bind('zpl', 'spawn --userscript qute-pass --password-only')
config.bind('zol', 'spawn --userscript qute-pass --otp-only')
# Hide the status bar except under exceptional circumstances
# NOTE: This broke more things than not, which is why I ultimately decided
# to always use the status bar. More information can be found in the
# following discussion: https://github.com/qutebrowser/qutebrowser/issues/2236
# config.bind('o', 'set statusbar.show always;; set-cmd-text -s :open')
# config.bind('O', 'set statusbar.show always;; set-cmd-text -s :open -t')
# config.bind('T', 'set statusbar.show always;; set-cmd-text -sr :tab-focus')
# config.bind(':', 'set statusbar.show always;; set-cmd-text :')
# config.bind('/', 'set statusbar.show always;; set-cmd-text /')
# config.bind('<Escape>', 'mode-enter normal;; set statusbar.show in-mode', mode='command')
config.bind('zM', 'spawn mpv --force-window=immediate {url}')
config.bind('zm', 'hint links spawn mpv --force-window=immediate {hint-url}')
# Use proxy websites for popular services
config.bind('zu', 'hint links spawn -u untrack-url -O {hint-url}')
# Don't automatically enter/leave insert mode
# NOTE: This was originally done to prevent insert mode from prematurely exiting
# in certain # cases (such as mouse usage), although keeping auto functionality
# seems to be more useful # long-term.
c.input.insert_mode.auto_enter = False
c.input.insert_mode.auto_leave = False
c.url.start_pages = ['about:blank']
c.url.default_page = "about:blank"
c.url.searchengines = {
'DEFAULT': 'https://search.goo.ne.jp/web.jsp?MT={}'
}
'';
};
} }

View File

@ -1,28 +1,24 @@
{ lib, ... }: { { lib, ... }: {
home-manager.sharedModules = [ programs.rofi = {
{ enable = true;
programs.rofi = { cycle = false;
enable = true;
cycle = false;
extraConfig = { extraConfig = {
modi = "drun,filebrowser"; modi = "drun,filebrowser";
font = "Noto Sans CJK JP 12"; font = "Noto Sans CJK JP 12";
show-icons = true; show-icons = true;
bw = 0; bw = 0;
display-drun = ""; display-drun = "";
display-window = ""; display-window = "";
display-combi = ""; display-combi = "";
icon-theme = "Fluent-dark"; icon-theme = "Fluent-dark";
terminal = "kitty"; terminal = "kitty";
drun-match-fields = "name"; drun-match-fields = "name";
drun-display-format = "{name}"; drun-display-format = "{name}";
me-select-entry = ""; me-select-entry = "";
me-accept-entry = "MousePrimary"; me-accept-entry = "MousePrimary";
}; };
theme = lib.mkForce ./launchpad.rasi; theme = lib.mkForce ./launchpad.rasi;
}; };
}
];
} }

View File

@ -1,160 +1,154 @@
{ lib { lib, ... }: {
, ... programs.waybar = {
}: { enable = true;
home-manager.sharedModules = [
{
programs.waybar = {
enable = true;
settings = { settings = {
mainBar = { mainBar = {
layer = "top"; layer = "top";
position = "right"; position = "right";
width = 45; width = 45;
spacing = 8; spacing = 8;
modules-left = [ "wlr/workspaces" "custom/new-workspace" ]; modules-left = [ "wlr/workspaces" "custom/new-workspace" ];
modules-right = [ "tray" "wireplumber" "backlight" "battery" "clock" ]; modules-right = [ "tray" "wireplumber" "backlight" "battery" "clock" ];
tray = { tray = {
icon-size = 24; icon-size = 24;
spacing = 8; spacing = 8;
}; };
"wlr/workspaces" = { "wlr/workspaces" = {
on-click = "activate"; on-click = "activate";
sort-by-number = true; sort-by-number = true;
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
"1" = ""; "1" = "";
"2" = ""; "2" = "";
"3" = ""; "3" = "";
"4" = ""; "4" = "";
"5" = ""; "5" = "";
"6" = ""; "6" = "";
"7" = ""; "7" = "";
"8" = ""; "8" = "";
"9" = ""; "9" = "";
"10" = ""; "10" = "";
}; };
}; };
wireplumber = { wireplumber = {
format = "{icon}"; format = "{icon}";
tooltip-format = "{volume}% {node_name}"; tooltip-format = "{volume}% {node_name}";
format-muted = ""; format-muted = "";
format-icons = [ "" "" ]; format-icons = [ "" "" ];
}; };
battery = { battery = {
"format" = "{icon}"; "format" = "{icon}";
"tooltip-format" = "{capacity}% {timeTo}"; "tooltip-format" = "{capacity}% {timeTo}";
"format-icons" = [ "" "" "" "" "" ]; "format-icons" = [ "" "" "" "" "" ];
}; };
clock = { clock = {
"format" = "{:%H\n%M}"; "format" = "{:%H\n%M}";
"tooltip-format" = "<tt>{calendar}</tt>"; "tooltip-format" = "<tt>{calendar}</tt>";
"calendar" = { "calendar" = {
"mode" = "month"; "mode" = "month";
"weeks-pos" = "right"; "weeks-pos" = "right";
"format" = { "format" = {
"months" = "<span color='#ffead3'><b>{}</b></span>"; "months" = "<span color='#ffead3'><b>{}</b></span>";
"days" = "<span color='#ecc6d9'><b>{}</b></span>"; "days" = "<span color='#ecc6d9'><b>{}</b></span>";
"weeks" = "<span size='14pt' color='#99ffdd'><b>W{}</b></span>"; "weeks" = "<span size='14pt' color='#99ffdd'><b>W{}</b></span>";
"weekdays" = "<span size='18pt' color='#ffcc66'><b>{}</b></span>"; "weekdays" = "<span size='18pt' color='#ffcc66'><b>{}</b></span>";
"today" = "<span color='#ff6699'><b>{}</b></span>"; "today" = "<span color='#ff6699'><b>{}</b></span>";
};
};
};
backlight = {
"format" = "{icon}";
"format-icons" = [ "" "" ];
};
"custom/new-workspace" = {
"format" = "+";
"on-click" = "hyprctl dispatch workspace empty && sleep 0.1 && rofi -show drun";
"on-click-right" = "sleep 0.1 && rofi -show drun";
"on-click-middle" = "hyprctl dispatch workspace empty";
"tooltip" = false;
}; };
}; };
}; };
style = lib.mkForce /* css */ '' backlight = {
@define-color base00 #272822; "format" = "{icon}";
@define-color base01 #383830; "format-icons" = [ "" "" ];
@define-color base02 #49483e; };
@define-color base03 #75715e;
@define-color base04 #a59f85;
@define-color base05 #f8f8f2;
@define-color base06 #f5f4f1;
@define-color base07 #f9f8f5;
@define-color base08 #f92672;
@define-color base09 #fd971f;
@define-color base0A #f4bf75;
@define-color base0B #a6e22e;
@define-color base0C #a1efe4;
@define-color base0D #66d9ef;
@define-color base0E #ae81ff;
@define-color base0F #cc6633;
* { "custom/new-workspace" = {
color: @base05; "format" = "+";
font-size: 16px; "on-click" = "hyprctl dispatch workspace empty && sleep 0.1 && rofi -show drun";
} "on-click-right" = "sleep 0.1 && rofi -show drun";
"on-click-middle" = "hyprctl dispatch workspace empty";
window#waybar { "tooltip" = false;
background: alpha(@base00, 0.92); };
border-left: 1px solid alpha(@base02, 0.67);
}
#workspaces button {
padding: 12px 0;
border-radius: 0;
border-bottom: 1px solid alpha(@base02, 0.5);
}
#workspaces button:hover {
background: inherit;
}
#workspaces button.active {
background: alpha(@base02, 0.5);
}
#window {
padding-top: 8px;
padding-bottom: 12px;
}
tooltip, #tray menu {
background: @base00;
border: 1px solid alpha(@base09, 0.93);
padding: 8px;
}
#backlight, #battery, #wireplumber {
font-family: "Font Awesome 6 Free Solid";
font-size: 24px;
}
#custom-new-workspace {
font-family: "Font Awesome 6 Free Solid";
padding-top: 8px;
padding-bottom: 8px;
color: alpha(@base0A, 0.67);
}
#clock {
font-size: 18px;
font-weight: bold;
padding-bottom: 8px;
}
'';
}; };
} };
];
style = lib.mkForce /* css */ ''
@define-color base00 #272822;
@define-color base01 #383830;
@define-color base02 #49483e;
@define-color base03 #75715e;
@define-color base04 #a59f85;
@define-color base05 #f8f8f2;
@define-color base06 #f5f4f1;
@define-color base07 #f9f8f5;
@define-color base08 #f92672;
@define-color base09 #fd971f;
@define-color base0A #f4bf75;
@define-color base0B #a6e22e;
@define-color base0C #a1efe4;
@define-color base0D #66d9ef;
@define-color base0E #ae81ff;
@define-color base0F #cc6633;
* {
color: @base05;
font-size: 16px;
}
window#waybar {
background: alpha(@base00, 0.92);
border-left: 1px solid alpha(@base02, 0.67);
}
#workspaces button {
padding: 12px 0;
border-radius: 0;
border-bottom: 1px solid alpha(@base02, 0.5);
}
#workspaces button:hover {
background: inherit;
}
#workspaces button.active {
background: alpha(@base02, 0.5);
}
#window {
padding-top: 8px;
padding-bottom: 12px;
}
tooltip, #tray menu {
background: @base00;
border: 1px solid alpha(@base09, 0.93);
padding: 8px;
}
#backlight, #battery, #wireplumber {
font-family: "Font Awesome 6 Free Solid";
font-size: 24px;
}
#custom-new-workspace {
font-family: "Font Awesome 6 Free Solid";
padding-top: 8px;
padding-bottom: 8px;
color: alpha(@base0A, 0.67);
}
#clock {
font-size: 18px;
font-weight: bold;
padding-bottom: 8px;
}
'';
};
} }

View File

@ -1,17 +1,13 @@
{ {
home-manager.sharedModules = [ programs.zathura = {
{ enable = true;
programs.zathura = {
enable = true;
options = { options = {
guioptions = "v"; guioptions = "v";
adjust-open = "width"; adjust-open = "width";
statusbar-basename = true; statusbar-basename = true;
render-loading = false; render-loading = false;
scroll-step = 120; scroll-step = 120;
}; };
}; };
}
];
} }