diff options
Diffstat (limited to '')
107 files changed, 2321 insertions, 1243 deletions
diff --git a/build.sh b/build.sh index 3c3d387c..0e574a3a 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,8 @@ #!/usr/bin/env sh host="${1-tiamat}" +[ "$#" -gt 0 ] && shift 1 + root="$(git rev-parse --show-toplevel)" SYSTEM_OUT="$root/result-system" @@ -19,7 +21,7 @@ check() { } build_system() { - _val="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link)" + _val="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link "$@")" exit_val="$?" if [ "$exit_val" -ne 0 ]; then @@ -30,7 +32,7 @@ build_system() { fi } -system="$(build_system)" +system="$(build_system "$@")" [ "$system" = "1" ] && exit 1 check "$SYSTEM_OUT" diff --git a/flake.lock b/flake.lock index c52bac02..e3fcf9be 100644 --- a/flake.lock +++ b/flake.lock @@ -265,11 +265,11 @@ ] }, "locked": { - "lastModified": 1738145391, - "narHash": "sha256-/9mfbWYN9HDQbKa2HdAe2T5e3FfY8e4eqc1FIvAyvLg=", + "lastModified": 1738378034, + "narHash": "sha256-mldSa2NhDlnjqeSSFTNnkXIDrCLltpJfhrHUMBBKEiY=", "owner": "nix-community", "repo": "home-manager", - "rev": "1b4f2a48168b3d90e11365552d1e7e601a4be6b6", + "rev": "801ddd8693481866c2cfb1efd44ddbae778ea572", "type": "github" }, "original": { @@ -358,11 +358,11 @@ }, "library": { "locked": { - "lastModified": 1738161079, - "narHash": "sha256-YDiu0DbtwOSo1GO3D9A0Q+dHzsYJ6pJ8ZYEkgmK1szI=", + "lastModified": 1738443114, + "narHash": "sha256-IV7n/l3rFoz5UuavrDv0a7IIOPne0jDQVmJAR8bve8U=", "ref": "prime", - "rev": "847a8167fe3b52c3b8e19017b31a97e12ad411ea", - "revCount": 16, + "rev": "65bf71bb6ef05ce684924a1dc248bb2e8e2869fb", + "revCount": 17, "type": "git", "url": "https://git.foss-syndicate.org/vhack.eu/nix-library" }, @@ -379,11 +379,11 @@ ] }, "locked": { - "lastModified": 1738033138, - "narHash": "sha256-qlIM8A3bdL9c6PexhpS+QyZLO9y/8a3V75HVyJgDE5Q=", + "lastModified": 1738277753, + "narHash": "sha256-iyFcCOk0mmDiv4ut9mBEuMxMZIym3++0qN1rQBg8FW0=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "349a74c66c596ef97ee97b4d80a3ca61227b6120", + "rev": "49b807fa7c37568d7fbe2aeaafb9255c185412f9", "type": "github" }, "original": { @@ -464,11 +464,11 @@ ] }, "locked": { - "lastModified": 1738170240, - "narHash": "sha256-4Sj34kjdmGVwwvCPOL4zztLOLMUv2jfvBDkvq6/KySc=", + "lastModified": 1738366771, + "narHash": "sha256-nyEBrP5t1g4vmy7YBkiGaIu19eG8zV3T4IQLQbJsVU8=", "owner": "nix-community", "repo": "nixvim", - "rev": "e908e344f4cd7b3eb629b93e8af312888f3ee681", + "rev": "c75e4ea37f25ec98aa6f2035e03e748e7369662c", "type": "github" }, "original": { @@ -502,11 +502,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737885589, - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", + "lastModified": 1738142207, + "narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "rev": "9d3ae807ebd2981d593cddd0080856873139aa40", "type": "github" }, "original": { @@ -549,11 +549,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1738023785, - "narHash": "sha256-BPHmb3fUwdHkonHyHi1+x89eXB3kA1jffIpwPVJIVys=", + "lastModified": 1738277201, + "narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2b4230bf03deb33103947e2528cac2ed516c5c89", + "rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554", "type": "github" }, "original": { @@ -675,11 +675,11 @@ ] }, "locked": { - "lastModified": 1735599473, - "narHash": "sha256-lKKA9AI7uk+G+OY4fX3EcnTWqq9pr7Vryxxrm4aiT28=", + "lastModified": 1738406121, + "narHash": "sha256-N3scpt+nwPbqzsRs4gjZpDiBivfPRQJ0D75bPeYhHME=", "ref": "prime", - "rev": "a91e8256a3adc1ab7ee94bfcea7198b51cfb6b37", - "revCount": 18, + "rev": "2b6889092e5839c8987e800f1d3d847dd5b50153", + "revCount": 19, "type": "git", "url": "https://git.foss-syndicate.org/bpeetz/qmk_layout.git" }, @@ -802,11 +802,11 @@ ] }, "locked": { - "lastModified": 1738117527, - "narHash": "sha256-GFviGfaezjGLFUlxdv3zyC7rSZvTXqwcG/YsF6MDkOw=", + "lastModified": 1738376888, + "narHash": "sha256-S6ErHxkSm0iA7ZMsjjDaASWxbELYcdfv8BhOkkj1rHw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6a3dc6ce4132bd57359214d986db376f2333c14d", + "rev": "83284068670d5ae4a43641c4afb150f3446be70d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d8e38f34..6dd46d91 100644 --- a/flake.nix +++ b/flake.nix @@ -297,6 +297,8 @@ system = "x86_64-linux"; sysLib = shell_library.lib.${system}; + baseLib = import ./lib {inherit (pkgs) lib;}; + inherit (library) nixLib; pkgsStable = nixpkgs-stable.legacyPackages.${system}; @@ -323,6 +325,7 @@ myPkgs system sysLib + baseLib nixpkgs_as_input nixpkgs_open_prs # modules diff --git a/flake/default.nix b/flake/default.nix index be6d2b70..c942c678 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -4,6 +4,7 @@ pkgs, pkgsStable, nixLib, + baseLib, myPkgs, system, sysLib, @@ -43,6 +44,7 @@ shell_library sysLib nixLib + baseLib templates # modules home-manager @@ -111,6 +113,8 @@ in { formatter."${system}" = treefmtEval.config.build.wrapper; + baseLib."${system}" = baseLib; + apps."${system}" = import ./apps {inherit self system;}; devShells."${system}" = { diff --git a/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix index b0a02580..0c2f8c90 100644 --- a/flake/nixosConfigurations/default.nix +++ b/flake/nixosConfigurations/default.nix @@ -9,6 +9,7 @@ shell_library, sysLib, nixLib, + baseLib, templates, # modules home-manager, @@ -38,7 +39,7 @@ serverphone.nixosModules.default ../../modules - ./common.nix + ../../modules/common ]; specialArgs = { @@ -50,6 +51,7 @@ shell_library sysLib nixLib + baseLib # extra information system # modules diff --git a/flake/packages/default.nix b/flake/packages/default.nix index a8fc2d64..82924a25 100644 --- a/flake/packages/default.nix +++ b/flake/packages/default.nix @@ -23,7 +23,10 @@ # NOTE: This is copied from `nixvim`, and could be achieved by setting # `config.wrapRc` to `true`. But I have yet to find a way to set this in this # context, but not in the general context. <2024-11-09> - wrapped = config.build.package.override (prev: { + # NOTE: I'm not sure why we need `nvimPackage` instead of just the `package` + # attribute here, but the bare `package` attribute does not provide a `override` + # function. <2025-02-02> + wrapped = config.build.nvimPackage.override (prev: { wrapperArgs = ( if lib.isString prev.wrapperArgs diff --git a/hosts/apzu/default.nix b/hosts/apzu/default.nix index d0090339..331da147 100644 --- a/hosts/apzu/default.nix +++ b/hosts/apzu/default.nix @@ -1,4 +1,10 @@ -{...}: { +{ + lib, + pkgs, + baseLib, + config, + ... +}: { imports = [ ./hardware.nix ]; @@ -19,6 +25,84 @@ laptop = true; backlight = "intel_backlight"; }; + river.init = { + mappings = { + layout = "dvorak-modified"; + keymap = + { + # Focus change + "<Meta-T>" = {command = ["focus-view" "next"];}; + "<Meta-N>" = {command = ["focus-view" "previous"];}; + "<Meta+Ctrl-T>" = {command = ["focus-output" "next"];}; + "<Meta+Ctrl-N>" = {command = ["focus-output" "previous"];}; + + # Standard programs + "<Meta-<ENTER>>" = {command = ["spawn" "${lib.getExe pkgs.alacritty}"];}; + "<Meta+Shift-q>" = {command = ["exit"];}; + "<Meta-L>" = {command = ["spawn" "${lib.getExe pkgs.lock}"];}; + + # Screenshot + "<PRINTSCREEN>" = {command = ["spawn" "${lib.getExe pkgs.screenshot_persistent}"];}; + + # Audio + "<MEDIA_RAISEVOLUME>" = { + command = ["spawn" "${lib.getExe' pkgs.wireplumber "wpctl"} set-volume @DEFAULT_SINK@ 5%+"]; + modes = ["normal" "locked"]; + }; + "<MEDIA_LOWERVOLUME>" = { + command = ["spawn" "${lib.getExe' pkgs.wireplumber "wpctl"} set-volume @DEFAULT_SINK@ 5%-"]; + modes = ["normal" "locked"]; + }; + "<MEDIA_MUTEVOLUME>" = { + command = ["spawn" "${lib.getExe pkgs.mpc} toggle"]; + modes = ["normal" "locked"]; + }; + + # Launcher + "<Meta-R>" = {command = ["spawn" "${lib.getExe pkgs.rofi} -show combi -modes combi -combi-modes 'window, drun, run' -show-icons"];}; + "<Meta-<F1>>" = {command = ["spawn" "${lib.getExe config.home-manager.users.soispha.soispha.programs.neorg.package} dmenu"];}; + "<Meta-<F2>>" = {command = ["spawn" "${lib.getExe pkgs.keepassxc}"];}; + "<Meta-<F3>>" = {command = ["spawn" "${lib.getExe pkgs.signal-desktop}"];}; + # "<Meta-<F4>>" = {command = ["spawn" "${lib.getExe pkgs.steam}"];}; + + # Client + "<Meta-f>" = {command = ["toggle-fullscreen"];}; + "<Meta+Shift-c>" = {command = ["close"];}; + "<Meta+Ctrl- >" = {command = ["toggle-float"];}; + "<Meta+Ctrl-<ENTER>>" = {command = ["zoom"];}; + "<Meta-o>" = {command = ["send-to-output" "next"];}; + "<Meta+Shift-T>" = {command = ["swap" "next"];}; + "<Meta+Shift-N>" = {command = ["swap" "previous"];}; + + # Toggle all tags + "<Meta-0>" = {command = ["set-focused-tags" (builtins.toString ((baseLib.pow 2 32) - 1))];}; + "<Meta+Shift-0>" = {command = ["set-view-tags" (builtins.toString ((baseLib.pow 2 32) - 1))];}; + + # Mouse + "<MOUSE_LEFT>" = { + command = ["move-view"]; + map_mode = "MapMouse"; + }; + "<MOUSE_RIGHT>" = { + command = ["resize-view"]; + map_mode = "MapMouse"; + }; + } + // ( + builtins.foldl' (acc: elem: acc // elem) {} ( + builtins.map (index: let + num = builtins.toString index; + index2tag = input: builtins.toString (baseLib.pow 2 (input - 1)); + in { + "<Meta-${num}>" = {command = ["set-focused-tags" (index2tag index)];}; + "<Meta+Shift-${num}>" = {command = ["set-view-tags" (index2tag index)];}; + "<Meta+Shift+Ctrl-${num}>" = {command = ["toggle-view-tags" (index2tag index)];}; + }) (builtins.genList (i: i + 1) 9) + ) + ); + }; + screenSetupCode = {}; + }; }; locale.enable = true; diff --git a/hosts/tiamat/default.nix b/hosts/tiamat/default.nix index 4e76675c..d18c0533 100644 --- a/hosts/tiamat/default.nix +++ b/hosts/tiamat/default.nix @@ -1,4 +1,12 @@ -{...}: { +{ + lib, + pkgs, + baseLib, + qmk_firmware, + system, + config, + ... +}: { imports = [ ./hardware.nix ]; @@ -24,6 +32,97 @@ programs = { river = { unicodeInput.enable = true; + init = { + mappings = { + layout = "us"; + keymap = let + map = key: "<Alt+Ctrl+Meta+Shift-${key}>"; + in + (lib.mapAttrs' (name: value: lib.nameValuePair (map name) value) { + # Movement + "A" = {command = ["exit"];}; + "B" = {command = ["close"];}; + + "C" = {command = ["focus-view" "previous"];}; + "D" = {command = ["focus-view" "next"];}; + + "E" = {command = ["swap" "previous"];}; + "F" = {command = ["swap" "next"];}; + + "G" = {command = ["zoom"];}; + + "H" = {command = ["toggle-fullscreen"];}; + "I" = {command = ["toggle-float"];}; + + "J" = {command = ["send-to-output" "next"];}; + + "K" = {command = ["spawn" "${lib.getExe pkgs.alacritty}"];}; + "L" = {command = ["spawn" "${lib.getExe pkgs.screenshot_persistent}"];}; + + # Audio + # "M" = {command = ["spawn" "video-pause toggle"]; modes = ["normal" "locked"]; }; + "N" = { + command = ["spawn" "${lib.getExe pkgs.mpc} toggle"]; + modes = ["normal" "locked"]; + }; + + # Launcher + "O" = {command = ["spawn" "${lib.getExe pkgs.rofi} -show combi -modes combi -combi-modes 'window,drun,run' -show-icons"];}; + "P" = {command = ["spawn" "${lib.getExe config.home-manager.users.soispha.soispha.programs.neorg.package} dmenu"];}; + "Q" = {command = ["spawn" "${lib.getExe pkgs.keepassxc}"];}; + # "R" = {command = ["spawn" "nheko"];}; + "S" = {command = ["spawn" "${lib.getExe pkgs.signal-desktop}"];}; + "T" = {command = ["spawn" "${lib.getExe pkgs.lock}"];}; + + "U" = {command = ["focus-output" "next"];}; + "V" = {command = ["focus-previous-tags"];}; + "W" = {command = ["send-to-previous-tags"];}; + # "X" = {command = ["spawn" "bemenu-run"];}; + # "Y" = {command = ["spawn" "bemenu-run"];}; + + # Toggle all tags + "0" = {command = ["set-focused-tags" "${builtins.toString ((baseLib.pow 2 32) - 1)}"];}; + + # Support Unicode input + "Z" = {command = ["spawn" "${lib.getExe qmk_firmware.packages.${system}.qmk_unicode_type} 106 65377"];}; + }) + // ({ + # TODO: add toggle-focus mapping + + # Toggle all tags + "<Alt+Ctrl+Shift-0>" = {command = ["set-view-tags" "${builtins.toString ((baseLib.pow 2 32) - 1)}"];}; + + # Mouse + "<Meta-<MOUSE_LEFT>>" = { + command = ["move-view"]; + map_mode = "MapMouse"; + }; + "<Meta-<MOUSE_RIGHT>>" = { + command = ["resize-view"]; + map_mode = "MapMouse"; + }; + } + // ( + builtins.foldl' (acc: elem: acc // elem) {} ( + builtins.map (index: let + num = builtins.toString index; + index2tag = input: builtins.toString (baseLib.pow 2 (input - 1)); + in { + "${map num}" = {command = ["set-focused-tags" (index2tag index)];}; + "<Alt+Ctrl+Shift-${num}>" = {command = ["set-view-tags" (index2tag index)];}; + # "<Super+Shift+Ctrl-${num}>" = {command = ["toggle-view-tags" (index2tag index)];}; + }) (builtins.genList (i: i + 1) 9) + ) + )); + }; + screenSetupCode = { + "DP-2" = {pos = "2560,0";}; + "DP-1" = { + scale = "1.5"; + pos = "0,0"; + }; + }; + }; }; }; locale = { diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 00000000..80227cf4 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,69 @@ +{lib}: let + /* + Converts `number` from a binary number to a decimal one. + + The input is indented to be a number composed only of `1`s and `0` (e.g., 10010.) + + # Type + + binaryToDecimal :: Int -> Int + + # Arguments + + number + : The sequence of `1`s and `0`s defining a binary number, in little endian. + + # Examples + + binaryToDecimal 1001 + => 9 + */ + binaryToDecimal = number: let + binaryList = + builtins.map lib.strings.toInt (lib.lists.reverseList (lib.strings.stringToCharacters (builtins.toString number))); + in + builtins.foldl' (acc: num: acc + num) 0 + (lib.lists.imap0 (index: elem: elem * (pow 2 index)) binaryList); + + /* + source: https://github.com/NixOS/nix/issues/10387#issuecomment-2494597690 + + Raises the `base` to the power of `power`. + + Considering the small input size and the lack of a built-in power function [2], + this naive power implementation should satisfy reasonable performance + requirements. + + Due to the lack of a modulo and bitwise AND operator, it is questionable whether + the recursive exponentiation by squaring [1] implementation would even be + faster. + + [1]: https://en.wikipedia.org/wiki/Exponentiation_by_squaring + [2]: https://github.com/NixOS/nix/issues/10387 + + # Type + + pow :: Number -> Number -> Number + + # Arguments + + base + : The base number to be raised. + + power + : The exponent to raise `base` to. + + # Examples + + pow 2 5 + => 32 + */ + pow = base: power: + if power == 0 + then 1 + else if power > 0 + then (base * (pow base (power - 1))) + else builtins.throw "Negative powers are not supported"; +in { + inherit binaryToDecimal pow; +} diff --git a/modules/by-name/di/direnv/module.nix b/modules/by-name/di/direnv/module.nix index afe95712..1ddf3d5d 100644 --- a/modules/by-name/di/direnv/module.nix +++ b/modules/by-name/di/direnv/module.nix @@ -14,8 +14,8 @@ in { nix-direnv.enable = true; config = { warn_timeout = 0; - strict_env = true; - disable_stdin = true; + # strict_env = true; + # disable_stdin = true; }; }; } diff --git a/modules/by-name/lf/lf/colors b/modules/by-name/lf/lf/colors index 1c2853ec..17201e64 100644 --- a/modules/by-name/lf/lf/colors +++ b/modules/by-name/lf/lf/colors @@ -60,11 +60,6 @@ fi 00 # FILE # links to hide ~/.mozilla 01;08;30 ~/.ssh 01;08;30 -~/.zshenv 01;08;30 - -~/.steampid 01;08;30 -~/.steam 01;08;30 -~/.steampath 01;08;30 # archives or compressed (dircolors defaults) *.tar 01;31 diff --git a/modules/by-name/lf/lf/commands/base.sh b/modules/by-name/lf/lf/commands/base.sh new file mode 100755 index 00000000..61b59a7b --- /dev/null +++ b/modules/by-name/lf/lf/commands/base.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env sh + +# shellcheck disable=SC2269 +id="$id" + +# Prompt the user for input. +# This will just _print_ the prompt, you still need to `read -r` the user's answer. +# +# # Type +# prompt :: String +# +# # Arguments +# $1 +# : The prompt to print for the user. +prompt() { + printf "=> %s" "$1" +} + +# Reads its Stdin into a temporary file and returns the path of the temporary file. +# This is only really useful, if you want to pipe something into an while read loop that +# should modify global variables. Piping directly into it will not work, because the shell +# would just run it in a subshell, so you need this workaround. +# +# # Type +# tmp :: <stdin> -> Path +# +# # Arguments +# +# # Examples +# while read -r file; do +# set -- "$@" "$file" +# done < "$(echo "$fx" | tmp)" +tmp() { + __base_tmp_temporary_file="$(mktemp --tmpdir="$__base_tmp_temporary_directory")" + cat >"$__base_tmp_temporary_file" + echo "$__base_tmp_temporary_file" +} +__base_tmp_temporary_directory="$(mktemp --directory)" +trap 'rm --recursive "$__base_tmp_temporary_directory"' EXIT + +# Run a lf command on the current lf client +# All arguments will run in like they were typed directly into lf. +# # TODO(@bpeetz): Escape the single quotes in the input arguments. <2025-02-02> +# +# # Type +# lf_cmd :: [String] +# +# # Arguments +# $1..$@ +# : The arguments composing the command to run. +lf_cmd() { + arguments="" + for arg in "$@"; do + if [ -z "$arguments" ]; then + arguments="'$arg'" + else + arguments="$arguments '$arg'" + fi + done + + lf -remote "send $id $arguments" +} + +# Print an error message and exit with error code 1. +# The error message will be printed to lf. +# +# # Type +# die :: String +# +# # Arguments +# $1 +# : The error message +die() { + lf_cmd echo "Error: $1" + exit 1 +} + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix index b3c9acab..9a709168 100644 --- a/modules/by-name/lf/lf/commands/default.nix +++ b/modules/by-name/lf/lf/commands/default.nix @@ -1,231 +1,157 @@ -{ - pkgs, - sysLib, - shell_library, - system, - ... -}: let +{pkgs, ...}: let functionCall = { name, dependencies, - replacementStrings, ... }: - sysLib.writeShellScript { + pkgs.writeShellApplication { inherit name; - src = ./scripts/${name}.sh; - keepPath = true; - dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash coreutils;}); - inherit replacementStrings; + text = builtins.readFile ./base.sh + builtins.readFile ./scripts/${name}.sh; + runtimeInputs = dependencies; } + "/bin/${name}"; + # closes the lf tui shell = { name, dependencies, - replacementStrings ? null, ... }: '' ''${{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall {inherit name dependencies;}} }} - ''; # closes the lf tui + ''; + # runs the command in the ui/term bar pipe = { name, dependencies, - replacementStrings ? null, ... }: '' %{{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall {inherit name dependencies;}} }} - ''; # runs the command in the ui/term bar + ''; + # runs the command in the background async = { name, dependencies, - replacementStrings ? null, ... }: '' &{{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall {inherit name dependencies;}} }} - ''; # runs the command in the background + ''; + # adds a prompt after the command has run wait = { name, dependencies, - replacementStrings ? null, ... }: '' !{{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall {inherit name dependencies;}} }} - ''; # adds a prompt after the command has run + ''; in { - archive = shell { - name = "archive"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - gnutar - xz - p7zip - zip - ; - }; - }; - broot_jump = shell { - name = "broot_jump"; - dependencies = builtins.attrValues { - inherit (pkgs) broot; - }; + archive_compress = shell { + name = "archive_compress"; + dependencies = with pkgs; [ + fzf + gnutar + xz + p7zip + zip + ]; + }; + archive_decompress = pipe { + name = "archive_decompress"; + dependencies = with pkgs; [ + gnutar + unzip + p7zip + ]; }; + + cd_project_root = async { + name = "cd_project_root"; + dependencies = [pkgs.git]; + }; + chmod = pipe { name = "chmod"; dependencies = []; }; - clear_trash = shell { - name = "clear_trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - trashy - ; - }; - }; - dl_file = pipe { - name = "dl_file"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - curl - ; - }; - }; + dragon = pipe { name = "dragon"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; + dependencies = [pkgs.xdragon]; }; dragon_individual = pipe { name = "dragon_individual"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; + dependencies = [pkgs.xdragon]; }; dragon_stay = pipe { name = "dragon_stay"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; + dependencies = [pkgs.xdragon]; }; + execute = shell { name = "execute"; dependencies = []; }; follow_link = pipe { name = "follow_link"; - dependencies = with pkgs; [lf]; - }; - fzf_jump = shell { - name = "fzf_jump"; - dependencies = builtins.attrValues { - inherit (pkgs) fzf lf gnused; - }; + dependencies = []; }; - mk_dir = pipe { - name = "mk_dir"; + + mk_directory = pipe { + name = "mk_directory"; dependencies = []; }; mk_file = shell { name = "mk_file"; dependencies = []; }; - mk_file_and_edit = shell { - name = "mk_file_and_edit"; + mk_link = pipe { + name = "mk_link"; dependencies = []; }; - mk_ln = pipe { - name = "mk_ln"; + mk_script = shell { + name = "mk_script"; dependencies = []; }; - mk_scr_default = shell { - name = "mk_scr_default"; - dependencies = builtins.attrValues {}; - replacementStrings = { - SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; - }; - }; - mk_scr_temp = shell { - name = "mk_scr_temp"; - dependencies = builtins.attrValues {}; - replacementStrings = { - SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; - TO_BE_SHELL_LIBRARY_PATH = "%SHELL_LIBRARY_PATH"; # replacement is not recursive - }; - }; - view_file = async { - name = "view_file"; - dependencies = builtins.attrValues {inherit (pkgs) file;}; - }; - go_project_base_directory = async { - name = "go_project_root"; - dependencies = []; - }; - restore_trash = shell { - name = "restore_trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - trashy - ; - }; - }; + set_clipboard_path = async { name = "set_clipboard_path"; dependencies = [pkgs.wl-clipboard]; }; - set_wall_paper = pipe { - name = "set_wall_paper"; - dependencies = []; + set_wallpaper = pipe { + name = "set_wallpaper"; + dependencies = with pkgs; [ + river # for `riverctl` + swaybg + ]; }; + stripspace = pipe { name = "stripspace"; - dependencies = []; + dependencies = [pkgs.gnused]; }; + trash = pipe { name = "trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - trashy - trash-cli - findutils - ; - }; - }; - unarchive = pipe { - name = "unarchive"; - dependencies = builtins.attrValues { - inherit - (pkgs) - gnutar - unzip - p7zip - ; - }; + dependencies = [pkgs.trash-cli]; + }; + trash_clear = shell { + name = "trash_clear"; + dependencies = with pkgs; [conceal fzf gawk trashy]; + }; + trash_restore = shell { + name = "trash_restore"; + dependencies = with pkgs; [conceal fzf gawk trashy]; + }; + + view_file = async { + name = "view_file"; + dependencies = with pkgs; [file]; }; } diff --git a/modules/by-name/lf/lf/commands/run.sh b/modules/by-name/lf/lf/commands/run.sh new file mode 100755 index 00000000..6a9b8cab --- /dev/null +++ b/modules/by-name/lf/lf/commands/run.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +# Run one of the commands for debugging purposes. + +[ "$#" -gt 1 ] || { + echo "Usage: $0 <script_name> <input_files>.." + exit 2 +} + +script_name="./scripts/$1" +shift 1 + +fx="" +for arg in "$@"; do + if [ -z "$fx" ]; then + fx="$arg" + else + fx="$(printf "%s\n%s" "$fx" "$arg")" + fi +done + +export f="$1" +set -- + +# shellcheck source=/dev/null +. ./base.sh +# shellcheck source=/dev/null +. "$script_name" + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/archive.sh b/modules/by-name/lf/lf/commands/scripts/archive.sh deleted file mode 100755 index 25f40534..00000000 --- a/modules/by-name/lf/lf/commands/scripts/archive.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# Option '-f' disables pathname expansion which can be useful when $f, $fs, and -# $fx variables contain names with '*' or '?' characters. However, this option -# is used selectively within individual commands as it can be limiting at -# times. -set -f - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" - -archivers="$(tmp echo gzip xz 7z zip)" -archiver="$(awk '{for (i=1; i<=NF; i++) print $i}' "$archivers" | fzf)" - -case "$archiver" in -"gzip") - ext=tar.gz - ;; -"xz") - ext=tar.xz - ;; -"7z") - ext=7z - ;; -"zip") - ext=zip - ;; -esac - -prompt "Archive name: " -name="" -while [ -z "$name" ] || [ -e "$name" ]; do - read -r name_base - name="$name_base.$ext" - if [ -e "$name" ]; then - prompt "Archive already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "Archive name: " - fi - fi -done - -root="$(if [ "$(pwd)" = "/" ]; then pwd; else echo "$(pwd)/"; fi)" - -# fx contains all selected file name separated by a newline -while read -r raw_file; do - file="$(echo "$raw_file" | sed "s|$root||")" - set -- "$@" "$file" -done <"$(tmp echo "$fx")" - -case "$archiver" in -"gzip") - tar --create --gzip -file="$name" "$@" - ;; -"xz") - tar --create --file="$name" "$@" - xz --compress -9 --extreme --threads=0 "$name" - ;; -"7z") - 7z a "$name" "$@" - ;; -"zip") - zip --symlinks -9 -r "$name" "$@" - ;; -esac -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/archive_compress.sh b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh new file mode 100755 index 00000000..c3776a80 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh @@ -0,0 +1,63 @@ +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" + +archiver="$(printf "%s\n" gzip xz 7z zip | fzf)" + +case "$archiver" in +"gzip") + ext=tar.gz + ;; +"xz") + ext=tar.xz + ;; +"7z") + ext=7z + ;; +"zip") + ext=zip + ;; +esac + +prompt "Archive name: " +name="" +while [ -z "$name" ] || [ -e "$name" ]; do + read -r name_base + name="$name_base.$ext" + if [ -e "$name" ]; then + prompt "Archive already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "New Archive name: " + fi + fi +done + +# fx contains all selected file name separated by a newline +while read -r file; do + set -- "$@" "$(realpath --relative-to="$(pwd)" "$file")" +done <"$(echo "$fx" | tmp)" + +case "$archiver" in +"gzip") + tar --create --gzip --file="$name" "$@" + ;; +"xz") + tar --create "$@" | xz --compress -9 --format=xz --extreme --threads=0 --stdout >"$name" + ;; +"7z") + 7z a "$name" "$@" + ;; +"zip") + zip --symlinks -9 --recurse-paths "$name" "$@" + ;; +esac +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh new file mode 100755 index 00000000..08374176 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh @@ -0,0 +1,23 @@ +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +echo "$fx" | while read -r file; do + case "$file" in + *.tar.bz | *.tar.bz2 | *.tbz | *.tbz2) tar --extract --bzip2 --verbose --file="$file" ;; + *.tar.gz | *.tgz) tar --extract --gzip --verbose --file="$file" ;; + *.tar.xz | *.txz) tar --extract --xz --verbose --file="$file" ;; + *.tar*) tar --extract --verbose --file="$file" ;; + *.zip) unzip "$file" ;; + *.7z) 7z x "$file" ;; + *) die "'$file' is not a supported file for unarchiving." ;; + esac +done +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/broot_jump.sh b/modules/by-name/lf/lf/commands/scripts/broot_jump.sh deleted file mode 100755 index 8f40ba01..00000000 --- a/modules/by-name/lf/lf/commands/scripts/broot_jump.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -tmp=$(mktmp) -res="$(broot --outcmd "$tmp" && sed 's/cd //' "$tmp")" - -if [ -f "$res" ]; then - cmd="select" -elif [ -d "$res" ]; then - cmd="cd" -fi - -lf -remote "send '$id' '$cmd' '$res'" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh b/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh new file mode 100755 index 00000000..19100947 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh @@ -0,0 +1,19 @@ +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +root="$(git rev-parse --show-toplevel)" +if [ "$root" ]; then + lf_cmd cd "$root" || die "Bug: Failed to cd to project root at '$root'" +else + die "Unable to locate base dir" +fi + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/chmod.sh b/modules/by-name/lf/lf/commands/scripts/chmod.sh index 9859127b..3dc5f19c 100755 --- a/modules/by-name/lf/lf/commands/scripts/chmod.sh +++ b/modules/by-name/lf/lf/commands/scripts/chmod.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -12,13 +9,12 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -readp "Mode bits: " bits -# shellcheck disable=SC2269 -bits="$bits" +prompt "Mode bits: " +read -r bits -while read -r file; do +echo "$fx" | while read -r file; do chmod "$bits" "$file" -done <"$(tmp echo "$fx")" +done -lf -remote 'send reload' +lf_cmd reload # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/clear_trash.sh b/modules/by-name/lf/lf/commands/scripts/clear_trash.sh deleted file mode 100755 index 9052bb5f..00000000 --- a/modules/by-name/lf/lf/commands/scripts/clear_trash.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# could also use --force, for instand removal -trash list | fzf --multi | awk '{print $NF}' | xargs trash empty --match=exact -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/dl_file.sh b/modules/by-name/lf/lf/commands/scripts/dl_file.sh deleted file mode 100755 index c7e3d8b2..00000000 --- a/modules/by-name/lf/lf/commands/scripts/dl_file.sh +++ /dev/null @@ -1,43 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -# Provides the ability to download a file by dropping it into a window - -url="$(dragon -t -x)" - -if [ -n "$url" ]; then - prompt "File Name: " - name="" - while [ -z "$name" ] || [ -e "$name" ]; do - read -r name - if [ -e "$name" ]; then - prompt "File already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "File Name: " - fi - fi - done - - # Download the file with curl - if [ -n "$name" ]; then - curl -o "$name" "$url" || die "curl failed" - fi -else - die "URL is null!" -fi -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/dragon.sh b/modules/by-name/lf/lf/commands/scripts/dragon.sh index cf3c3176..299d7bbe 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,7 +11,7 @@ id="$id" while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" +done <"$(echo "$fx" | tmp)" -dragon -a -x "$@" +dragon --all --and-exit "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh index 2465cdfa..1cb603d9 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,7 +11,7 @@ id="$id" while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" +done <"$(echo "$fx" | tmp)" dragon "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh index 066b4c75..4a16e802 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,7 +11,7 @@ id="$id" while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" +done <"$(echo "$fx" | tmp)" -dragon -a "$@" +dragon --all "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/execute.sh b/modules/by-name/lf/lf/commands/scripts/execute.sh index aa97fd7f..1d5dc87f 100755 --- a/modules/by-name/lf/lf/commands/scripts/execute.sh +++ b/modules/by-name/lf/lf/commands/scripts/execute.sh @@ -1,7 +1,4 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/commands/scripts/follow_link.sh b/modules/by-name/lf/lf/commands/scripts/follow_link.sh index 80413990..509fc2e0 100755 --- a/modules/by-name/lf/lf/commands/scripts/follow_link.sh +++ b/modules/by-name/lf/lf/commands/scripts/follow_link.sh @@ -1,7 +1,4 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,6 +11,12 @@ id="$id" dir="$(realpath "$f")" -lf -remote "send $id cd \"$dir\"" +if [ -f "$dir" ]; then + cmd="select" +elif [ -d "$dir" ]; then + cmd="cd" +fi + +lf_cmd "$cmd" "$dir" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh b/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh deleted file mode 100755 index ad1633fb..00000000 --- a/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -res="$(fd . --maxdepth 3 | fzf --header='Jump to location')" - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -if [ -f "$res" ]; then - cmd="select" -elif [ -d "$res" ]; then - cmd="cd" -fi - -lf -remote "send $id $cmd \"$res\"" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/go_project_root.sh b/modules/by-name/lf/lf/commands/scripts/go_project_root.sh deleted file mode 100755 index 5f7746d3..00000000 --- a/modules/by-name/lf/lf/commands/scripts/go_project_root.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -flake_base_dir="$(search_flake_base_dir)" -if [ "$flake_base_dir" ]; then - lf -remote "send $id cd $flake_base_dir" || die "Bug: No base dir ($flake_base_dir)" -else - die "Unable to locate base dir" -fi - -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_dir.sh b/modules/by-name/lf/lf/commands/scripts/mk_directory.sh index 150f7eed..58921ccd 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_dir.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_directory.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -23,7 +20,7 @@ while [ -z "$name" ] || [ -e "$name" ]; do if [ "$ans" = "y" ]; then break else - prompt "Directory Name: " + prompt "New Directory Name: " fi fi done diff --git a/modules/by-name/lf/lf/commands/scripts/mk_file.sh b/modules/by-name/lf/lf/commands/scripts/mk_file.sh index 41d5cf1a..5dafe30d 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_file.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -23,7 +20,7 @@ while [ -z "$name" ] || [ -e "$name" ]; do if [ "$ans" = "y" ]; then break else - prompt "File name: " + prompt "New File name: " fi fi done diff --git a/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh b/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh deleted file mode 100755 index 19fc51db..00000000 --- a/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -prompt "File name: " -name="" -while [ -z "$name" ] || [ -e "$name" ]; do - read -r name - if [ -e "$name" ]; then - prompt "File already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "File name: " - fi - fi -done - -touch "$name" -"$EDITOR" "$name" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_ln.sh b/modules/by-name/lf/lf/commands/scripts/mk_link.sh index 7fab8e22..40b2099d 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_ln.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_link.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,20 +11,19 @@ id="$id" while IFS= read -r i; do set -- "$@" "$i" -done <"$HOME"/.local/share/lf/files +done <"$HOME/.local/share/lf/files" mode="$1" shift if [ "$#" -eq 0 ]; then - msg "no files to link" + lf_cmd echo "No files to link." exit 0 fi case "$mode" in copy) - while [ "$#" -gt 0 ]; do - file="$1" + for file in "$@"; do ans="$(basename "$file")" while [ -e "$ans" ]; do @@ -36,10 +32,10 @@ copy) done ln --symbolic --relative "$file" "$(pwd)/$ans" - shift done ;; esac -rm ~/.local/share/lf/files +rm "$HOME/.local/share/lf/files" # lf -remote "send clear" + # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh b/modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh deleted file mode 100755 index 512b5d0b..00000000 --- a/modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -prompt "Script name: " -name="" -while [ -z "$name" ] || [ -e "$name" ]; do - read -r name - if [ -e "$name" ]; then - prompt "Script already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "Script Name: " - fi - fi -done - -script="$(pwd)"/"$name" - -sed 's|%TO_BE_SHELL_LIBRARY_PATH|%SHELL_LIBRARY_PATH|' "%SHELL_LIBRARY_TEMPLATE" >"$script" -sed -i 's|dash|sh|' "$script" -chmod +x "$script" -"$VISUAL" "$script" - -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh b/modules/by-name/lf/lf/commands/scripts/mk_script.sh index 47d05080..bbdf6d39 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_script.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -15,8 +12,7 @@ id="$id" prompt "Script name: " name="" while [ -z "$name" ] || [ -e "$name" ]; do - read -r name_base - name="$name_base.sh" + read -r name if [ -e "$name" ]; then prompt "Script already exists, overwrite [y|N]: " read -r ans @@ -24,14 +20,21 @@ while [ -z "$name" ] || [ -e "$name" ]; do if [ "$ans" = "y" ]; then break else - prompt "Script Name: " + prompt "New Script Name: " fi fi done -script="$(pwd)"/"$name" +script="$(pwd)/$name" + +cat <<SCRIPT >"$script" +#! /usr/bin/env sh + + + +# vim: ft=sh +SCRIPT -cat "%SHELL_LIBRARY_TEMPLATE" >"$script" chmod +x "$script" "$VISUAL" "$script" diff --git a/modules/by-name/lf/lf/commands/scripts/restore_trash.sh b/modules/by-name/lf/lf/commands/scripts/restore_trash.sh deleted file mode 100755 index b4ef492f..00000000 --- a/modules/by-name/lf/lf/commands/scripts/restore_trash.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -trash list | fzf --multi | awk '{print $NF}' | xargs trash restore --match=exact -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh b/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh index ff5f3c01..893452e1 100755 --- a/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh +++ b/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -17,10 +14,10 @@ if [ -n "$fx" ]; then elif [ -n "$f" ]; then echo "$f" | wl-copy --trim-newline else - lf -remote "send $id echo 'No file selected.'" + lf_cmd echo "No file selected." exit 1 fi -lf -remote "send $id echo 'Path copied'" +lf_cmd echo "Path copied to clipboard." # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh b/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh deleted file mode 100755 index 2e607d33..00000000 --- a/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -die "No yet implemented" # TODO: do what the 'die' says -#sed -i "s,export AWMWALLPAPER='.*',export AWMWALLPAPER='${f}'," ${ZDOTDIR}/.zshenv -#nohub swaybg -i "$f" -#feh --bg-max --no-fehbg "$f" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh b/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh new file mode 100755 index 00000000..4387cd9a --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh @@ -0,0 +1,19 @@ +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +pid="$(pgrep swaybg)" +[ -n "$pid" ] && kill "$pid" + +# We cannot control the available commands for river. +# Thus we ensure that it can correctly start `swaybg` +swaybg="$(command -v swaybg)" +riverctl spawn "$swaybg --image \"$f\"" && lf_cmd echo "Temporary background image set." +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/stripspace.sh b/modules/by-name/lf/lf/commands/scripts/stripspace.sh index 33b1cbcf..95f8f742 100755 --- a/modules/by-name/lf/lf/commands/scripts/stripspace.sh +++ b/modules/by-name/lf/lf/commands/scripts/stripspace.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -12,29 +9,14 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -files=$(mktmp) -echo "$fx" >"$files" - -awk_source=$(mktmp) -cat <<OFT >"$awk_source" -BEGIN {FS=" "} -{for (i=1; i != NF + 1; i++) - if (i == NF) { - parts[i]=tolower(\$i); - } else { - parts[i]=tolower(\$i"_"); - } -} -END {for (i in parts) printf parts[i]} -OFT +echo "$fx" | while read -r file; do + dirty_name=$(basename "$file") + clean_name=$(echo "$dirty_name" | sed 's/[[:blank:]]\+/_/g' | sed 's/\(.*\)/\L\1/') -while read -r file; do - dirty_name=$(mktmp) - basename "$file" >"$dirty_name" - clean_name=$(awk -f "$awk_source" "$dirty_name") + [ -e "$clean_name" ] && die "file '$clean_name' already exists!" + mv "$dirty_name" "$clean_name" || die "Move failed" - [ -e "$clean_name" ] && die "file \"$clean_name\" already exists!" - mv "$(cat "$dirty_name")" "$clean_name" || die "Move failed" - lf -remote 'send reload' -done <"$files" + lf_cmd reload + lf_cmd select "$clean_name" +done # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/trash.sh b/modules/by-name/lf/lf/commands/scripts/trash.sh index f4878c49..958bc3f9 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash.sh @@ -1,7 +1,4 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -12,26 +9,9 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -trash_output=$(mktmp) -expected_error_output=$(mktmp) - while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" - -# TODO: why are we using trashy at all, when trash-cli can do everything? -# -# try trashy first, through nix because both trashy and trash-cli provide a trash command, which conflicts -nix run nixpkgs#trashy -- put "$@" 2>"$trash_output" - -# FIXME: Find a way, that does not depend on parsing an error message <2023-08-29> -cat <<EOF >"$expected_error_output" -[1;31merror:[0m Error during a \`trash\` operation: Unknown { description: "Path: '\"/.Trash-1000\"'. Message: Permission denied (os error 13)" } -EOF +done <"$(echo "$fx" | tmp)" -if [ "$(cat "$expected_error_output")" = "$(cat "$trash_output")" ]; then - warning "Deleting with trash-cli to the /.Trash folder" - # this file could not be trashed because it is on the tempfs volume, trash-cli can do this this - trash-put "$@" -fi +trash-put -- "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh new file mode 100755 index 00000000..faa3c553 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh @@ -0,0 +1,9 @@ +# shellcheck shell=sh + +while read -r file; do + set -- "$@" "$(pwd)/$file" +done <"$(conceal list | fzf --multi --ansi | awk '{for(i=3; i<=NF; i++) {print $i}}' | tmp)" + +[ "$#" -ne 0 ] && trash empty --match=exact "$@" + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh new file mode 100755 index 00000000..f685345f --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh @@ -0,0 +1,17 @@ +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +while read -r file; do + set -- "$@" "$(pwd)/$file" +done <"$(conceal list | fzf --multi --ansi | awk '{for(i=3; i<=NF; i++) {print $i}}' | tmp)" + +[ "$#" -ne 0 ] && trash restore --match=exact "$@" +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/unarchive.sh b/modules/by-name/lf/lf/commands/scripts/unarchive.sh deleted file mode 100755 index d4835f6b..00000000 --- a/modules/by-name/lf/lf/commands/scripts/unarchive.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -# extract the current file with the right command -# (xkcd link: https://xkcd.com/1168/) -set -f - -unarchive() { - case "$1" in - *.tar.bz | *.tar.bz2 | *.tbz | *.tbz2) tar xjvf "$1" ;; - *.tar.gz | *.tgz) tar xzvf "$1" ;; - *.tar.xz | *.txz) tar xJvf "$1" ;; - *.zip) unzip "$1" ;; - *.rar) - die "rar is a unfree format!" - ;; - *.7z) 7z x "$1" ;; - *) die "Unsupported format" ;; - esac -} - -while read -r file; do - unarchive "$file" -done <"$fx" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/view_file.sh b/modules/by-name/lf/lf/commands/scripts/view_file.sh index f75c4868..38e6b778 100755 --- a/modules/by-name/lf/lf/commands/scripts/view_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/view_file.sh @@ -1,7 +1,4 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix index f624719f..c5d6427d 100644 --- a/modules/by-name/lf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -36,21 +36,18 @@ cp = "set_clipboard_path"; # Archive Mappings - au = "unarchive"; - aa = "archive"; + au = "archive_decompress"; + aa = "archive_compress"; # Trash Mappings dd = "trash"; - jc = "clear_trash"; - jr = "restore_trash"; + jc = "trash_clear"; + jr = "trash_restore"; # Dragon Mapping dr = "dragon"; - ds = "dragon-stay"; - di = "dragon-individual"; - #dm = "mvdragon"; - #dc = "cpdragon"; - dl = "dlfile"; + ds = "dragon_stay"; + di = "dragon_individual"; cs = "stripspace"; @@ -68,17 +65,15 @@ y = "copy"; "<enter>" = "open"; - mk = "mk_ln"; + mk = "mk_link"; mf = "mk_file"; - me = "mk_file_and_edit"; - md = "mk_dir"; - ms = "mk_scr_default"; - mt = "mk_scr_temp"; + md = "mk_directory"; + ms = "mk_script"; ch = "chmod"; - bg = "set_wall_paper"; + bg = "set_wallpaper"; r = ":rename; cmd-end"; - H = "go_project_base_directory"; + H = "cd_project_root"; R = "reload"; C = "clear"; U = "unselect"; diff --git a/modules/by-name/lo/locale/keymaps/us_modified.xkb b/modules/by-name/lo/locale/keymaps/us_modified.xkb deleted file mode 100644 index 6299a5e9..00000000 --- a/modules/by-name/lo/locale/keymaps/us_modified.xkb +++ /dev/null @@ -1,9 +0,0 @@ -partial alphanumeric_keys -xkb_symbols "us-modified" { - name[Group1]= "US English with caps lock key as compose key"; - - - include "us(basic)" - include "compose(caps)" -}; -// vim: ft=xkb diff --git a/modules/by-name/lo/locale/module.nix b/modules/by-name/lo/locale/module.nix index 10569216..eda707af 100644 --- a/modules/by-name/lo/locale/module.nix +++ b/modules/by-name/lo/locale/module.nix @@ -42,11 +42,6 @@ in { }; services.xserver.xkb.extraLayouts = { - "us-modified" = { - description = "standard us with caps as compose key."; - languages = ["eng" "swe" "deu"]; - symbolsFile = ./keymaps/us_modified.xkb; - }; "dvorak-modified" = { description = "standard dvorak english with german and swedish extra chars."; languages = ["eng" "swe" "deu"]; diff --git a/modules/by-name/mp/mpv/module.nix b/modules/by-name/mp/mpv/module.nix new file mode 100644 index 00000000..49a97c3c --- /dev/null +++ b/modules/by-name/mp/mpv/module.nix @@ -0,0 +1,315 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.mpv; +in { + options.soispha.programs.mpv = { + enable = lib.mkEnableOption "mpv"; + }; + + config.home-manager.users.soispha = lib.mkIf cfg.enable { + programs.mpv = { + enable = true; + + bindings = { + q = "quit 0"; + "Ctrl+c" = "quit 1"; + "Shift+q" = "quit-watch-later 1"; + }; + config = { + # uosc provides seeking & volume indicators (via flash-timeline and flash-volume commands) + # if you decide to use them, you don't need osd-bar + osd-bar = false; + + # uosc will draw its own window controls and border if you disable window border + border = false; + }; + scriptOpts = { + osc = { + scalewindowed = 0.8; + hidetimeout = 300; + }; + uosc = { + # Display style of current position. available: line, bar + timeline_style = "line"; + + # Line display style config + timeline_line_width = 2; + + # Timeline size when fully expanded, in pixels, 0 to disable + timeline_size = 40; + + # Comma separated states when element should always be fully visible. + # Available: paused, audio, image, video, idle, windowed, fullscreen + timeline_persistency = ""; + + # Top border of background color to help visually separate timeline from video + timeline_border = 1; + + # When scrolling above timeline, wheel will seek by this amount of seconds. + # Default uses fast seeking. Add `!` suffix to enable exact seeks. Example: `5!` + timeline_step = 5; + + # Render cache indicators for streaming content + timeline_cache = true; + + # When to display an always visible progress bar (minimized timeline). Can be: windowed, fullscreen, always, never + # Can also be toggled on demand with `toggle-progress` command. + progress = "windowed"; + progress_size = 2; + progress_line_width = 20; + + # A comma delimited list of controls above the timeline. Set to `never` to disable. + # Parameter spec: enclosed in `{}` means value, enclosed in `[]` means optional + # Full item syntax: `[<[!]{disposition1}[,[!]{dispositionN}]>]{element}[:{paramN}][#{badge}[>{limit}]][?{tooltip}]` + # Common properties: + # `{icon}` - parameter used to specify an icon name (example: `face`) + # - pick here: https://fonts.google.com/icons?icon.platform=web&icon.set=Material+Icons&icon.style=Rounded + # `{element}`s and their parameters: + # `{shorthand}` - preconfigured shorthands: + # `play-pause`, `menu`, `subtitles`, `audio`, `video`, `playlist`, + # `chapters`, `editions`, `stream-quality`, `open-file`, `items`, + # `next`, `prev`, `first`, `last`, `audio-device`, `fullscreen`, + # `loop-playlist`, `loop-file`, `shuffle`, `autoload` + # `speed[:{scale}]` - display speed slider, [{scale}] - factor of controls_size, default: 1.3 + # `command:{icon}:{command}` - button that executes a {command} when pressed + # `toggle:{icon}:{prop}[@{owner}]` - button that toggles mpv property. shorthand for yes/no cycle below + # `cycle:{default_icon}:{prop}[@{owner}]:{value1}[={icon1}][!]/{valueN}[={iconN}][!]` + # - button that cycles mpv property between values, each optionally having different icon and active flag + # - presence of `!` at the end will style the button as active + # - `{owner}` is the name of a script that manages this property if any. Set to `uosc` to tap into uosc options. + # `gap[:{scale}]` - display an empty gap + # {scale} - factor of controls_size, default: 0.3 + # `space` - fills all available space between previous and next item, useful to align items to the right + # - multiple spaces divide the available space among themselves, which can be used for centering + # `button:{name}` - button whose state, look, and click action are managed by external script + # Item visibility control: + # `<[!]{disposition1}[,[!]{dispositionN}]>` - optional prefix to control element's visibility + # - `{disposition}` can be one of: + # - `idle` - true if mpv is in idle mode (no file loaded) + # - `image` - true if current file is a single image + # - `audio` - true for audio only files + # - `video` - true for files with a video track + # - `has_many_video` - true for files with more than one video track + # - `has_image` - true for files with a cover or other image track + # - `has_audio` - true for files with an audio track + # - `has_many_audio` - true for files with more than one audio track + # - `has_sub` - true for files with an subtitle track + # - `has_many_sub` - true for files with more than one subtitle track + # - `has_many_edition` - true for files with more than one edition + # - `has_chapter` - true for files with chapter list + # - `stream` - true if current file is read from a stream + # - `has_playlist` - true if current playlist has 2 or more items in it + # - prefix with `!` to negate the required disposition + # Examples: + # - `<stream>stream-quality` - show stream quality button only for streams + # - `<has_audio,!audio>audio` - show audio tracks button for all files that have + # an audio track, but are not exclusively audio only files + # Place `#{badge}[>{limit}]` after the element params to give it a badge. Available badges: + # `sub`, `audio`, `video` - track type counters + # `{mpv_prop}` - any mpv prop that makes sense to you: https://mpv.io/manual/master/#property-list + # - if prop value is an array it'll display its size + # `>{limit}` will display the badge only if it's numerical value is above this threshold. + # Example: `#audio>1` + # Place `?{tooltip}` after the element config to give it a tooltip. + # Example implementations: + # menu = command:menu:script-binding uosc/menu-blurred?Menu + # subtitles = command:subtitles:script-binding uosc/subtitles#sub?Subtitles + # fullscreen = cycle:crop_free:fullscreen:no/yes=fullscreen_exit!?Fullscreen + # loop-playlist = cycle:repeat:loop-playlist:no/inf!?Loop playlist + # toggle:{icon}:{prop} = cycle:{icon}:{prop}:no/yes! + controls = "menu,gap,subtitles,<has_many_audio>audio,<has_many_video>video,<has_many_edition>editions,<stream>stream-quality,gap,space,speed,space,shuffle,loop-playlist,loop-file,gap,prev,items,next,gap,fullscreen"; + controls_size = 32; + controls_margin = 8; + controls_spacing = 2; + controls_persistency = ""; + + # Where to display volume controls: none, left, right + volume = "right"; + volume_size = 40; + volume_border = 1; + volume_step = 1; + volume_persistency = ""; + + # Playback speed widget: mouse drag or wheel to change, click to reset + speed_step = 0.1; + speed_step_is_factor = false; + speed_persistency = ""; + + # Controls all menus, such as context menu, subtitle loader/selector, etc + menu_item_height = 36; + menu_min_width = 260; + menu_padding = 4; + + # Determines if `/` or `ctrl+f` is required to activate the search, or if typing + # any text is sufficient. + # When enabled, you can no longer toggle a menu off with the same key that opened it, if the key is a unicode character. + menu_type_to_search = true; + + # Top bar with window controls and media title + # Can be: never, no-border, always + top_bar = "never"; + top_bar_size = 40; + # Can be: `no` (hide), left or right + top_bar_controls = false; + # Can be: `no` (hide), `yes` (inherit title from mpv.conf), or a custom template string + top_bar_title = false; + # Template string to enable alternative top bar title. If alt title matches main title, + # it'll be hidden. Tip: use `${media-title}` for main, and `${filename}` for alt title. + top_bar_alt_title = ""; + # Can be: + # `below` => display alt title below the main one + # `toggle` => toggle the top bar title text between main and alt by clicking + # the top bar, or calling `toggle-title` binding + top_bar_alt_title_place = "below"; + # Flash top bar when any of these file types is loaded. Available: audio,video,image,chapter + top_bar_flash_on = "video,audio"; + top_bar_persistency = ""; + + # Window border drawn in no-border mode + window_border_size = 1; + + # If there's no playlist and file ends, load next file in directory + # Uses `load_types` config below to determine what type of file to load next. + # When enabled, usoc will set mpv config `keep-open` to `yes`, and `keep-open-pause` to `no`. + autoload = false; + # Enable uosc's playlist/directory shuffle mode + # This simply makes the next selected playlist or directory item be random, just + # like any other player in the world. It also has an easily togglable control button. + shuffle = false; + + # Scale the interface by this factor + scale = 1; + # Scale in fullscreen + scale_fullscreen = 1.3; + # Adjust the text scaling to fit your font + font_scale = 1; + # Border of text and icons when drawn directly on top of video + text_border = 1.2; + # Border radius of buttons, menus, and all other rectangles + border_radius = 4; + # A comma delimited list of color overrides in RGB HEX format. Defaults: + # foreground=ffffff,foreground_text=000000,background=000000,background_text=ffffff,curtain=111111,success=a5e075,error=ff616e + color = ""; + # A comma delimited list of opacity overrides for various UI element backgrounds and shapes. + # This does not affect any text, which is always rendered fully opaque. Defaults: + # timeline=0.9,position=1,chapters=0.8,slider=0.9,slider_gauge=1,controls=0,speed=0.6,menu=1,submenu=0.4,border=1,title=1,tooltip=1,thumbnail=1,curtain=0.8,idle_indicator=0.8,audio_indicator=0.5,buffering_indicator=0.3,playlist_position=0.8 + opacity = ""; + + # A comma delimited list of features to refine at a cost of some performance impact. + # text_width - Use a more accurate text width measurement that measures each text string individually + # instead of just measuring the width of known letters once and adding them up. + # sorting - Use filename sorting that handles non-english languages better, especially asian ones. + # At the moment, this is only available on windows, and has no effect on other platforms. + refine = ""; + + # Duration of animations in milliseconds + animation_duration = 100; + + # Execute command for background clicks shorter than this number of milliseconds, 0 to disable + # Execution always waits for `input-doubleclick-time` to filter out double-clicks + click_threshold = 0; + click_command = "cycle pause; script-binding uosc/flash-pause-indicator"; + + # Flash duration in milliseconds used by `flash-{element}` commands + flash_duration = 1000; + + # Distances in pixels below which elements are fully faded in/out + proximity_in = 40; + proximity_out = 120; + + # Use only bold font weight throughout the whole UI + font_bold = false; + + # One of `total`, `playtime-remaining` (scaled by the current speed), `time-remaining` (remaining length of file) + destination_time = "playtime-remaining"; + + # Display sub second fraction in timestamps up to this precision + time_precision = 0; + + # Display stream's buffered time in timeline if it's lower than this amount of seconds, 0 to disable + buffered_time_threshold = 60; + + # Hide UI when mpv autohides the cursor. Timing is controlled by `cursor-autohide` in `mpv.conf` (in milliseconds). + autohide = true; + + # Can be: flash, static, manual (controlled by flash-pause-indicator and decide-pause-indicator commands) + pause_indicator = "static"; + + # Sizes to list in stream quality menu + stream_quality_options = "4320,2160,1440,1080,720,480,360,240,144"; + + # Types to identify media files + video_types = "3g2,3gp,asf,avi,f4v,flv,h264,h265,m2ts,m4v,mkv,mov,mp4,mp4v,mpeg,mpg,ogm,ogv,rm,rmvb,ts,vob,webm,wmv,y4m"; + audio_types = "aac,ac3,aiff,ape,au,cue,dsf,dts,flac,m4a,mid,midi,mka,mp3,mp4a,oga,ogg,opus,spx,tak,tta,wav,weba,wma,wv"; + image_types = "apng,avif,bmp,gif,j2k,jp2,jfif,jpeg,jpg,jxl,mj2,png,svg,tga,tif,tiff,webp"; + subtitle_types = "aqt,ass,gsub,idx,jss,lrc,mks,pgs,pjs,psb,rt,sbv,slt,smi,sub,sup,srt,ssa,ssf,ttxt,txt,usf,vt,vtt"; + playlist_types = "m3u,m3u8,pls,url,cue"; + + # Type pools used by file navigation and `autoload` to determine what type of file to load next + # Available: video,audio,image,playlist,same. `same` means the same type pool (not just extension) as currently open file. + load_types = "video,audio,image"; + + # Default open-file menu directory. Use `{drives}` to open drives menu on windows (defaults to `/` on unix). + default_directory = "~/"; + + # List hidden files when reading directories. Due to environment limitations, this currently only hides + # files starting with a dot. Doesn't hide hidden files on windows (we have no way to tell they're hidden). + show_hidden_files = false; + + # Move files to trash (recycle bin) when deleting files. Dependencies: + # - Linux: `sudo apt install trash-cli` + # - MacOS: `brew install trash` + use_trash = false; + + # Adjusted osd margins based on the visibility of UI elements + adjust_osd_margins = true; + + # Adds chapter range indicators to some common chapter types. + # Additionally to displaying the start of the chapter as a diamond icon on top of the timeline, + # the portion of the timeline of that chapter range is also colored based on the config below. + # + # The syntax is a comma-delimited list of `{type}:{color}` pairs, where: + # `{type}` => range type. Currently supported ones are: + # - `openings`, `endings` => anime openings/endings + # - `intros`, `outros` => video intros/outros + # - `ads` => segments created by sponsor-block software like https://github.com/po5/mpv_sponsorblock + # `{color}` => an RGB(A) HEX color code (`rrggbb`, or `rrggbbaa`) + # + # To exclude marking any of the range types, simply remove them from the list. + chapter_ranges = "openings:30abf964,endings:30abf964,ads:c54e4e80"; + + # Add alternative lua patterns to identify beginnings of simple chapter ranges (except for `ads`) + # Syntax: `{type}:{pattern}[,{patternN}][;{type}:{pattern}[,{patternN}]]` + chapter_range_patterns = "openings:オープニング;endings:エンディング"; + + # Localization language priority from highest to lowest. + # Also controls what languages are fetched by `download-subtitles` menu. + # Built in languages can be found in `uosc/intl`. + # `slang` is a keyword to inherit values from `--slang` mpv config. + # Supports paths to custom json files: `languages=~~/custom.json,slang,en` + languages = "slang,en"; + + # A comma separated list of element IDs to disable. Available IDs: + # window_border, top_bar, timeline, controls, volume, + # idle_indicator, audio_indicator, buffering_indicator, pause_indicator + disable_elements = ""; + }; + thumbfast = { + hwdec = true; + network = false; + spawn_first = false; + max_height = 250; + max_width = 250; + }; + }; + scripts = with pkgs.mpvScripts; [ + uosc + thumbfast + ]; + }; + }; +} diff --git a/modules/by-name/nv/nvim/module.nix b/modules/by-name/nv/nvim/module.nix index 69e417bb..0eb416f6 100644 --- a/modules/by-name/nv/nvim/module.nix +++ b/modules/by-name/nv/nvim/module.nix @@ -32,6 +32,9 @@ in { programs.nixvim = { enable = true; + # Use my global nixpkgs set, instead of constructing a separate one. + nixpkgs.useGlobalPackages = true; + # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim extraConfigLuaPre = lib.mkBefore '' --------------------------------------------------------------------------- diff --git a/modules/by-name/ol/ollama/module.nix b/modules/by-name/ol/ollama/module.nix index bd0baaa6..7a4e8038 100644 --- a/modules/by-name/ol/ollama/module.nix +++ b/modules/by-name/ol/ollama/module.nix @@ -28,6 +28,16 @@ in { services.ollama = { enable = true; acceleration = false; + + # TODO: This could work for GPU acceleration. <2024-12-20> + # acceleration = "rocm"; + # host = "127.0.0.1"; + # port = 11434; + # environmentVariables = { + # HCC_AMDGPU_TARGET = "gfx1032"; # used to be necessary, but doesn't seem to anymore + # }; + # + # rocmOverrideGfx = "10.3.2"; }; }; } diff --git a/modules/by-name/ri/river/init_base.sh b/modules/by-name/ri/river/init_base.sh new file mode 100755 index 00000000..938b46b1 --- /dev/null +++ b/modules/by-name/ri/river/init_base.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +# NOTE: Keep this in sync with the file from `river-start` <2025-02-03> +RIVER_LOG_FILE="$HOME/.local/share/river/log" + +err_fail() { + if ! "$@"; then + output="" + for arg in "$@"; do + if [ -z "$output" ]; then + output="'$arg'" + else + output="$output '$arg'" + fi + done + printf "%s failed!\n" "$output" >>"$RIVER_LOG_FILE" + fi +} +exec 1>>"$RIVER_LOG_FILE" +exec 2>>"$RIVER_LOG_FILE" + +# Start of the generated stuff. diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix index a059da4d..c8fb973c 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -3,19 +3,216 @@ lib, qmk_firmware, system, + pkgs, ... }: let cfg = config.soispha.programs.river; + esa = lib.strings.escapeShellArg; + riverctl = lib.getExe' pkgs.river "riverctl"; + + mkOutputFlags = output: flags: let + expandedFlags = builtins.concatStringsSep " " (lib.attrsets.mapAttrsToList (flag: value: "--${esa flag} ${esa value}") flags); + in '' + err_fail ${lib.getExe pkgs.wlr-randr} --output ${esa output} ${expandedFlags} + ''; + screenSetupCode = builtins.concatStringsSep "" (lib.attrsets.mapAttrsToList mkOutputFlags cfg.init.screenSetupCode); + + mkLrProgram = input: let + program = builtins.concatStringsSep " " ( + if lib.isDerivation input + then [(lib.getExe input)] + else builtins.map esa input + ); + in "err_fail ${program} &"; + longRunningPrograms = builtins.concatStringsSep "\n" (builtins.map mkLrProgram cfg.init.backgroundStart); + + keymapFormat = pkgs.formats.json {}; + + keymappings = '' + err_fail ${riverctl} keyboard-layout ${esa cfg.init.mappings.layout} + err_fail ${lib.getExe pkgs.river-mk-keymap} ${keymapFormat.generate "keys.json" cfg.init.mappings.keymap} + ''; + + mkRule = { + app-id, + title, + action, + }: '' + err_fail ${riverctl} rule-add -app-id ${esa app-id} -title ${esa title} ${esa action} + ''; + ruleSetup = builtins.concatStringsSep "" (builtins.map mkRule cfg.init.rules); + + mkSetting = name: maybe_values: let + rawValues = + if builtins.isString maybe_values + then [maybe_values] + else maybe_values; + values = builtins.concatStringsSep " " (builtins.map esa rawValues); + in '' + err_fail ${riverctl} ${esa name} ${values} + ''; + generalSettings = + builtins.concatStringsSep "" (lib.attrsets.mapAttrsToList mkSetting + cfg.init.generalSettings); + + mkInput = name: arguments: + builtins.concatStringsSep "" (builtins.map (argumentLine: mkSetting "input" ([name] ++ argumentLine)) arguments); + inputs = + builtins.concatStringsSep "" (lib.attrsets.mapAttrsToList mkInput cfg.init.inputs); in { options.soispha.programs.river = { enable = lib.mkEnableOption "river"; + unicodeInput = { enable = lib.mkEnableOption "udev rules for rawhid based unicode input"; }; + + init = { + mappings = { + layout = lib.mkOption { + type = lib.types.str; + description = "The keymap to use"; + default = "dvorak-modified"; + }; + + keymap = lib.mkOption { + type = lib.types.submodule { + freeformType = keymapFormat.type; + + options = {}; + }; + default = {}; + + description = '' + Configuration for river-mk-keymap via `keys.json`. + ''; + }; + }; + + rules = lib.mkOption { + type = lib.types.listOf (lib.types.attrsOf lib.types.str); + default = []; + + example = '' + [ + { + app-id = "*"; + title = "floating please"; + action = "float"; + } + { + app-id = "*"; + title = "*"; + action = "ssd"; + } + ] + ''; + + description = '' + Configuration for river_init_lesser via `keys.json`. + ''; + }; + + generalSettings = lib.mkOption { + type = lib.types.attrsOf (lib.types.either (lib.types.listOf lib.types.str) lib.types.str); + description = "Simple key value settings."; + default = {}; + example = '' + { + background-color = "0x002b36"; + set-repeat = ["50" "300"]; + hide-cursor = ["when-typing" "enabled"]; + } + ''; + }; + + inputs = lib.mkOption { + type = lib.types.attrsOf (lib.types.listOf (lib.types.listOf lib.types.str)); + description = "Options to set per input device"; + default = {}; + example = '' + { + pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; + pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; + } + ''; + }; + + backgroundStart = lib.mkOption { + type = lib.types.listOf (lib.types.either lib.types.package (lib.types.listOf lib.types.str)); + description = "List of programs to start in the background"; + example = '' + [ + pkgs.gammastep + ] + ''; + }; + + screenSetupCode = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); + default = {}; + description = '' + `wlr-randr` flags to set up outputs. The attribute names are the `--output` keys + and the attrs are flag value pairs to setup. + ''; + example = '' + { + "Virtual-1" = {mode = "1920x1080";}; + "DP-2" = {pos = "2560,0";}; + "DP-1" = {scale = "1.5"; pos = "0,0";}; + } + ''; + }; + }; }; config = lib.mkIf cfg.enable { - # TODO: Migrate the complete river module <2024-12-30> services.udev.packages = lib.mkIf cfg.unicodeInput.enable [qmk_firmware.packages.${system}.qmk_unicode_type]; + + home-manager.users.soispha = { + home.sessionVariables = { + WM = "river"; + XDG_CURRENT_DESKTOP = "river"; + DESKTOP_SESSION = "river"; + + # Export Wayland env Vars {{{ + QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct + CLUTTER_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; # might brake some things + # }}} + }; + + home.packages = [ + pkgs.river-start + ]; + + xdg.configFile."river/init" = { + executable = true; + text = let + mkHeading = text: other_stuff: '' + # ${text} + ${other_stuff} + ''; + in + builtins.readFile ./init_base.sh + + + # bash + mkHeading "Environment variables" '' + err_fail ${riverctl} spawn "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" + export XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river; + '' + + mkHeading "Key Mappings" keymappings + + mkHeading "Rules" ruleSetup + + mkHeading "General Settings" generalSettings + + mkHeading "Input Section" inputs + + mkHeading "Screen setup code" screenSetupCode + + mkHeading "Background services" longRunningPrograms + + mkHeading "Layout Setup" '' + err_fail ${riverctl} default-layout rivertile + ${lib.getExe' pkgs.river "rivertile"} -main-ratio 0.5 -view-padding 1 -outer-padding 0 + ''; + }; + }; }; } diff --git a/modules/by-name/so/sound/module.nix b/modules/by-name/so/sound/module.nix index f3120a67..8b519f09 100644 --- a/modules/by-name/so/sound/module.nix +++ b/modules/by-name/so/sound/module.nix @@ -10,7 +10,7 @@ in { }; config = lib.mkIf cfg.enable { - hardware.pulseaudio.enable = false; + services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { diff --git a/modules/home.legacy/conf/swaylock/GTDcanonical.png b/modules/by-name/sw/swaylock/images/GTDcanonical.png index ef41d79d..ef41d79d 100644 --- a/modules/home.legacy/conf/swaylock/GTDcanonical.png +++ b/modules/by-name/sw/swaylock/images/GTDcanonical.png Binary files differdiff --git a/modules/home.legacy/conf/swaylock/commands.jpg b/modules/by-name/sw/swaylock/images/commands.jpg index 54016503..54016503 100644 --- a/modules/home.legacy/conf/swaylock/commands.jpg +++ b/modules/by-name/sw/swaylock/images/commands.jpg Binary files differdiff --git a/modules/home.legacy/conf/swaylock/duwon-lee-tempano-port.jpg b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg index d72f32d1..d72f32d1 100644 --- a/modules/home.legacy/conf/swaylock/duwon-lee-tempano-port.jpg +++ b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg Binary files differdiff --git a/modules/home.legacy/conf/swaylock/gnu.png b/modules/by-name/sw/swaylock/images/gnu.png index d07dee3e..d07dee3e 100644 --- a/modules/home.legacy/conf/swaylock/gnu.png +++ b/modules/by-name/sw/swaylock/images/gnu.png Binary files differdiff --git a/modules/by-name/sw/swaylock/module.nix b/modules/by-name/sw/swaylock/module.nix index 6cbcef28..fc296de7 100644 --- a/modules/by-name/sw/swaylock/module.nix +++ b/modules/by-name/sw/swaylock/module.nix @@ -1,4 +1,25 @@ -{...}: { - # otherwise swaylock can't access the user password. - security.pam.services.swaylock = {}; +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.swaylock; +in { + options.soispha.programs.swaylock = { + enable = lib.mkEnableOption "swaylock"; + }; + + config = lib.mkIf cfg.enable { + # otherwise swaylock can't access the user password. + security.pam.services.swaylock = {}; + + home-manager.users.soispha.programs.swaylock = { + enable = true; + settings = { + image = "${./images/duwon-lee-tempano-port.jpg}"; + scaling = "stretch"; + color = "000000"; + }; + }; + }; } diff --git a/modules/by-name/zs/zsh/module.nix b/modules/by-name/zs/zsh/module.nix index 833da126..cb1bb086 100644 --- a/modules/by-name/zs/zsh/module.nix +++ b/modules/by-name/zs/zsh/module.nix @@ -6,7 +6,8 @@ ... }: let cfg = config.soispha.programs.zsh; - homeConfig = config.home-manager.users.soispha; + + zDotDir = ".config/zsh"; sourceFile = path: "source ${path}\n"; in { @@ -14,98 +15,108 @@ in { enable = lib.mkEnableOption "zsh"; }; - config.home-manager.users.soispha = lib.mkIf cfg.enable { - home.sessionPath = []; - - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion = { - enable = true; - strategy = []; - }; - syntaxHighlighting.enable = true; - - autocd = true; + config = lib.mkIf cfg.enable { + environment.variables = { + ZDOTDIR = "${config.home-manager.users.soispha.home.homeDirectory}/${zDotDir}"; + }; - # Must be relative to the users home directory (for whatever reason) - # Thus no `${homeConfig.xdg.configHome}` - dotDir = ".config/zsh"; + home-manager.users.soispha = { + home.sessionPath = lib.mkForce []; - # TODO: Remove the whole history and replace it completely with `atuin` <2024-10-21> - history = { - path = "/dev/null"; - # save = 0; # number of lines to save - # size = 0; # number of lines to keep - # share = false; # share between sessions - }; + # This just includes a `source ~/.config/zsh/.zshenv`, because home-manger by-default + # can't access the root `/etc/zshenv`. We can and thus, we can remove this file. + home.file.".zshenv".enable = false; - loginExtra = - # bash - '' - setopt AUTO_CD - setopt AUTO_PUSHD - setopt CHASE_DOTS - - setopt ALWAYS_TO_END - - setopt EXTENDED_HISTORY - setopt HIST_ALLOW_CLOBBER - setopt HIST_VERIFY - setopt HIST_FCNTL_LOCK - setopt APPEND_HISTORY - - setopt DVORAK - setopt CORRECT - - setopt PROMPT_SUBST - setopt TRANSIENT_RPROMPT # maybe? - - setopt COMBINING_CHARS - setopt VI - ''; - - initExtraFirst = - sourceFile ./config/zsh-init.zsh - + '' - SHELL_LIBRARY_VERSION="2.1.2" source ${shell_library.rawLib.${system}} - ''; - - initExtra = let - start = lib.modules.mkBefore ( - # NOTE: This must be before the insult, as we otherwise override the previous handler <2024-02-28> - sourceFile ./config/command_not_found/command_not_found.sh - + sourceFile ./config/command_not_found/command_not_found_insult.sh - + sourceFile ./config/custom_cursor.zsh - + sourceFile ./config/edit_command_line.zsh - + sourceFile ./plugins/zsh-history-substring-search.zsh - ); - end = lib.modules.mkAfter ( - sourceFile ./config/keymaps_start.zsh - + sourceFile ./config/keymaps/command.zsh - + sourceFile ./config/keymaps/emacs.zsh - + sourceFile ./config/keymaps/isearch.zsh - + sourceFile ./config/keymaps/vicmd.zsh - + sourceFile ./config/keymaps/viins.zsh - + sourceFile ./config/keymaps/viopp.zsh - + sourceFile ./config/keymaps/visual.zsh - + sourceFile ./config/keymaps_end.zsh - ); - in - lib.modules.mkMerge - [ - start - end - ]; - - localVariables = { - HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND = "bg=cyan,fg=white"; - HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND = "fg=red,underline,standout,bold"; - }; - - shellAliases = { - ll = ". ll"; - lm = ". lm"; + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion = { + enable = true; + strategy = []; + }; + syntaxHighlighting.enable = true; + + autocd = true; + + # Must be relative to the users home directory (for whatever reason) + # Thus no `${homeConfig.xdg.configHome}` + dotDir = zDotDir; + + # TODO: Remove the whole history and replace it completely with `atuin` <2024-10-21> + history = { + path = "/dev/null"; + # save = 0; # number of lines to save + # size = 0; # number of lines to keep + # share = false; # share between sessions + }; + + loginExtra = + # bash + '' + setopt AUTO_CD + setopt AUTO_PUSHD + setopt CHASE_DOTS + + setopt ALWAYS_TO_END + + setopt EXTENDED_HISTORY + setopt HIST_ALLOW_CLOBBER + setopt HIST_VERIFY + setopt HIST_FCNTL_LOCK + setopt APPEND_HISTORY + + setopt DVORAK + setopt CORRECT + + setopt PROMPT_SUBST + setopt TRANSIENT_RPROMPT # maybe? + + setopt COMBINING_CHARS + setopt VI + ''; + + initExtraFirst = + sourceFile ./config/zsh-init.zsh + + '' + SHELL_LIBRARY_VERSION="2.1.2" source ${shell_library.rawLib.${system}} + ''; + + initExtra = let + start = lib.modules.mkBefore ( + # NOTE: This must be before the insult, as we otherwise override the previous handler <2024-02-28> + sourceFile ./config/command_not_found/command_not_found.sh + + sourceFile ./config/command_not_found/command_not_found_insult.sh + + sourceFile ./config/custom_cursor.zsh + + sourceFile ./config/edit_command_line.zsh + + sourceFile ./plugins/zsh-history-substring-search.zsh + ); + end = lib.modules.mkAfter ( + sourceFile ./config/keymaps_start.zsh + + sourceFile ./config/keymaps/command.zsh + + sourceFile ./config/keymaps/emacs.zsh + + sourceFile ./config/keymaps/isearch.zsh + + sourceFile ./config/keymaps/vicmd.zsh + + sourceFile ./config/keymaps/viins.zsh + + sourceFile ./config/keymaps/viopp.zsh + + sourceFile ./config/keymaps/visual.zsh + + sourceFile ./config/keymaps_end.zsh + ); + in + lib.modules.mkMerge + [ + start + end + ]; + + localVariables = { + HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND = "bg=cyan,fg=white"; + HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND = "fg=red,underline,standout,bold"; + }; + + shellAliases = { + ll = ". ll"; + lm = ". lm"; + }; }; }; }; diff --git a/modules/home.legacy/files/wallpaper/abstract-nord.png b/modules/common/abstract-nord.png index 5ef498bf..5ef498bf 100644 --- a/modules/home.legacy/files/wallpaper/abstract-nord.png +++ b/modules/common/abstract-nord.png Binary files differdiff --git a/flake/nixosConfigurations/common.nix b/modules/common/default.nix index 8071c6a9..232c329d 100644 --- a/flake/nixosConfigurations/common.nix +++ b/modules/common/default.nix @@ -3,6 +3,7 @@ { config, pkgs, + lib, ... }: { soispha = { @@ -108,7 +109,81 @@ imv.enable = true; less.enable = true; lf.enable = true; - river.enable = true; + river = { + enable = true; + init = { + rules = [ + { + app-id = "float"; + title = "*"; + action = "float"; + } + { + app-id = "mpv"; + title = "*"; + action = "float"; + } + { + app-id = "ModernGL"; + title = "*"; + action = "float"; + } + { + app-id = "*"; + title = "Manim Slides"; + action = "float"; + } + { + app-id = "*"; + title = "floating please"; + action = "float"; + } + + { + app-id = "*"; + title = "*"; + action = "ssd"; + } + # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) + { + app-id = "firefox"; + title = "*"; + action = "csd"; + } + ]; + generalSettings = { + # background + background-color = "0x002b36"; + border-color-focused = "0x93a1a1"; + border-color-unfocused = "0x586e75"; + + # keyboard repeat rate + set-repeat = ["50" "300"]; + + # Cursor + focus-follows-cursor = "normal"; + # hide-cursor = ["timeout" "2000"]; + hide-cursor = ["when-typing" "enabled"]; + set-cursor-warp = "on-output-change"; + xcursor-theme = ["Nordzy-cursors" "24"]; + }; + inputs = { + pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; + pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; + }; + backgroundStart = [ + pkgs.gammastep + pkgs.yambar + + pkgs.mako + ["${lib.getExe pkgs.swaybg}" "--image" "${./abstract-nord.png}"] + pkgs.swayidle + pkgs.alacritty + ]; + }; + }; + mpv.enable = true; + swaylock.enable = true; taskwarrior.enable = true; yambar.enable = true; yt.enable = true; diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix index 38cbc915..e1cab572 100644 --- a/modules/home.legacy/conf/default.nix +++ b/modules/home.legacy/conf/default.nix @@ -16,7 +16,6 @@ ./mail ./mako ./mbsync - ./mpv ./mumble ./neomutt ./nix-index @@ -28,7 +27,6 @@ ./ssh ./starship ./swayidle - ./swaylock ./taskwarrior ./timewarrior ./tridactyl diff --git a/modules/home.legacy/conf/firefox/config/bookmarks/default.nix b/modules/home.legacy/conf/firefox/config/bookmarks/default.nix index c612bf4d..41936819 100644 --- a/modules/home.legacy/conf/firefox/config/bookmarks/default.nix +++ b/modules/home.legacy/conf/firefox/config/bookmarks/default.nix @@ -3,27 +3,7 @@ pkgs, ... }: let - bookmarks = [ - { - name = "Feed - Piped"; - url = "https://piped.video/feed"; - } - - { - name = "DeepL Translate"; - url = "https://www.deepl.com/translator"; - } - - { - name = "Nix lib"; - url = "https://teu5us.github.io/nix-lib.html"; - } - - { - name = "Nixpkgs manual"; - url = "https://ryantm.github.io/nixpkgs/"; - } - ]; + bookmarks = []; mkBookmarksFile = (import ./lib.nix) {inherit lib pkgs;}; bookmarks_file = mkBookmarksFile bookmarks; diff --git a/modules/home.legacy/conf/firefox/config/search/engines/default.nix b/modules/home.legacy/conf/firefox/config/search/engines/default.nix index a47c77df..7e7880ca 100644 --- a/modules/home.legacy/conf/firefox/config/search/engines/default.nix +++ b/modules/home.legacy/conf/firefox/config/search/engines/default.nix @@ -13,6 +13,12 @@ definedAliases = ["@np"]; }; + "Nix functions" = { + urls = [{template = "https://noogle.dev/q?term={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@ng"]; + }; + "NixOS Options" = { urls = [{template = "https://search.nixos.org/options?type=options&query={searchTerms}";}]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; diff --git a/modules/home.legacy/conf/mail/default.nix b/modules/home.legacy/conf/mail/default.nix index 0ecbe40a..9c2554ee 100644 --- a/modules/home.legacy/conf/mail/default.nix +++ b/modules/home.legacy/conf/mail/default.nix @@ -1,15 +1,47 @@ { config, pkgs, + lib, ... }: let benedikt = import ./accounts/benedikt.nix {inherit pkgs;}; soispha = import ./accounts/soispha.nix {inherit pkgs;}; accounts = {inherit soispha benedikt;}; + + mkHelper = { + userName, + passwordCommand, + ... + }: + builtins.toString (pkgs.writeShellScript "git-credential-keepassxc-libsecret" + # bash + '' + [ "$1" = "get" ] || { + exit 1 + } + if cat | grep "username=${userName}" -q; then + ${passwordCommand} + else + # Not our business. + exit 1 + fi + ''); + accountCredentials = + # TODO: This will result in only one of them being defined, as we duplicate the + # attribute key<2025-02-03> + lib.mapAttrs' (_: value: { + name = "credential.smtp://${value.smtp.host}:${builtins.toString value.smtp.port}"; + value = { + "helper" = mkHelper value; + }; + }) + accounts; in { accounts.email = { maildirBasePath = "${config.xdg.dataHome}/maildir"; inherit accounts; }; + + programs.git.extraConfig = accountCredentials; } diff --git a/modules/home.legacy/conf/mbsync/default.nix b/modules/home.legacy/conf/mbsync/default.nix index ac9808c9..8418d92d 100644 --- a/modules/home.legacy/conf/mbsync/default.nix +++ b/modules/home.legacy/conf/mbsync/default.nix @@ -1,17 +1,16 @@ -{ - config, - lib, - ... -}: { - # TODO: I have no clue if both are needed, but it looks neat, right? +{lib, ...}: { + # This configures the program in itself (i.e., sets-up a config file, etc.) programs.mbsync = { enable = true; }; + + # This starts a systemd service to periodically sync mail services.mbsync = { enable = true; - # TODO: enable after isync 1.5 drops - #configFile = "${config.xdg.configHome}/mbsync/mbsync.conf"; }; - # Disable the timer, and only activate it on neomutt start + + # Disable the timer, and only activate the service when neomutt starts + # Otherwise, the password command would prompt me to unlock the keepassxc database every + # time. systemd.user.timers.mbsync = lib.mkForce {}; } diff --git a/modules/home.legacy/conf/mpv/default.nix b/modules/home.legacy/conf/mpv/default.nix deleted file mode 100644 index 6b252a38..00000000 --- a/modules/home.legacy/conf/mpv/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.mpv = { - enable = true; - bindings = { - q = "quit 0"; - "Ctrl+c" = "quit 1"; - "Shift+q" = "quit-watch-later 1"; - }; - }; -} diff --git a/modules/home.legacy/conf/swaylock/default.nix b/modules/home.legacy/conf/swaylock/default.nix deleted file mode 100644 index d662cb78..00000000 --- a/modules/home.legacy/conf/swaylock/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.swaylock = { - enable = true; - settings = { - image = "${./duwon-lee-tempano-port.jpg}"; - scaling = "center"; - color = "000000"; - }; - }; -} diff --git a/modules/home.legacy/files/default.nix b/modules/home.legacy/files/default.nix index 16fe9afe..50b340b8 100644 --- a/modules/home.legacy/files/default.nix +++ b/modules/home.legacy/files/default.nix @@ -1,6 +1,5 @@ {...}: { imports = [ - ./wallpaper ./manifest_json ]; } diff --git a/modules/home.legacy/files/wallpaper/default.nix b/modules/home.legacy/files/wallpaper/default.nix deleted file mode 100644 index 119df225..00000000 --- a/modules/home.legacy/files/wallpaper/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{config, ...}: { - home = { - sessionVariables = { - WALLPAPER = "${config.home.homeDirectory}/media/pictures/wallpaper"; - }; - - file = { - wallpaper = { - source = ./abstract-nord.png; - target = "media/pictures/wallpaper"; - }; - }; - }; -} diff --git a/modules/home.legacy/pkgs/default.nix b/modules/home.legacy/pkgs/default.nix index 1a4c4a1b..1d77c7de 100644 --- a/modules/home.legacy/pkgs/default.nix +++ b/modules/home.legacy/pkgs/default.nix @@ -5,44 +5,37 @@ nixosConfig, ... }: -# TODO: Remove this whole file, and move each pkgs to a separate module. <2024-11-16> +# TODO: Remove this whole file, and move each package to a separate module. <2024-11-16> with pkgs; let + neorgFinal = + neorg.override + { + defaultNeorgProjectDir = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces.projects; + allProjectsNewline = config.soispha.taskwarrior.projects.projects_newline; + allProjectsComma = config.soispha.taskwarrior.projects.projects_comma; + allProjectsPipe = config.soispha.taskwarrior.projects.projects_pipe; + allWorkspaces = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces; + xdgConfigHome = config.xdg.configHome; + xdgDataHome = config.xdg.dataHome; + }; + Gui = { Terminals = [ - # foot # wayland native terminal alacritty # default terminal ]; - Browsers = [ - #ungoogled-chromium # web browser (only for web programming) - #brave - ]; - - ImageManipulation = [ - #krita # new, and better (KDE) - #gimp # conservative, and old (GNOME) - ]; Social = [ - mumble # voice chat software (client) - # lutris # multiple game store clients - - # nheko # best matrix client (as of today) - # element-desktop # nheko didn't work signal-desktop # to avoid encryption problems with signal-bridge ]; Misc = [ - #kalzium # Periodic Table of Elements (`element` is [sort of] better) keepassxc # password manager - #onlykey # OnlyKey Chrome Desktop App anki-bin # spaced repetition ]; }; TuiCli = { EyeCandy = [ - #banner # Print large banners to ASCII terminals - cmatrix # A curses-based scrolling 'Matrix'-like screen hyfetch # Neofetch with LGBTQ pride flags. ]; @@ -58,7 +51,6 @@ with pkgs; let android-file-transfer # Android MTP client with minimalistic UI #xdg-ninja # A shell script which checks your $HOME for unwanted files and directories. xdg-utils # open urls and such things - yokadi # Command line oriented, sqlite powered, todo list killall # kill a application by name snap-sync-forked # A btrfs based backup solution bc # Smart calculator @@ -77,33 +69,18 @@ with pkgs; let Firefox = [ # `neorg` handles the integration between Firefox profiles and task # contexts - (neorg.override - { - defaultNeorgProjectDir = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces.projects; - allProjectsNewline = config.soispha.taskwarrior.projects.projects_newline; - allProjectsComma = config.soispha.taskwarrior.projects.projects_comma; - allProjectsPipe = config.soispha.taskwarrior.projects.projects_pipe; - allWorkspaces = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces; - xdgConfigHome = config.xdg.configHome; - xdgDataHome = config.xdg.dataHome; - }) + neorgFinal ]; }; WM = { - river = [river]; # A dynamic tiling wayland compositor - CLITools = [ lswt # List Wayland toplevels. wl-clipboard # Command-line copy/paste utilities. - swaylock # My current lockscreen implementation. ]; Media = [ - wf-recorder # Screen recorder. libnotify # a command to send a notification. - screenshot_persistent # Creates a persisting screenshot. - screenshot_temporary # Takes a screenshot and stores it in the clipboard. ]; }; @@ -120,13 +97,11 @@ with pkgs; let Listen = [ spodi # Wrapper around `spotdl`. - sort_song # Sorts songs in the current directory. ]; }; Hardware = { Storage = [ - #compsize # Calculate compression ratio of a set of files on Btrfs # TODO: smartmontools # Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives ]; @@ -144,10 +119,6 @@ with pkgs; let backlightName = nixosConfig.soispha.laptop.backlight; } ); - - Input = [ - #piper # GTK application to configure gaming mice - ]; }; SystemUpdate = [ @@ -176,7 +147,6 @@ with pkgs; let GeneralTools = [ stamp # Add a license header to a file git # the fast distributed version control system - git-absorb # git commit --fixup, but automatic git-edit-index # Allows you to edit the indexed version of a file git-cm # A wrapper that re-adds the last commit's subject git-cleanup # An automatic merged branch deleter @@ -194,7 +164,16 @@ with pkgs; let else builtins.attrValues x else [x]; in { - home.packages = + options.soispha.programs.neorg = { + package = lib.mkOption { + type = lib.types.package; + default = neorgFinal; + description = '' + The neorg package to use. + ''; + }; + }; + config.home.packages = [] ++ (with builtins; concatLists diff --git a/modules/home.legacy/wms/default.nix b/modules/home.legacy/wms/default.nix index 610ea2f4..340978f1 100644 --- a/modules/home.legacy/wms/default.nix +++ b/modules/home.legacy/wms/default.nix @@ -1,7 +1,6 @@ {config, ...}: { imports = [ # ./sway - ./river # ./plasma ]; } diff --git a/modules/home.legacy/wms/river/default.nix b/modules/home.legacy/wms/river/default.nix deleted file mode 100644 index 9463e94e..00000000 --- a/modules/home.legacy/wms/river/default.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - pkgs, - sysLib, - river_init_lesser, - nixosConfig, - system, - qmk_firmware, - ... -}: let - inherit (nixosConfig.networking) hostName; - mappings = - if hostName == "tiamat" - then '' - err_fail riverctl keyboard-layout 'us-modified' - err_fail river_init_lesser ~/.config/river/res/moonlander.ron - '' - else if hostName == "lahmu" || hostName == "apzu" || hostName == "mammun" || hostName == "isimud" - then '' - err_fail riverctl keyboard-layout 'dvorak-modified' - err_fail river_init_lesser ~/.config/river/res/keys.ron - '' - else builtins.throw "Host not covered in river mappings"; - screen_setup = - if hostName == "lahmu" - then '' - err_fail wlr-randr --output Virtual-1 --mode 1920x1080 - '' - else if hostName == "tiamat" - then '' - err_fail wlr-randr --output DP-2 --pos 2560,0 - err_fail wlr-randr --output DP-1 --scale 1.5 --pos 0,0 - err_fail gammastep & - '' - else if hostName == "apzu" || hostName == "mammun" || hostName == "isimud" - then '' - err_fail gammastep & - '' - else builtins.throw "Host not covered in river screen setup"; - env_vars = "XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river"; - init_scr = pkgs.substituteAll { - src = ./init.sh; - inherit mappings screen_setup env_vars; - }; -in { - home.sessionVariables = { - WM = "river"; - XDG_CURRENT_DESKTOP = "river"; - DESKTOP_SESSION = "river"; - - # Export Wayland env Vars {{{ - QT_QPA_PLATFORM = "wayland"; - QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct - CLUTTER_BACKEND = "wayland"; - SDL_VIDEODRIVER = "wayland"; # might brake some things - # }}} - }; - - xdg.configFile."river/init".source = - sysLib.writeShellScript { - name = "river_init"; - src = init_scr; - keepPath = true; - dependencies = builtins.attrValues { - river_init_lesser = river_init_lesser.packages.${system}.default; - inherit (qmk_firmware.packages.${system}) qmk_unicode_type; - - inherit - (pkgs) - dash - river - glib # gnome lib - gammastep - wlr-randr - yambar - mako - swaybg - swayidle - swaylock - alacritty - ; - }; - } - + /bin/river_init; - - # TODO: These mappings should be generated in nix. (Which would allow to replace the - # `mpc` pat adding.) <2024-11-16> - - # Needed for the key-mappings. - home.packages = [pkgs.mpc]; - xdg.configFile."river/res".source = ./res; -} diff --git a/modules/home.legacy/wms/river/init.sh b/modules/home.legacy/wms/river/init.sh deleted file mode 100755 index 06a2e2f4..00000000 --- a/modules/home.legacy/wms/river/init.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -err_fail() { - if ! "$@"; then - warning "\"$*\" failed!\n" >>~/river_log - # msg "Executing the safe init!" - # exec ~/.config/river/res/safe_init.sh - fi -} -err_fail rm ~/river_log -exec 1>>"$HOME"/river_log -exec 2>>"$HOME"/river_log - -#trap err_fail ERR - -#Setup of environment variables {{{ -err_fail riverctl spawn "exec dbus-update-activation-environment --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" -export @env_vars@ -#}}} - -# Setup of mappings {{{ -@mappings@ -# }}} - -# Setup of Rules {{{ -err_fail riverctl rule-add -app-id float -title '*' float -err_fail riverctl rule-add -app-id mpv -title '*' float -err_fail riverctl rule-add -app-id ModernGL -title '*' float -err_fail riverctl rule-add -app-id '*' -title 'Manim Slides' float -err_fail riverctl rule-add -app-id '*' -title 'floating please' float - -err_fail riverctl rule-add -app-id '*' -title '*' ssd -err_fail riverctl rule-add -app-id firefox -title '*' csd # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) -# }}} - -# Set riverctl settings {{{ -# background -err_fail riverctl background-color 0x002b36 -err_fail riverctl border-color-focused 0x93a1a1 -err_fail riverctl border-color-unfocused 0x586e75 - -# keyboard repeat rate -err_fail riverctl set-repeat 50 300 - -# Cursor -err_fail riverctl focus-follows-cursor normal -#riverctl hide-cursor timeout 2000 -err_fail riverctl hide-cursor when-typing enabled -err_fail riverctl set-cursor-warp on-output-change -err_fail riverctl xcursor-theme Nordzy-cursors 24 - -err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 pointer-accel 0 -err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 accel-profile none - -err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I pointer-accel 0 -err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I accel-profile none -# }}} - -# Setup of general apps {{{ -@screen_setup@ - -err_fail yambar & - -err_fail mako & -err_fail swaybg -i "$WALLPAPER" & -err_fail swayidle & -err_fail alacritty & -# }}} - -# Setup of layout [acts as exec!] {{{ -err_fail riverctl default-layout rivertile -@env_vars@ rivertile -main-ratio 0.5 -view-padding 1 -outer-padding 0 - -#riverctl default-layout luatile -#river-luatile -# }}} -# vim: ft=sh diff --git a/modules/home.legacy/wms/river/res/keys.ron b/modules/home.legacy/wms/river/res/keys.ron deleted file mode 100644 index a2bc0fa1..00000000 --- a/modules/home.legacy/wms/river/res/keys.ron +++ /dev/null @@ -1,58 +0,0 @@ -#![enable(implicit_some)] -RiverctlCommandArray( - commands: [ - // Focus change - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super", command: "focus-view", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super", command: "focus-view", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Control", command: "focus-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Control", command: "focus-output", command_args: "previous",), - - // Standard program - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super", command: "spawn", command_args: "alacritty",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "q", mods: "Super+Shift", command: "exit", command_args: None,), - - // Screenshot - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Print", mods: "None", command: "spawn", command_args: "screenshot_persistent",), - - // Audio - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "XF86AudioRaiseVolume", mods: "None", command: "spawn", command_args: "pactl set-sink-volume 1 +5%",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioLowerVolume", mods: "None", command: "spawn", command_args: "pactl set-sink-volume 1 -5%",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioMute", mods: "None", command: "spawn", command_args: "mpc toggle",), - - // Launcher - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Super", command: "spawn", command_args: "rofi -show combi -modes combi -combi-modes 'window,drun,run' -show-icons",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F1", mods: "Super", command: "spawn", command_args: "neorg dmenu",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F2", mods: "Super", command: "spawn", command_args: "keepassxc",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F3", mods: "Super", command: "spawn", command_args: "signal-desktop",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F4", mods: "Super", command: "spawn", command_args: "steam",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Super", command: "spawn", command_args: "lock",), - - // Client - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "f", mods: "Super", command: "toggle-fullscreen", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "c", mods: "Super+Shift", command: "close", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "space", mods: "Super+Control", command: "toggle-float", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super+Control", command: "zoom", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "o", mods: "Super", command: "send-to-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Shift", command: "swap", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Shift", command: "swap", command_args: "previous",), - - // Toggle all tags - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super", command: "set-focused-tags", command_args: "4294967295"), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super+Shift", command: "set-view-tags", command_args: "4294967295"), - - // Mouse - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), - - ], - // Set these mappings for the tags 0-8 with key [1-9] - tags_number: 9, - tag_commands: [ - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super", command: "set-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift", command: "set-view-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), - ], -) - -// vim: nolinebreak nowrap textwidth=0 diff --git a/modules/home.legacy/wms/river/res/moonlander.ron b/modules/home.legacy/wms/river/res/moonlander.ron deleted file mode 100644 index 247c1697..00000000 --- a/modules/home.legacy/wms/river/res/moonlander.ron +++ /dev/null @@ -1,66 +0,0 @@ -#![enable(implicit_some)] -RiverctlCommandArray( - // TODO: add toggle-focus mapping - commands: [ - // Movement - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "A", mods: "Alt+Control+Super+Shift", command: "exit", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "B", mods: "Alt+Control+Super+Shift", command: "close", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "C", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "D", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "next",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "E", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "next",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "G", mods: "Alt+Control+Super+Shift", command: "zoom", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "H", mods: "Alt+Control+Super+Shift", command: "toggle-fullscreen", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "I", mods: "Alt+Control+Super+Shift", command: "toggle-float", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "J", mods: "Alt+Control+Super+Shift", command: "send-to-output", command_args: "next",), - - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "K", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "alacritty",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "screenshot_persistent",), - - // Audio - // RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "M", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "video-pause toggle",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "N", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "mpc toggle",), - - // Launcher - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "O", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "rofi -show combi -modes combi -combi-modes 'window,drun,run' -show-icons",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "P", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "neorg dmenu",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Q", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "keepassxc",), - // RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "nheko",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "S", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "signal-desktop",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "lock",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "U", mods: "Alt+Control+Super+Shift", command: "focus-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "V", mods: "Alt+Control+Super+Shift", command: "focus-previous-tags", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "W", mods: "Alt+Control+Super+Shift", command: "send-to-previous-tags",command_args: None,), - //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "X", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Y", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - - - // Toggle all tags - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Super+Shift", command: "set-focused-tags", command_args: "4294967295"), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Shift", command: "set-view-tags", command_args: "4294967295"), - - // Support Unicode input - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Z", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "qmk-unicode-type 106 65377",), - - // Mouse - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), - ], - - // Set these mappings for the tags 0-8 with key [1-9] - tags_number: 9, - tag_commands: [ - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Super+Shift", command: "set-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Shift", command: "set-view-tags",), - // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), - // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), - ], -) -// vim: nolinebreak nowrap textwidth=0 diff --git a/pkgs/by-name/ge/generate_moz_extension/Cargo.lock b/pkgs/by-name/ge/generate_moz_extension/Cargo.lock index 834f69a0..5968628d 100644 --- a/pkgs/by-name/ge/generate_moz_extension/Cargo.lock +++ b/pkgs/by-name/ge/generate_moz_extension/Cargo.lock @@ -76,9 +76,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.10" +version = "1.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" dependencies = [ "shlex", ] @@ -869,9 +869,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.21" +version = "0.23.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" dependencies = [ "once_cell", "rustls-pki-types", diff --git a/pkgs/by-name/ge/generate_moz_extension/flake.lock b/pkgs/by-name/ge/generate_moz_extension/flake.lock index 0fa75ec3..e3997271 100644 --- a/pkgs/by-name/ge/generate_moz_extension/flake.lock +++ b/pkgs/by-name/ge/generate_moz_extension/flake.lock @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738009863, - "narHash": "sha256-KxmFlQ2j9PpDhKRXWu85bv3R2wmfkUqdpJhEwz9JN/E=", + "lastModified": 1738297584, + "narHash": "sha256-AYvaFBzt8dU0fcSK2jKD0Vg23K2eIRxfsVXIPCW9a0E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f898cbfddfab52593da301a397a17d0af801bbc3", + "rev": "9189ac18287c599860e878e905da550aa6dec1cd", "type": "github" }, "original": { @@ -64,11 +64,11 @@ ] }, "locked": { - "lastModified": 1738117527, - "narHash": "sha256-GFviGfaezjGLFUlxdv3zyC7rSZvTXqwcG/YsF6MDkOw=", + "lastModified": 1738376888, + "narHash": "sha256-S6ErHxkSm0iA7ZMsjjDaASWxbELYcdfv8BhOkkj1rHw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6a3dc6ce4132bd57359214d986db376f2333c14d", + "rev": "83284068670d5ae4a43641c4afb150f3446be70d", "type": "github" }, "original": { diff --git a/pkgs/by-name/lf/lf-make-map/Cargo.lock b/pkgs/by-name/lf/lf-make-map/Cargo.lock index ff2a1782..623507b6 100644 --- a/pkgs/by-name/lf/lf-make-map/Cargo.lock +++ b/pkgs/by-name/lf/lf-make-map/Cargo.lock @@ -87,9 +87,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "cc" -version = "1.2.10" +version = "1.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" dependencies = [ "shlex", ] diff --git a/pkgs/by-name/lf/lf-make-map/flake.lock b/pkgs/by-name/lf/lf-make-map/flake.lock index e638dcd2..23ae6eab 100644 --- a/pkgs/by-name/lf/lf-make-map/flake.lock +++ b/pkgs/by-name/lf/lf-make-map/flake.lock @@ -53,11 +53,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738009863, - "narHash": "sha256-KxmFlQ2j9PpDhKRXWu85bv3R2wmfkUqdpJhEwz9JN/E=", + "lastModified": 1738297584, + "narHash": "sha256-AYvaFBzt8dU0fcSK2jKD0Vg23K2eIRxfsVXIPCW9a0E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f898cbfddfab52593da301a397a17d0af801bbc3", + "rev": "9189ac18287c599860e878e905da550aa6dec1cd", "type": "github" }, "original": { @@ -85,11 +85,11 @@ ] }, "locked": { - "lastModified": 1738117527, - "narHash": "sha256-GFviGfaezjGLFUlxdv3zyC7rSZvTXqwcG/YsF6MDkOw=", + "lastModified": 1738376888, + "narHash": "sha256-S6ErHxkSm0iA7ZMsjjDaASWxbELYcdfv8BhOkkj1rHw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6a3dc6ce4132bd57359214d986db376f2333c14d", + "rev": "83284068670d5ae4a43641c4afb150f3446be70d", "type": "github" }, "original": { diff --git a/pkgs/by-name/lo/lock/lock.sh b/pkgs/by-name/lo/lock/lock.sh index 3101ef9a..4c5e1c01 100755 --- a/pkgs/by-name/lo/lock/lock.sh +++ b/pkgs/by-name/lo/lock/lock.sh @@ -1,18 +1,15 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=bash context="$(task _get rc.context)" -[ "$context" ] && task context none +[ -n "$context" ] && task context none # We have ensured that only one task is active active="$(task +ACTIVE _ids)" -[ "$active" ] && task stop "$active" +[ -n "$active" ] && task stop "$active" swaylock -[ "$active" ] && task start "$active" +[ -n "$active" ] && task start "$active" -[ "$context" ] && task context "$context" +[ -n "$context" ] && task context "$context" # vim: ft=sh diff --git a/pkgs/by-name/lo/lock/package.nix b/pkgs/by-name/lo/lock/package.nix index 0e6e38d0..1c857cd6 100644 --- a/pkgs/by-name/lo/lock/package.nix +++ b/pkgs/by-name/lo/lock/package.nix @@ -1,15 +1,16 @@ { - sysLib, + writeShellApplication, taskwarrior, swaylock, }: -sysLib.writeShellScript { +writeShellApplication { name = "lock"; - src = ./lock.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ + text = builtins.readFile ./lock.sh; + runtimeInputs = [ taskwarrior swaylock ]; + meta = { + mainProgram = "lock"; + }; } diff --git a/pkgs/by-name/ne/neorg/package.nix b/pkgs/by-name/ne/neorg/package.nix index 3d26d1fb..ad39290a 100644 --- a/pkgs/by-name/ne/neorg/package.nix +++ b/pkgs/by-name/ne/neorg/package.nix @@ -17,7 +17,7 @@ xdgConfigHome ? builtins.getEnv "XDG_CONFIG_HOME", xdgDataHome ? builtins.getEnv "XDG_DATA_HOME", }: -sysLib.writeShellScriptMultiPart { +(sysLib.writeShellScriptMultiPart { name = "neorg"; src = ./.; generateCompletions = true; @@ -69,4 +69,7 @@ sysLib.writeShellScriptMultiPart { # TODO: Replace the hard-coded path here with some reference <2023-10-20> TASK_PROJECT_FILE = "/home/soispha/repos/nix/nixos-config/hm/soispha/conf/taskwarrior/projects/default.nix"; }; +}) +// { + meta.mainProgram = "neorg"; } diff --git a/pkgs/by-name/ri/river-mk-keymap/.envrc b/pkgs/by-name/ri/river-mk-keymap/.envrc new file mode 100644 index 00000000..fdd3e9d8 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/.envrc @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +use flake diff --git a/pkgs/by-name/ri/river-mk-keymap/.gitignore b/pkgs/by-name/ri/river-mk-keymap/.gitignore new file mode 100644 index 00000000..2d5df85d --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/.gitignore @@ -0,0 +1,2 @@ +/target +.direnv diff --git a/pkgs/by-name/ri/river-mk-keymap/Cargo.lock b/pkgs/by-name/ri/river-mk-keymap/Cargo.lock new file mode 100644 index 00000000..c8b05795 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/Cargo.lock @@ -0,0 +1,334 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" + +[[package]] +name = "clap" +version = "4.5.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "keymaps" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cec33e805ecc09c4e4f91ca26e536978ad1ae28f2e1dc02fadafeec6d2f8504" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "river-mk-keymap" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "keymaps", + "serde", + "serde_json", +] + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dabd04e3b9a8c3c03d5e743f5ef5e1207befc9de704d477f7198cc28049763e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/pkgs/by-name/ri/river-mk-keymap/Cargo.toml b/pkgs/by-name/ri/river-mk-keymap/Cargo.toml new file mode 100644 index 00000000..974ad06d --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/Cargo.toml @@ -0,0 +1,71 @@ +[package] +name = "river-mk-keymap" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1.0.95" +clap = { version = "4.5.27", features = ["derive"] } +keymaps = { version = "1.0.0", features = ["serde", "mouse-keys"] } +serde = { version = "1.0.217", features = ["derive"] } +serde_json = "1.0.138" + +[profile.release] +lto = true +codegen-units = 1 +panic = "abort" +split-debuginfo = "off" + +[lints.rust] +# rustc lint groups https://doc.rust-lang.org/rustc/lints/groups.html +warnings = "warn" +future_incompatible = { level = "warn", priority = -1 } +let_underscore = { level = "warn", priority = -1 } +nonstandard_style = { level = "warn", priority = -1 } +rust_2018_compatibility = { level = "warn", priority = -1 } +rust_2018_idioms = { level = "warn", priority = -1 } +rust_2021_compatibility = { level = "warn", priority = -1 } +unused = { level = "warn", priority = -1 } +# rustc allowed-by-default lints https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html +# missing_docs = "warn" +macro_use_extern_crate = "warn" +meta_variable_misuse = "warn" +missing_abi = "warn" +missing_copy_implementations = "warn" +missing_debug_implementations = "warn" +non_ascii_idents = "warn" +noop_method_call = "warn" +single_use_lifetimes = "warn" +trivial_casts = "warn" +trivial_numeric_casts = "warn" +unreachable_pub = "warn" +unsafe_op_in_unsafe_fn = "warn" +unused_crate_dependencies = "warn" +unused_import_braces = "warn" +unused_lifetimes = "warn" +unused_qualifications = "warn" +variant_size_differences = "warn" + +[lints.rustdoc] +# rustdoc lints https://doc.rust-lang.org/rustdoc/lints.html +broken_intra_doc_links = "warn" +private_intra_doc_links = "warn" +missing_crate_level_docs = "warn" +private_doc_tests = "warn" +invalid_codeblock_attributes = "warn" +invalid_rust_codeblocks = "warn" +bare_urls = "warn" + +[lints.clippy] +# clippy allowed by default +dbg_macro = "warn" +# clippy categories https://doc.rust-lang.org/clippy/ +all = { level = "warn", priority = -1 } +correctness = { level = "warn", priority = -1 } +suspicious = { level = "warn", priority = -1 } +style = { level = "warn", priority = -1 } +complexity = { level = "warn", priority = -1 } +perf = { level = "warn", priority = -1 } +pedantic = { level = "warn", priority = -1 } diff --git a/pkgs/by-name/ri/river-mk-keymap/TODO b/pkgs/by-name/ri/river-mk-keymap/TODO new file mode 100644 index 00000000..be77953e --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/TODO @@ -0,0 +1 @@ +Look at https://github.com/stefur/flow for river wayland inclusion diff --git a/pkgs/by-name/ri/river-mk-keymap/contrib/example.json b/pkgs/by-name/ri/river-mk-keymap/contrib/example.json new file mode 100644 index 00000000..c8673f9a --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/contrib/example.json @@ -0,0 +1,5 @@ +{ + "<M-a>": { + "command": ["focus-view", "next"] + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/flake.lock b/pkgs/by-name/ri/river-mk-keymap/flake.lock new file mode 100644 index 00000000..2f4a1210 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1738297584, + "narHash": "sha256-AYvaFBzt8dU0fcSK2jKD0Vg23K2eIRxfsVXIPCW9a0E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9189ac18287c599860e878e905da550aa6dec1cd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/by-name/ri/river-mk-keymap/flake.nix b/pkgs/by-name/ri/river-mk-keymap/flake.nix new file mode 100644 index 00000000..95a14456 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A smart way to configure river keybindings"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = {nixpkgs, ...}: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages."${system}"; + in { + devShells."${system}".default = pkgs.mkShell { + packages = with pkgs; [ + cargo + clippy + rustc + rustfmt + + cargo-edit + ]; + }; + }; +} +# vim: ts=2 + diff --git a/pkgs/by-name/ri/river-mk-keymap/package.nix b/pkgs/by-name/ri/river-mk-keymap/package.nix new file mode 100644 index 00000000..d9519d48 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/package.nix @@ -0,0 +1,14 @@ +{rustPlatform}: +rustPlatform.buildRustPackage { + pname = "river-mk-keymap"; + version = "0.1.0"; + + src = ./.; + cargoLock = { + lockFile = ./Cargo.lock; + }; + + meta = { + mainProgram = "river-mk-keymap"; + }; +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/cli.rs b/pkgs/by-name/ri/river-mk-keymap/src/cli.rs new file mode 100644 index 00000000..55b87e1a --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/cli.rs @@ -0,0 +1,11 @@ +use std::path::PathBuf; + +use clap::Parser; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +/// A tool to manage your key mappings for the river window manager +pub(super) struct Args { + /// Path to mappings JSON file + pub path: PathBuf, +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs b/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs new file mode 100644 index 00000000..a4ac0ebd --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs @@ -0,0 +1,109 @@ +use std::process::Command; + +use keymaps::key_repr::{KeyValue, MediaKeyCode, MouseKeyValue}; + +use super::{KeyMap, MapMode}; + +impl KeyMap { + #[must_use] + pub fn to_commands(self) -> Vec<Command> { + self.0 + .iter() + .flat_map(|(key, value)| { + let key = key.last().expect("Will exist"); + let mods = { + let modifiers = key.modifiers(); + let mut output = vec![]; + + if modifiers.alt() { + output.push("Alt"); + } + if modifiers.ctrl() { + output.push("Control"); + } + if modifiers.meta() { + output.push("Super"); + } + if modifiers.shift() { + output.push("Shift"); + } + if output.is_empty() { + "None".to_owned() + } else { + output.join("+") + } + }; + let key_value = match key.value() { + KeyValue::Backspace => "BackSpace".to_owned(), + KeyValue::Enter => "Enter".to_owned(), + KeyValue::Left => "Left".to_owned(), + KeyValue::Right => "Right".to_owned(), + KeyValue::Up => "Up".to_owned(), + KeyValue::Down => "Down".to_owned(), + KeyValue::Home => "Home".to_owned(), + KeyValue::End => "End".to_owned(), + KeyValue::PageUp => "Page_Up".to_owned(), + KeyValue::PageDown => "Page_Down".to_owned(), + KeyValue::Tab => "Tab".to_owned(), + KeyValue::BackTab => "BackTab".to_owned(), + KeyValue::Delete => "Delete".to_owned(), + KeyValue::Insert => "Insert".to_owned(), + KeyValue::F(num) => format!("F{num}"), + KeyValue::Char(a) => a.to_string(), + KeyValue::Null => "Null".to_owned(), + KeyValue::Esc => "Esc".to_owned(), + KeyValue::CapsLock => "CapsLock".to_owned(), + KeyValue::ScrollLock => "ScrollLock".to_owned(), + KeyValue::NumLock => "NumLock".to_owned(), + KeyValue::PrintScreen => "Print".to_owned(), + KeyValue::Pause => "Pause".to_owned(), + KeyValue::Menu => "Menu".to_owned(), + KeyValue::KeypadBegin => "KeypadBegin".to_owned(), + KeyValue::Media(media_key_code) => match media_key_code { + MediaKeyCode::Play => "XF86AudioPlay".to_owned(), + MediaKeyCode::Pause => "XF86AudioPause".to_owned(), + MediaKeyCode::PlayPause => "XF86AudioPlayPause".to_owned(), + MediaKeyCode::Reverse => "XF86AudioReverse".to_owned(), + MediaKeyCode::Stop => "XF86AudioStop".to_owned(), + MediaKeyCode::FastForward => "XF86AudioFastForward".to_owned(), + MediaKeyCode::Rewind => "XF86AudioRewind".to_owned(), + MediaKeyCode::TrackNext => "XF86AudioTrackNext".to_owned(), + MediaKeyCode::TrackPrevious => "XF86AudioTrackPrevious".to_owned(), + MediaKeyCode::Record => "XF86AudioRecord".to_owned(), + MediaKeyCode::LowerVolume => "XF86AudioLowerVolume".to_owned(), + MediaKeyCode::RaiseVolume => "XF86AudioRaiseVolume".to_owned(), + MediaKeyCode::MuteVolume => "XF86AudioMuteVolume".to_owned(), + }, + KeyValue::MouseKey(mouse_key_value) => match mouse_key_value { + MouseKeyValue::Left => "BTN_LEFT".to_owned(), + MouseKeyValue::Right => "BTN_RIGHT".to_owned(), + MouseKeyValue::Middle => "BTN_MIDDLE".to_owned(), + }, + _ => todo!(), + }; + + value + .modes + .iter() + .map(|mode| { + let mut riverctl = Command::new("riverctl"); + riverctl.args([value.map_mode.as_command(), mode, &mods, &key_value]); + + riverctl.args(value.command.iter().map(String::as_str)); + riverctl + }) + .collect::<Vec<_>>() + }) + .collect() + } +} + +impl MapMode { + pub(crate) fn as_command(self) -> &'static str { + match self { + MapMode::Map => "map", + MapMode::MapMouse => "map-pointer", + MapMode::Unmap => "unmap", + } + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs new file mode 100644 index 00000000..84a16c9d --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs @@ -0,0 +1,79 @@ +use std::{collections::HashMap, fmt::Display, ops::Deref, str::FromStr}; + +use anyhow::Context; +use keymaps::{key_repr::Key, map_tree::MapTrie}; +use serde::{Deserialize, Serialize}; + +pub mod commands; + +#[derive(Deserialize, Serialize, Debug)] +#[allow(clippy::module_name_repetitions)] +pub struct RawKeyMap(HashMap<Key, KeyConfig>); + +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq, PartialOrd)] +/// What values to use for: `riverctl <map_mode> <mode> <mods> <key> <command..>` +pub struct KeyConfig { + command: Vec<String>, + + #[serde(default = "default_mode")] + modes: Vec<String>, + + #[serde(default = "MapMode::default")] + map_mode: MapMode, +} + +impl FromStr for KeyMap { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result<Self, Self::Err> { + let raw: RawKeyMap = + serde_json::from_str(s).context("Failed to parse the keymap config file as json.")?; + let mut out = MapTrie::<KeyConfig>::new(); + for (key, value) in raw.0 { + out.insert(&[key], value.clone()) + .with_context(|| format!("Failed to insert mapping {key} -> {value}"))?; + } + + Ok(Self(out)) + } +} +impl Display for KeyConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(self.command.join(" ").as_str()) + } +} + +fn default_mode() -> Vec<String> { + vec!["normal".to_owned()] +} + +#[derive(Copy, Deserialize, Serialize, Debug, Clone, Default, PartialEq, PartialOrd)] +enum MapMode { + #[default] + Map, + MapMouse, + Unmap, +} + +impl Display for MapMode { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + <Self as std::fmt::Debug>::fmt(self, f) + } +} + +#[derive(Debug)] +pub struct KeyMap(MapTrie<KeyConfig>); + +impl Display for KeyMap { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } +} + +impl Deref for KeyMap { + type Target = MapTrie<KeyConfig>; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/main.rs b/pkgs/by-name/ri/river-mk-keymap/src/main.rs new file mode 100644 index 00000000..5cb99f74 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/main.rs @@ -0,0 +1,34 @@ +use std::fs; + +use anyhow::Context; +use clap::Parser; + +mod cli; +pub mod key_map; + +use crate::{cli::Args, key_map::KeyMap}; + +fn main() -> Result<(), anyhow::Error> { + let args = Args::parse(); + let keymap_file = fs::read_to_string(&args.path) + .with_context(|| format!("Failed to open keymap file at: '{}'.", args.path.display()))?; + + let keymap: KeyMap = keymap_file + .parse() + .with_context(|| format!("Failed to parse keymap file at: {}", args.path.display()))?; + + // println!("{keymap}"); + // println!("Commands:"); + for mut command in keymap.to_commands() { + // println!("Executing {command:?}"); + let status = command + .status() + .with_context(|| format!("Failed to run command: '{command:?}'"))?; + + if !status.success() { + eprintln!("Command ('{command:?}') returned with non zero exit code: {status}"); + } + } + + Ok(()) +} diff --git a/pkgs/by-name/ri/river-mk-keymap/update.sh b/pkgs/by-name/ri/river-mk-keymap/update.sh new file mode 100755 index 00000000..9268caf2 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/update.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +cargo update && cargo upgrade diff --git a/pkgs/by-name/ri/river-start/package.nix b/pkgs/by-name/ri/river-start/package.nix new file mode 100644 index 00000000..ab986708 --- /dev/null +++ b/pkgs/by-name/ri/river-start/package.nix @@ -0,0 +1,14 @@ +{ + writeShellApplication, + river, +}: +writeShellApplication { + name = "river-start"; + text = builtins.readFile ./river-start.sh; + runtimeInputs = [ + river + ]; + meta = { + mainProgram = "river-start"; + }; +} diff --git a/pkgs/by-name/ri/river-start/river-start.sh b/pkgs/by-name/ri/river-start/river-start.sh new file mode 100755 index 00000000..4587ff96 --- /dev/null +++ b/pkgs/by-name/ri/river-start/river-start.sh @@ -0,0 +1,10 @@ +#! /usr/bin/env sh + +# NOTE: Keep this in sync with the file from `base_init.sh` <2025-02-03> +RIVER_LOG_FILE="$HOME/.local/share/river/log" + +[ -d "$(dirname "$RIVER_LOG_FILE")" ] || mkdir --parents "$(dirname "$RIVER_LOG_FILE")" + +exec river -log-level info >"$RIVER_LOG_FILE" 2>&1 + +# vim: ft=sh diff --git a/pkgs/by-name/sc/screenshot_persistent/package.nix b/pkgs/by-name/sc/screenshot_persistent/package.nix index f79315a1..12bb3968 100644 --- a/pkgs/by-name/sc/screenshot_persistent/package.nix +++ b/pkgs/by-name/sc/screenshot_persistent/package.nix @@ -1,5 +1,5 @@ { - sysLib, + writeShellApplication, grim, slurp, alacritty, @@ -7,12 +7,10 @@ libnotify, lf, # TODO: add llp }: -sysLib.writeShellScript { +writeShellApplication { name = "screenshot_persistent"; - src = ./screenshot_persistent.sh; - generateCompletions = false; - keepPath = true; - dependencies = [ + text = builtins.readFile ./screenshot_persistent.sh; + runtimeInputs = [ grim slurp alacritty @@ -20,4 +18,7 @@ sysLib.writeShellScript { libnotify lf # TODO: add llp ]; + meta = { + mainProgram = "screenshot_persistent"; + }; } diff --git a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh index 4308b8d2..2bea69e3 100755 --- a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh +++ b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh @@ -1,10 +1,6 @@ -#! /usr/bin/env dash +# shellcheck shell=bash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# only generate a path (this could lead to a time-of-check/time-of-use bug) -tmp="$(mktmp --dry-run)" +tmp="$(mktemp)" if grim -g "$(slurp)" "$tmp"; then name="$(rofi -dmenu -p "Name of screenshot: " -l 0)" @@ -16,7 +12,7 @@ if grim -g "$(slurp)" "$tmp"; then done mv "$tmp" "$screen_shot_path" - alacritty -e lf -command ":{{ set sortby atime; set reverse!; }}" + alacritty --title "floating please" --command lf -command ":{{ set sortby atime; set reverse!; set info time; }}" "$screen_shot_path" fi # vim: ft=sh diff --git a/pkgs/by-name/st/stamp/stamp.sh b/pkgs/by-name/st/stamp/stamp.sh index 0fced956..0aa6c281 100755 --- a/pkgs/by-name/st/stamp/stamp.sh +++ b/pkgs/by-name/st/stamp/stamp.sh @@ -93,7 +93,7 @@ done for file in "$@"; do if [ -d "$file" ]; then - fd . "$file" --type file --hidden | while read -r path_file; do + fd . "$file" --type file --hidden --exclude '/.git/*' | while read -r path_file; do reuse_run "$path_file" done else diff --git a/pkgs/by-name/up/update-vim-plugins/flake.lock b/pkgs/by-name/up/update-vim-plugins/flake.lock index 33ed6941..7e7f8698 100644 --- a/pkgs/by-name/up/update-vim-plugins/flake.lock +++ b/pkgs/by-name/up/update-vim-plugins/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737885589, - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", + "lastModified": 1738142207, + "narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "rev": "9d3ae807ebd2981d593cddd0080856873139aa40", "type": "github" }, "original": { diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/update.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/update.py index 7eb3eeb4..b338d81d 100644 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/update.py +++ b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/update.py @@ -157,7 +157,7 @@ class UpdateCommand(Command): failed_but_known = None failed_plugin = None try: - debug_string += f" - <info>({i+1}/{size}) Processing</info> {spec!r}\n" + debug_string += f" - <info>({i + 1}/{size}) Processing</info> {spec!r}\n" vim_plugin = plugin_from_spec(spec) debug_string += f" • <comment>Success</comment> {vim_plugin!r}\n" processed_plugin = vim_plugin diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md b/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md index bc620f4e..230e6069 100644 --- a/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md +++ b/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md @@ -2,5 +2,5 @@ | Repo | Last Update | Nix package name | Last checked | |:---|:---|:---|:---| -| [lmburns/lf.nvim](https://github.com/lmburns/lf.nvim) | 2023-10-03 | `lf-nvim` | 2025-01-29 | -| [nvim-telescope/telescope-bibtex.nvim](https://github.com/nvim-telescope/telescope-bibtex.nvim) | 2024-03-28 | `telescope-bibtex-nvim` | 2025-01-29 | +| [lmburns/lf.nvim](https://github.com/lmburns/lf.nvim) | 2023-10-03 | `lf-nvim` | 2025-02-01 | +| [nvim-telescope/telescope-bibtex.nvim](https://github.com/nvim-telescope/telescope-bibtex.nvim) | 2024-03-28 | `telescope-bibtex-nvim` | 2025-02-01 | diff --git a/tests/by-name/nv/nvim-neorg/test.desc b/tests/by-name/nv/nvim-neorg/test.desc index bd7b7312..bd1e8f49 100644 --- a/tests/by-name/nv/nvim-neorg/test.desc +++ b/tests/by-name/nv/nvim-neorg/test.desc @@ -61,7 +61,7 @@ Sleep 0.5 Type 10t -Sleep 0.5 +Sleep 1.0 Expect ^11\s*◉ Some other content$ |