From 2699268b8145906baa09b339c42be1a509d9a9ef Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 13 Jan 2025 19:56:35 +0100 Subject: [PATCH 01/14] take --- home-modules/fish.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home-modules/fish.nix b/home-modules/fish.nix index b3dfcc1..8687dc2 100755 --- a/home-modules/fish.nix +++ b/home-modules/fish.nix @@ -100,6 +100,10 @@ end ''; functions = { + take = /* bash */ '' + mkdir $argv + cd $argv + ''; # gpg = ''; # set bold \e[1m # set green \e[32m From 3652cdfca978c4ae8a312a73b53436c474414377 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 13 Jan 2025 19:58:22 +0100 Subject: [PATCH 02/14] nxgs --- home-modules/nxgs.nix | 51 +++++++++++++++++++++++++++++++++++++++++++ home-modules/yazi.nix | 3 +++ home.nix | 2 ++ 3 files changed, 56 insertions(+) create mode 100644 home-modules/nxgs.nix diff --git a/home-modules/nxgs.nix b/home-modules/nxgs.nix new file mode 100644 index 0000000..3a79a2d --- /dev/null +++ b/home-modules/nxgs.nix @@ -0,0 +1,51 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + ghostscript + (writeShellApplication rec { + name = "nxgs"; + text = /* bash */ '' + print_help() { + echo "Usage: ${name} {flip |rotate |merge }" + } + if [ $# -lt 1 ]; then + print_help; exit 1; + fi + case "$1" in + flip) + for FILE in "''${@:2}"; do + NXGSTEMP=$(mktemp) + gs -o "$NXGSTEMP" -sDEVICE=pdfwrite -c "<> setpagedevice" -f "$FILE" + mv "$NXGSTEMP" "$FILE" + done + ;; + rotate) + for FILE in "''${@:2}"; do + NXGSTEMP=$(mktemp) + gs -o "$NXGSTEMP" -sDEVICE=pdfwrite -c "<> setpagedevice" -f "$FILE" + mv "$NXGSTEMP" "$FILE" + done + ;; + merge) + gs -dBATCH -dNOPAUSE -q -sOUTPUTFILE="$3" -sDEVICE=pdfwrite "''${@:3}" + ;; + interactive-merge) + echo -n "Enter Name of the merged file without extension: "; read -r MERGED + NXGSTEMP=$(mktemp) + echo "''${@:2}" | tr " " "\n" > "$NXGSTEMP" + $EDITOR "$NXGSTEMP" + mapfile -t FILES < "$NXGSTEMP" + gs -dBATCH -dNOPAUSE -q -sOUTPUTFILE="''${MERGED}.pdf" -sDEVICE=pdfwrite "''${FILES[@]}" + rm "$NXGSTEMP" + ;; + *) + echo "Error: Unknown command '$1'" + print_help + exit 1 + ;; + esac + exit 0 + ''; + }) + ]; +} diff --git a/home-modules/yazi.nix b/home-modules/yazi.nix index 0352170..1df41c0 100755 --- a/home-modules/yazi.nix +++ b/home-modules/yazi.nix @@ -188,6 +188,9 @@ { run = ''zathura "$@"''; desc = "zathura"; orphan = true; } { run = ''xournal "$@"''; desc = "xournal"; orphan = true; } { run = ''firefox "$@"''; desc = "firefox"; } + { run = ''nxgs flip "$@"''; desc = "nxgs flip"; } + { run = ''nxgs rotate "$@"''; desc = "nxgs rotate"; } + { run = ''nxgs interactive-merge "$@"''; block = true; desc = "nxgs merge"; } ]; "browser" = [ { run = ''firefox "$@"''; desc = "firefox"; } diff --git a/home.nix b/home.nix index 45f0168..886153a 100644 --- a/home.nix +++ b/home.nix @@ -32,6 +32,7 @@ ./home-modules/nixd.nix ./home-modules/nvidia.nix ./home-modules/nx2site.nix + ./home-modules/nxgs.nix # ./home-modules/nx-gcal-event.nix ./home-modules/obs.nix ./home-modules/office.nix @@ -91,6 +92,7 @@ cmake speedtest-go + imagemagick glib gsettings-desktop-schemas From 9c98199ee3e11288fc933d66ce7c7d3ae0e14e97 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 13 Jan 2025 19:59:04 +0100 Subject: [PATCH 03/14] scanning --- configuration.nix | 1 + home-modules/hyprland-autoname-workspaces.nix | 1 + home-modules/scanning.nix | 6 ++++++ home.nix | 1 + system-modules/scanning.nix | 10 ++++++++++ system-modules/users.nix | 2 ++ 6 files changed, 21 insertions(+) create mode 100644 home-modules/scanning.nix create mode 100644 system-modules/scanning.nix diff --git a/configuration.nix b/configuration.nix index eacaa22..94a44b1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -31,6 +31,7 @@ ./system-modules/nvidia.nix ./system-modules/ollama.nix ./system-modules/qmk.nix + ./system-modules/scanning.nix ./system-modules/sops.nix ./system-modules/sound.nix ./system-modules/sshd.nix diff --git a/home-modules/hyprland-autoname-workspaces.nix b/home-modules/hyprland-autoname-workspaces.nix index c7bf7c0..2abd412 100755 --- a/home-modules/hyprland-autoname-workspaces.nix +++ b/home-modules/hyprland-autoname-workspaces.nix @@ -47,6 +47,7 @@ "VirtualBox Machine" = "" "VirtualBox Manager" = "" "VSCodium" = "󰨞" + "Xsane" = "󰈈" "zathura" = "󰈦" "zoom" = "󰬡" ''; diff --git a/home-modules/scanning.nix b/home-modules/scanning.nix new file mode 100644 index 0000000..e131d7b --- /dev/null +++ b/home-modules/scanning.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + xsane + ]; +} diff --git a/home.nix b/home.nix index 886153a..9924640 100644 --- a/home.nix +++ b/home.nix @@ -47,6 +47,7 @@ ./home-modules/programming/python.nix ./home-modules/qt.nix ./home-modules/rofi.nix + ./home-modules/scanning.nix ./home-modules/sent.nix ./home-modules/sops.nix ./home-modules/ssh.nix diff --git a/system-modules/scanning.nix b/system-modules/scanning.nix new file mode 100644 index 0000000..ed066fa --- /dev/null +++ b/system-modules/scanning.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + hardware.sane = { + enable = true; + }; + services.avahi = { + enable = true; + nssmdns = true; + }; +} diff --git a/system-modules/users.nix b/system-modules/users.nix index 7920c80..a122398 100755 --- a/system-modules/users.nix +++ b/system-modules/users.nix @@ -11,6 +11,8 @@ "wheel" "audio" "video" + "lp" + "scanner" "docker" "libvirtd" "uinput" From 343fc2ac4e017ab5d0304134edfc8f72247fe66c Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 13 Jan 2025 20:03:19 +0100 Subject: [PATCH 04/14] second screen change --- home-modules/hyprland.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home-modules/hyprland.nix b/home-modules/hyprland.nix index 9cd41eb..8c49123 100755 --- a/home-modules/hyprland.nix +++ b/home-modules/hyprland.nix @@ -9,13 +9,13 @@ let main = { name = "eDP-1"; resolution = "1920x1200"; - position = "0x0"; + position = "0x1080"; scale = "1.0"; }; second = { - name = "DP-3"; + name = "DP-2"; resolution = "1920x1080"; - position = "1920x0"; + position = "0x0"; scale = "1.0"; }; }; From 9619164eb40eb8ca17f2d7d6c315be27860adf1a Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 13 Jan 2025 20:04:49 +0100 Subject: [PATCH 05/14] paperless non-admin fix --- system-modules/nx2site/paperless.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/system-modules/nx2site/paperless.nix b/system-modules/nx2site/paperless.nix index a5e45c9..6985252 100644 --- a/system-modules/nx2site/paperless.nix +++ b/system-modules/nx2site/paperless.nix @@ -190,7 +190,6 @@ let paperless-user = "paperless"; in # PAPERLESS_EMAIL_HOST_PASSWORD = "". # PAPERLESS_EMAIL_USE_TLS = false. # PAPERLESS_EMAIL_USE_SSL = false. - }; }; }; From 0fbb54a04a2feba870d1c66972532e038c682175 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 13 Jan 2025 20:05:02 +0100 Subject: [PATCH 06/14] adbfs --- system-modules/adb.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system-modules/adb.nix b/system-modules/adb.nix index d19df86..5378460 100644 --- a/system-modules/adb.nix +++ b/system-modules/adb.nix @@ -1,6 +1,9 @@ -{ host, lib, ... }: +{ pkgs, host, lib, ... }: lib.mkIf (host != "NxACE") { + environment.systemPackages = with pkgs; [ + adbfs-rootless + ]; programs.adb = { enable = true; }; From 89fa46aa6de88db66b89dd22de31962d112468d1 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 11:43:15 +0100 Subject: [PATCH 07/14] calendar ++ --- home-modules/calendar.nix | 113 +++++++++++++++++++++--------------- system-modules/calendar.nix | 5 ++ 2 files changed, 70 insertions(+), 48 deletions(-) create mode 100644 system-modules/calendar.nix diff --git a/home-modules/calendar.nix b/home-modules/calendar.nix index aa168c1..27069f5 100644 --- a/home-modules/calendar.nix +++ b/home-modules/calendar.nix @@ -1,81 +1,98 @@ -{ config, lib, user, secrets, domain, ... }: let +{ pkgs, lib, user, secrets, domain, ... }: let calendars = [ { name = "Preservation"; primary = true; - url = "https://dav.${domain}/nx2/preservation/"; + url = "https://dav.${domain}/${user}/preservation/"; color = "#dddddd"; } { name = "Effort"; - primary = false; - url = "https://dav.${domain}/nx2/effort/"; + url = "https://dav.${domain}/${user}/effort/"; color = "#dd2222"; } { name = "Experience"; - primary = false; - url = "https://dav.${domain}/nx2/experience/"; + url = "https://dav.${domain}/${user}/experience/"; color = "#2222dd"; } { name = "Exposure"; - primary = false; - url = "https://dav.${domain}/nx2/exposure/"; + url = "https://dav.${domain}/${user}/exposure/"; color = "#22aa22"; } { name = "Engagement"; - primary = false; - url = "https://dav.${domain}/nx2/engagement/"; + url = "https://dav.${domain}/${user}/engagement/"; color = "#8800CC"; } + { + name = "Sleep as Android"; + url = secrets.calendar.sleep-as-android-url; + color = "#111111"; + read-only = true; + type = "ics"; + } + { + name = "LEC"; + url = "https://zlypher.github.io/lol-events/cal/league-of-legends-lec.ical"; + color = "#A87000"; + read-only = true; + type = "ics"; + } + { + name = "Handball Männer"; + url = "http://i.cal.to/ical/108/dhb/handball-nationalmannschaft/c687e97f.bc7c3eb6-11a0e356.ics"; + color = "#880023"; + read-only = true; + type = "ics"; + } ]; + default_set = { + # name = + # url = + color = "#777777"; + read-only = false; + primary = false; + type = "caldav"; + }; in { + + home.packages = with pkgs; [ + gnome-calendar + thunderbird + ]; + accounts.calendar.accounts = let - makeCalendar = url: primary: color: { + transform_caledar_set = calendar_set: with calendar_set; { # transform set for accounts.calendar.accounts endpoint inherit primary; remote = { - type = "caldav"; - userName = user; - inherit url; + inherit url name; + userName = user; # my globally set username }; }; - m = cc: lib.attrsets.mergeAttrsList ( map (c: { "${c.name}" = makeCalendar c.url c.primary c.color;}) cc ); - in m calendars; - - - # TODO: Replace this once https://github.com/nix-community/home-manager/pull/5484 is merged. - # Make sure it works, though, including the order of calendars. - programs.thunderbird.settings = let - - makeThunderbirdCalendar = cal: let - calendarAccountSafeName = (builtins.replaceStrings ["."] ["-"]) cal.name; - in { - "calendar.registry.${calendarAccountSafeName}.cache.enabled" = true; - "calendar.registry.${calendarAccountSafeName}.calendar-main-default" = cal.primary; - "calendar.registry.${calendarAccountSafeName}.calendar-main-in-composite" = true; - "calendar.registry.${calendarAccountSafeName}.color" = cal.color; - "calendar.registry.${calendarAccountSafeName}.name" = cal.name; - "calendar.registry.${calendarAccountSafeName}.type" = "caldav"; - "calendar.registry.${calendarAccountSafeName}.uri" = config.accounts.calendar.accounts.${cal.name}.remote.url; - "calendar.registry.${calendarAccountSafeName}.username" = config.accounts.calendar.accounts.${cal.name}.remote.userName; - }; in lib.attrsets.mergeAttrsList ( - map (cal: makeThunderbirdCalendar cal) calendars + map (calendar: { + "${calendar.name}" = transform_caledar_set ( default_set // calendar ); + }) calendars + ); + + programs.thunderbird.settings = let + to_safe_name = name: (builtins.replaceStrings ["."] ["-"]) name; + in (lib.attrsets.mergeAttrsList ( + map (calendar: with ( default_set // calendar ); { + "calendar.registry.${to_safe_name calendar.name}.cache.enabled" = true; + "calendar.registry.${to_safe_name calendar.name}.calendar-main-default" = primary; + "calendar.registry.${to_safe_name calendar.name}.calendar-main-in-composite" = true; + "calendar.registry.${to_safe_name calendar.name}.color" = color; + "calendar.registry.${to_safe_name calendar.name}.name" = name; + "calendar.registry.${to_safe_name calendar.name}.type" = type; + "calendar.registry.${to_safe_name calendar.name}.uri" = url; + "calendar.registry.${to_safe_name calendar.name}.username" = user; + "calendar.registry.${to_safe_name calendar.name}.readOnly" = read-only; + }) calendars ) // { - - "calendar.registry.sleep-as-android.cache.enabled" = true; - "calendar.registry.sleep-as-android.calendar-main-in-composite" = true; - "calendar.registry.sleep-as-android.color" = "#222233"; - "calendar.registry.sleep-as-android.name" = "Sleep As Android"; - "calendar.registry.sleep-as-android.type" = "ics"; - "calendar.registry.sleep-as-android.readOnly" = true; - "calendar.registry.sleep-as-android.uri" = secrets.calendar.sleep-as-android-url; - - "calendar.list.sortOrder" = lib.fold (cal: acc: cal.name + " " + acc) "" calendars; - - # Keep these after removing the above. + "calendar.list.sortOrder" = lib.fold (calendar: acc: calendar.name + " " + acc) "" calendars; "calendar.week.start" = 1; - }; + }); } diff --git a/system-modules/calendar.nix b/system-modules/calendar.nix new file mode 100644 index 0000000..00b81e3 --- /dev/null +++ b/system-modules/calendar.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + programs.dconf.enable = true; + services.gnome.evolution-data-server.enable = true; +} From 94559de7ae3ae05be45454935bb3c5b2cd31e18e Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 11:43:24 +0100 Subject: [PATCH 08/14] better thunderbird css --- home-modules/email.nix | 55 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/home-modules/email.nix b/home-modules/email.nix index 36e9a98..374837d 100755 --- a/home-modules/email.nix +++ b/home-modules/email.nix @@ -5,7 +5,6 @@ lib.mkIf (host != "NxACE") thunderbird ]; - programs.thunderbird = let inherit (lib.generators) toJSON; extensions = toJSON {} { @@ -41,20 +40,56 @@ lib.mkIf (host != "NxACE") "mailnews.headers.showUserAgent" = true; "toolkit.legacyUserProfileCustomizations.stylesheets" = true; }; - # userChrome = with rice.color; /* css */ '' - # * { - # color: ${foreground} !important; - # background-color: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString 0.1}) !important; - # border: none !important; - # -moz-appearance: none !important; - # } - # ''; + userChrome = with rice.color; /* css */ '' + body, + #navigation-toolbox, + #calendarContent, + #calSidebar, + #tabpanelcontainer, + #spacesToolbar, + #tabs-toolbar, + #calMinimonth, + #primaryButtonSidePanel *, + .minimonth-week, + .multiday-header-corner, .day-column-heading, calendar-header-container, calendar-event-column, .multiday-hour-box, + #view-box, + #tabs-toolbar, + #status-bar, + .calview-toggle, + #calview-toggle-item, + #folderPaneHeaderBar, + #folderPane, + #threadPaneHeaderBar, + #threadTree, + #tabs-toolbar { + color: ${foreground} !important; + font-family: ${rice.font.base.name} !important; + background-color: transparent !important; + background-image: none !important; + border: none !important; + -moz-appearance: none !important; + } + .minimonth-nav-section { + background-color: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString rice.transparency}) !important; + border: ${builtins.toString rice.border-width}px solid ${border}; + } + .button, + .button-primary, + .tab-content[selected] { + background-color: ${accent.base}; + color: ${background}; + background-image: none; + } + html { + background-color: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString rice.transparency}) !important; + } + ''; }; }; }; - accounts.email.accounts = let + accounts.email.accounts = let OAuth2Settings = id: { "mail.smtpserver.smtp_${id}.authMethod" = 10; "mail.server.server_${id}.authMethod" = 10; From 73339cfc50241cfd4fb41247376baaba01ba9c13 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 22:06:32 +0100 Subject: [PATCH 09/14] waybar ws opaque --- home-modules/waybar.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home-modules/waybar.nix b/home-modules/waybar.nix index 6cba5d8..0b57ab1 100755 --- a/home-modules/waybar.nix +++ b/home-modules/waybar.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, user, rice, ... }: let +{ pkgs, rice, ... }: let sep = " "; in { home.packages = @@ -207,7 +207,7 @@ in { #workspaces button.active { color: rgb(${f background}); - background-color: rgba(${f accent.base},${builtins.toString rice.transparency}); + background-color: rgb(${f accent.base}); } #workspaces button:hover { From 207961e3974807f0f23ead3568eef0d0b86c29eb Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 22:06:58 +0100 Subject: [PATCH 10/14] better yazi bindings --- home-modules/yazi.nix | 55 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/home-modules/yazi.nix b/home-modules/yazi.nix index 1df41c0..1f55cc7 100755 --- a/home-modules/yazi.nix +++ b/home-modules/yazi.nix @@ -1,5 +1,4 @@ - -{ pkgs, system, rice, inputs, ... }: +{ pkgs, lib, system, rice, inputs, ... }: { home.packages = with pkgs; [ # yazi @@ -18,7 +17,7 @@ }; # initLua = /* lua */ '' ''; keymap = { - keymap = [ + manager.keymap = [ { on = ""; run = "escape"; desc = "Exit visual mode, clear selected, or cancel search"; } { on = "q"; run = "quit"; desc = "Exit the process"; } { on = "Q"; run = "quit --no-cwd-file"; desc = "Exit the process without writing cwd-file"; } @@ -61,11 +60,12 @@ { on = "K"; run = "seek -5"; desc = "Seek up 5 units in the preview"; } { on = "J"; run = "seek 5"; desc = "Seek down 5 units in the preview"; } # Selection - { on = ""; run = [ "select --state=none" "arrow 1" ]; desc = "Toggle the current selection state"; } + { on = ""; run = [ "toggle --state=none" "arrow 1" ]; desc = "Toggle the current selection state"; } { on = "v"; run = "visual_mode"; desc = "Enter visual mode (selection mode)"; } { on = "V"; run = "visual_mode --unset"; desc = "Enter visual mode (unset mode)"; } - { on = ""; run = "select_all --state=true"; desc = "Select all files"; } - { on = ""; run = "select_all --state=none"; desc = "Inverse selection of all files"; } + { on = ""; run = "toggle_all --state=on"; desc = "Select all files"; } + { on = ""; run = "toggle_all --state=off"; desc = "Deselect all files"; } + { on = ""; run = "toggle_all --state=none"; desc = "Inverse selection of all files"; } # Operation { on = "o"; run = "open"; desc = "Open selected files"; } { on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; } @@ -126,6 +126,7 @@ { on = [ "," "S" ]; run = [ "sort size --reverse" "linemode size" ]; desc = "Sort by size (reverse)"; } # Tab { on = "t"; run = "tab_create --current"; desc = "Create a new tab with CWD"; } + { on = ""; run = "close"; desc = "Close the current tab"; } { on = "1"; run = "tab_switch 0"; desc = "Switch to the first tab"; } { on = "2"; run = "tab_switch 1"; desc = "Switch to the second tab"; } { on = "3"; run = "tab_switch 2"; desc = "Switch to the third tab"; } @@ -135,14 +136,46 @@ { on = "7"; run = "tab_switch 6"; desc = "Switch to the seventh tab"; } { on = "8"; run = "tab_switch 7"; desc = "Switch to the eighth tab"; } { on = "9"; run = "tab_switch 8"; desc = "Switch to the ninth tab"; } + { on = ""; run = "tab_swap 0"; desc = "Swap current tab with the first tab"; } + { on = ""; run = "tab_swap 1"; desc = "Swap current tab with the second tab"; } + { on = ""; run = "tab_swap 2"; desc = "Swap current tab with the third tab"; } + { on = ""; run = "tab_swap 3"; desc = "Swap current tab with the fourth tab"; } + { on = ""; run = "tab_swap 4"; desc = "Swap current tab with the fifth tab"; } + { on = ""; run = "tab_swap 4"; desc = "Swap current tab with "; } + { on = ""; run = "tab_swap 5"; desc = "Swap current tab with the sixth tab"; } + { on = ""; run = "tab_swap 5"; desc = "Swap current tab with "; } + { on = ""; run = "tab_swap 6"; desc = "Swap current tab with the seventh tab"; } + { on = ""; run = "tab_swap 6"; desc = "Swap current tab with tab"; } + { on = ""; run = "tab_swap 7"; desc = "Swap current tab with the eighth tab"; } + { on = ""; run = "tab_swap 7"; desc = "Swap current tab with b"; } + { on = ""; run = "tab_swap 8"; desc = "Swap current tab with the ninth tab"; } + { on = ""; run = "tab_swap 8"; desc = "Swap current tab with "; } { on = "["; run = "tab_switch -1 --relative"; desc = "Switch to the previous tab"; } + { on = "["; run = "tab_switch -1 --relative"; desc = "Switch to thtab"; } { on = "]"; run = "tab_switch 1 --relative"; desc = "Switch to the next tab"; } + { on = "]"; run = "tab_switch 1 --relative"; desc = "Switch ttab"; } { on = "{"; run = "tab_swap -1"; desc = "Swap current tab with previous tab"; } + { on = "{"; run = "tab_swap -1"; desc = "Swap current tab wittab"; } { on = "}"; run = "tab_swap 1"; desc = "Swap current tab with next tab"; } - # Task + # Tasks { on = "w"; run = "tasks_show"; desc = "Show task manager"; } - # Hel + ]; + tasks.keymap = [ + # Task + { on = "w"; run = "close"; desc = "Close Task View"; } + { on = "q"; run = "close"; desc = "Close Task View"; } + { on = ""; run = "close"; desc = "Close Task View"; } + { on = "c"; run = "cancel"; desc = "Cancel Task"; } + { on = "i"; run = "inspect"; desc = "Inspect Task"; } + { on = "j"; run = "arrow -1"; desc = "Up in list"; } + { on = "k"; run = "arrow 1"; desc = "Down in list"; } + { on = "u"; run = "arrow -5"; desc = "Up in list (fast)"; } + { on = "d"; run = "arrow 5"; desc = "Down in list (fast)"; } + ]; + help = [ + # Help { on = "~"; run = "help"; desc = "Open help"; } + { on = "?"; run = "help"; desc = "Open help"; } { on = ""; run = "help"; desc = "Open help"; } ]; }; @@ -175,10 +208,12 @@ { run = ''imv "$@"''; desc = "imv"; } { run = ''gimp "$@"''; desc = "gimp"; } { run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$@"''; desc = "swww wallpaper"; } + { run = ''exiftool "$@"; echo "Press enter to exit"; read''; desc = "View Exif Data"; } + { run = ''for f in "$@"; do magick "$f" -auto-orient "''${f%.*}.pdf"; done''; desc = "Convert to PDF"; } ]; "svg" = [ { run = ''inkscape "$@"''; desc = "inkscape";} - { run = ''firefoc "$@"''; desc = "firefox";} + { run = ''firefox "$@"''; desc = "firefox";} ]; "font" = [ { run = ''fontpreview "$@"''; desc = "fontpreview"; } @@ -206,7 +241,7 @@ "shell" = [ { run = ''bash -c "$@"''; desc = "bash -c"; } { run = ''fish -c "$@"''; desc = "fish -c"; } - { run = ''sh -c "$@"''; desc = "sh -c"; } + { run = ''sh -c "$@"''; desc = "sh -c"; } ]; "python" = [ { run = ''python "$@"''; desc = "python"; } From 132c169e24afefdae5bb12650a6b8c148854dc43 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 22:07:14 +0100 Subject: [PATCH 11/14] sleeker zathura --- home-modules/zathura.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/home-modules/zathura.nix b/home-modules/zathura.nix index 37ab7f6..447f635 100644 --- a/home-modules/zathura.nix +++ b/home-modules/zathura.nix @@ -1,17 +1,20 @@ -{ pkgs, rice, ... }: +{ rice, ... }: { programs.zathura = { enable = true; - options = with rice.color; { + options = let + f = rice.lib.hex-to-rgb-comma-string; + t = builtins.toString rice.transparency; + in with rice.color; { completion-bg = background; completion-fg = foreground; completion-highlight-bg = background; completion-highlight-fg = accent.base; - default-bg = "rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString rice.transparency})"; + default-bg = "rgba(${f background},${t})"; default-fg = foreground; - highlight-active-color = "rgba(${rice.lib.hex-to-rgb-comma-string accent.base},0.5)"; - highlight-color = "rgba(${rice.lib.hex-to-rgb-comma-string secondary.base},0.5)"; - highlight-fg = "rgba(${rice.lib.hex-to-rgb-comma-string secondary.base},0.5)"; + highlight-active-color = "rgba(${f accent.base},0.5)"; + highlight-color = "rgba(${f secondary.base},0.5)"; + highlight-fg = "rgba(${f secondary.base},0.5)"; index-fg = accent.bright; index-bg = black.dark; index-active-fg = background; @@ -40,7 +43,7 @@ scroll-page-aware = true; smooth-scroll = true; scroll-full-overlap = 0.01; - scroll-step = 300; + scroll-step = 100; }; mappings = { h = ''feedkeys ""''; From 7324904db9cd7acec2111a6dbc3c7aa711139d49 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 22:08:46 +0100 Subject: [PATCH 12/14] helix all options --- home-modules/helix.nix | 192 ++++++++++++++++++++++++++++++++++------- 1 file changed, 161 insertions(+), 31 deletions(-) diff --git a/home-modules/helix.nix b/home-modules/helix.nix index 70ee40f..a0da2e3 100644 --- a/home-modules/helix.nix +++ b/home-modules/helix.nix @@ -6,6 +6,7 @@ # nil # nix language server # nixd # specified in nixd.nix gopls + delve python311Packages.python-lsp-server jdt-language-server ruff @@ -33,45 +34,175 @@ # theme = "base16_terminal"; theme = "base16"; editor = { + scrolloff = 5; + mouse = true; + # default-yank-register = "\""; + middle-click-paste = false; + scroll-lines = 3; + shell = ["sh" "-c"]; + line-number = "relative"; + cursorline = true; + cursorcolumn = true; + # continue-comments = false; + auto-completion = true; + path-completion = true; + auto-format = false; + idle-timeout = 250; + completion-timeout = 5; + preview-completion-insert = true; + completion-trigger-len = 1; + auto-info = true; + true-color = false; # is detected automatically if set to false + undercurl = false; # is detected automatically if set to false + rulers = []; + bufferline = "always"; + color-modes = true; + text-width = 120; + workspace-lsp-roots = []; + default-line-ending = "native"; + insert-final-newline = false; + popup-border = "all"; + indent-heuristic = "hybrid"; + jump-label-alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + # clip-board-provider = # selected automatically + end-of-line-diagnostics = "hint"; + statusline = { + left = [ "mode" + "spinner" + "file-name" + "read-only-indicator" + "file-type" + "version-control" + ]; + center = [ + "position-percentage" + "total-line-numbers" + "register" + ]; + right = [ + "spinner" + "diagnostics" + "selections" + "primary-selection-length" + "register" + "position" + "file-encoding" + ]; + # separator = " "; + mode = { + normal = "NORMAL"; + insert = "INSERT"; + select = "SELECT"; + }; + }; + lsp = { + enable = true; + display-messages = false; + auto-signature-help = true; + display-inlay-hints = true; + }; cursor-shape = { normal = "block"; insert = "bar"; select = "underline"; }; - soft-wrap = { - enable = true; + file-picker = { + hidden = false; # Enables ignoring hidden files + follow-symlinks = true; # Follow symlinks instead of ignoring them + deduplicate-links = true; # Ignore symlinks that point at files already shown in the picker + parents = true; # Enables reading ignore files from parent directories + ignore = true; # Enables reading .ignore files + git-ignore = true; # Enables reading .gitignore files + git-global = true; # Enables reading global .gitignore, whose path is specified in git's config: core.excludesfile option + git-exclude = true; # Enables reading .git/info/exclude files + # max-depth unset = ; # Set with an integer value for maximum depth to recurse + }; + auto-pairs = { + "(" = ")"; + "{" = "}"; + "[" = "]"; + "\"" = "\""; + "`" = "`"; + "<" = ">"; + # "/* " = " */"; + }; + auto-save = { + focus-lost = false; + after-delay = { + enable = false; + timeout = 3000; + }; + }; + search = { + smart-case = true; + wrap-around = true; + }; + whitespace = { + render = { + skip-levels = "none"; + space = "none"; + nbsp = "none"; + nnbsp = "none"; + tab = "none"; + newline = "none"; + tabpad = "none"; + }; + characters = { + skip-levels = 1; + space = "·"; + nbsp = "⍽"; + nnbsp = "␣"; + tab = "→"; + newline = "⏎"; + tabpad = "·"; + }; }; - line-number = "relative"; - color-modes = true; - bufferline = "always"; - popup-border = "all"; - completion-trigger-len = 1; - completion-timeout = 5; - file-picker.hidden = false; - middle-click-paste = false; - cursorline = true; indent-guides = { render = true; character = "╎"; + skip-levels = 0; }; - lsp.display-inlay-hints = true; - statusline.center = [ "position-percentage" ]; - true-color = true; - whitespace.characters = { - newline = "↴"; - tab = "⇥"; - skip-levels = 1; + gutters = [ + "diagnostics" + "spacer" + "line-numbers" + "spacer" + "diff" + ]; + # line-numbers = {}; + # layout.minwidth = 3; + # diagnostics = {}; + # diff = {}; + # spacer = {}; + soft-wrap = { + enable = true; + max-wrap = 20; + max-indent-retain = 40; + wrap-indicator = "↪"; + wrap-at-text-width = false; + }; + smart-tab = { + enable = false; + supersend-menu = false; + }; + inline-diagnostics = { + cursor-line = "hint"; + other-lines = "disable"; + prefix-len = 1; + # max-wrap = set above + max-diagnostics = 20; }; }; - keys.normal = { - "C-g" = [ ":new" ":insert-output lazygit" ":buffer-close!" ":redraw" ]; - "A-`" = [ "no_op" ]; - "`" = [ "no_op" ]; - }; - keys.normal."ö" = { - "s" = [ "switch_case" ]; - "u" = [ "switch_to_uppercase" ]; - "l" = [ "switch_to_lowercase" ]; + keys = { + normal = { + "C-g" = [ ":new" ":insert-output lazygit" ":buffer-close!" ":redraw" ]; + "A-`" = [ "no_op" ]; + "`" = [ "no_op" ]; + "ö" = { "s" = [ "switch_case" ]; "u" = [ "switch_to_uppercase" ]; "l" = [ "switch_to_lowercase" ]; }; + }; + select = { + "ö" = { "s" = [ "switch_case" ]; "u" = [ "switch_to_uppercase" ]; "l" = [ "switch_to_lowercase" ]; }; + }; }; }; languages = { @@ -94,7 +225,6 @@ file-types = [ "md" "MD" ]; scope = "text."; } - { name = "python"; language-servers = [ "pyright" "ruff" ]; @@ -173,7 +303,7 @@ base16 = with rice.color; { "attributes" = foreground; "comment" = { - "fg" = white.dark; + "fg" = black.bright; "modifiers" = [ "italic" ]; }; "constant" = accent.bright; @@ -319,8 +449,8 @@ "fg" = black.bright; }; "ui.virtual.inlay-hint" = { - "fg" = weird.bright; - "bg" = weird.dark; + "fg" = weird.dark; + "bg" = weird.base; }; "ui.virtual.ruler" = { "bg" = background; From 9612646c55f4ed5241f1a5935d991598a6f9b3bc Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 22:09:05 +0100 Subject: [PATCH 13/14] qbt in home --- home.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home.nix b/home.nix index 9924640..bd96a8f 100644 --- a/home.nix +++ b/home.nix @@ -95,6 +95,8 @@ speedtest-go imagemagick + qbittorrent + glib gsettings-desktop-schemas wl-clipboard From 5a6199a8a9e50239040e89ed61d066305169117c Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 19 Jan 2025 22:37:40 +0100 Subject: [PATCH 14/14] comment unknow options --- home-modules/helix.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/home-modules/helix.nix b/home-modules/helix.nix index a0da2e3..a3c5336 100644 --- a/home-modules/helix.nix +++ b/home-modules/helix.nix @@ -45,7 +45,7 @@ cursorcolumn = true; # continue-comments = false; auto-completion = true; - path-completion = true; + # path-completion = true; auto-format = false; idle-timeout = 250; completion-timeout = 5; @@ -65,7 +65,7 @@ indent-heuristic = "hybrid"; jump-label-alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; # clip-board-provider = # selected automatically - end-of-line-diagnostics = "hint"; + # end-of-line-diagnostics = "hint"; statusline = { left = [ "mode" "spinner" @@ -185,13 +185,13 @@ enable = false; supersend-menu = false; }; - inline-diagnostics = { - cursor-line = "hint"; - other-lines = "disable"; - prefix-len = 1; - # max-wrap = set above - max-diagnostics = 20; - }; + # inline-diagnostics = { + # cursor-line = "hint"; + # other-lines = "disable"; + # prefix-len = 1; + # # max-wrap = set above + # max-diagnostics = 20; + # }; }; keys = { normal = {