diff --git a/todos.md b/todos.md index 42e62c5..54e5add 100644 --- a/todos.md +++ b/todos.md @@ -62,7 +62,7 @@ * [x] merge hosted docs into a single subdomain # desktop * [ ] transgui config -* [ ] xclip +* [x] xclip <-> wl-clipboard * [x] add a hidpi profile? https://wiki.archlinux.org/title/HiDPI * [ ] desktop entries - https://github.com/jakehamilton/config/blob/579827c699d9c78bd42e73f543eafb05a0d6c374/packages/hey/default.nix * [ ] https://github.com/jakehamilton/config/blob/579827c699d9c78bd42e73f543eafb05a0d6c374/packages/xdg-open-with-portal/default.nix - extend it to work over ssh diff --git a/users/pbsds/home/default.nix b/users/pbsds/home/default.nix index 0bf6219..7ba2331 100644 --- a/users/pbsds/home/default.nix +++ b/users/pbsds/home/default.nix @@ -5,6 +5,7 @@ home.stateVersion = "23.11"; imports = [ + ./profiles/bashrc.d #./profiles/sops.nix ./profiles/bat.nix #./profiles/xdg-ninja.nix @@ -34,12 +35,6 @@ nix run nixpkgs#atom -- --disable-gpu --in-process-gpu --no-sandbox "$@" } - if [[ -n "''${SSH_CLIENT-}" || -n "''${SSH_TTY-}" || -z "''${WAYLAND_DISPLAY-}" ]]; then - alias clip="xclip -sel clip -i -rmlastnl -t text/plain"; - else - alias clip="wl-copy --trim-newline --type text/plain"; - fi - nix-prefetch-sri() { url="$1"; shift nix hash to-sri --type sha256 "$@" "$(nix-prefetch-url "$url")" diff --git a/users/pbsds/home/profiles/bashrc.d/clipboard.sh b/users/pbsds/home/profiles/bashrc.d/clipboard.sh new file mode 100644 index 0000000..2cb35c5 --- /dev/null +++ b/users/pbsds/home/profiles/bashrc.d/clipboard.sh @@ -0,0 +1,12 @@ +if ! command -v wl-copy >/dev/null \ +|| [[ + -n "${SSH_CLIENT-}" || + -n "${SSH_TTY-}" || + -z "${WAYLAND_DISPLAY-}" || + "${XDG_SESSION_TYPE-}" != "wayland" +]] +then + alias clip="xclip -sel clip -i -rmlastnl -t text/plain"; +else + alias clip="wl-copy --trim-newline --type text/plain"; +fi diff --git a/users/pbsds/home/profiles/shell.nix b/users/pbsds/home/profiles/shell.nix index 1554ab1..56088de 100644 --- a/users/pbsds/home/profiles/shell.nix +++ b/users/pbsds/home/profiles/shell.nix @@ -47,10 +47,7 @@ in }; - imports = [ - ../profiles/bashrc.d - ../modules/jump.nix - ]; + imports = [ ../modules/jump.nix ]; programs.jump.enableBash = true; programs.nix-index.enable = true;