diff --git a/home/.bashrc-bloated b/home/.bashrc-bloated index 30921e3..daea8c5 100644 --- a/home/.bashrc-bloated +++ b/home/.bashrc-bloated @@ -674,6 +674,16 @@ if [ ! -f "$BASH_COMPLETION_USER_DIR/plugins/forgit.plugin.bash" ]; then fi source $BASH_COMPLETION_USER_DIR/plugins/forgit.plugin.sh +if [ "$XDG_SESSION_TYPE" = "wayland" ]; then + export FORGIT_COPY_CMD="wl-copy" +elif [ "$XDG_SESSION_TYPE" = "x11" ]; then + if command -v xclip >/dev/null; then + export FORGIT_COPY_CMD="xclip -selection clipboard" + else + export FORGIT_COPY_CMD="xsel -i -b" + fi +fi + # If I don't want starship # source $BASH_COMPLETION_USER_DIR/plugins/prompt.bash diff --git a/home/.config/fish/conf.d/env.fish b/home/.config/fish/conf.d/env.fish index 1926124..3f3fd4f 100644 --- a/home/.config/fish/conf.d/env.fish +++ b/home/.config/fish/conf.d/env.fish @@ -100,6 +100,16 @@ set -gx _ZO_RESOLVE_SYMLINKS 1 # set -gx _ZL_INT_SORT 1 # set -gx _ZL_ROOT_MARKERS ".git,.svn,.hg,.root,package.json,.projectile,.pro" # set -gx RANGER_ZLUA $HOME/.config/fish/z.lua +# forgit +if test $XDG_SESSION_TYPE = "wayland" + set -gx FORGIT_COPY_CMD wl-copy +else if test $XDG_SESSION_TYPE = "x11" + if command -v xclip >/dev/null + set -gx FORGIT_COPY_CMD "xclip -selection clipboard" + else + set -gx FORGIT_COPY_CMD "xsel -i -b" + end +end # nnn if command -v nnn >/dev/null set -gx TERMINAL alacritty diff --git a/home/.config/zsh/.zshenv b/home/.config/zsh/.zshenv index ac7d36f..5920c87 100644 --- a/home/.config/zsh/.zshenv +++ b/home/.config/zsh/.zshenv @@ -386,6 +386,16 @@ export ZSH_AUTOSUGGEST_USE_ASYNC=1 export ABBR_USER_ABBREVIATIONS_FILE="$HOME/.local/share/zsh/abbreviations" # gencomp export GENCOMP_DIR=$XDG_DATA_HOME/zsh/completions +# forgit +if [ "$XDG_SESSION_TYPE" = "wayland" ]; then + export FORGIT_COPY_CMD="wl-copy" +elif [ "$XDG_SESSION_TYPE" = "x11" ]; then + if command -v xclip >/dev/null; then + export FORGIT_COPY_CMD="xclip -selection clipboard" + else + export FORGIT_COPY_CMD="xsel -i -b" + fi +fi # PATH typeset -U PATH path diff --git a/setup/Anime4K.sh b/setup/Anime4K.sh index c430b44..bfe6c28 100755 --- a/setup/Anime4K.sh +++ b/setup/Anime4K.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e echo "Number of make jobs: " | tr -d '\n' # 4 read -r mj @@ -6,7 +6,7 @@ read -r mj # ------------------ Anime4KCPP -------------------------- # # Need cmake, libopencv4-devel, ocl-icd-devel, libgomp-devel git clone https://github.com/TianZerl/Anime4KCPP.git -cd Anime4KCPP || exit 1 +cd Anime4KCPP mkdir build && cd build cmake .. make -j${mj} @@ -30,7 +30,7 @@ cp -rfv shaders ~/.local/bin/Anime4K-PyWrapper/ # ----------------- waifu2x-converter-cpp ---------------- # # Need opencv4 (binary), ocl-icd-devel, cmake (and cuda if using Nvidia) git clone https://github.com/DeadSix27/waifu2x-converter-cpp -cd waifu2x-converter-cpp || exit 1 +cd waifu2x-converter-cpp mkdir build && cd build cmake .. make -j${mj} diff --git a/setup/afetch.sh b/setup/afetch.sh index a79b1d8..e9232a7 100755 --- a/setup/afetch.sh +++ b/setup/afetch.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/sh -e git clone https://github.com/13-CF/afetch -cd afetch || exit 1 +cd afetch # Display colors sed -i '13s/false/true/' src/config.h diff --git a/setup/bsp-layout.sh b/setup/bsp-layout.sh index ce1b09e..d14a885 100755 --- a/setup/bsp-layout.sh +++ b/setup/bsp-layout.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/sh -e git clone https://github.com/phenax/bsp-layout.git -cd bsp-layout || exit +cd bsp-layout if command -v doas >/dev/null then diff --git a/setup/cbonsai.sh b/setup/cbonsai.sh index 519f92d..ba490bd 100755 --- a/setup/cbonsai.sh +++ b/setup/cbonsai.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/sh -e # You need ncurses-devel git clone https://gitlab.com/jallbrit/cbonsai -cd cbonsai || exit +cd cbonsai make PREFIX=$HOME/.local install diff --git a/setup/lua-language-server.sh b/setup/lua-language-server.sh index 26257e5..81aa8eb 100755 --- a/setup/lua-language-server.sh +++ b/setup/lua-language-server.sh @@ -1,13 +1,13 @@ -#!/bin/sh +#!/bin/sh -e # clone the repo git clone https://github.com/sumneko/lua-language-server.git -cd lua-language-server || exit +cd lua-language-server git submodule update --init --recursive # build # You need `ninja` -cd 3rd/luamake || exit +cd 3rd/luamake ninja -f ninja/linux.ninja cd ../.. ./3rd/luamake/luamake rebuild diff --git a/setup/mpvpaper.sh b/setup/mpvpaper.sh index 67d8a32..c539610 100755 --- a/setup/mpvpaper.sh +++ b/setup/mpvpaper.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/sh -e # You need mpv-devel, meson, ninja, pkg-config git clone https://github.com/GhostNaN/mpvpaper -cd mpvpaper || exit +cd mpvpaper meson build --prefix=/usr if command -v doas >/dev/null diff --git a/setup/nnn.sh b/setup/nnn.sh index 7b59e3e..4cbd513 100755 --- a/setup/nnn.sh +++ b/setup/nnn.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/sh -e git clone https://github.com/FollieHiyuki/nnn.git -cd nnn || exit 1 +cd nnn if command -v doas >/dev/null then diff --git a/setup/river.sh b/setup/river.sh index 79f0f43..d8b8ce6 100755 --- a/setup/river.sh +++ b/setup/river.sh @@ -1,9 +1,8 @@ -#!/bin/sh +#!/bin/sh -e # Need wlroots-devel to build - git clone https://github.com/ifreund/river.git -cd river || exit +cd river echo "Initialize submodules" git submodule update --init diff --git a/setup/tt.sh b/setup/tt.sh index 4edb98c..d07c011 100755 --- a/setup/tt.sh +++ b/setup/tt.sh @@ -1,9 +1,8 @@ -#!/bin/sh +#!/bin/sh -e # You need ncurses-devel - git clone https://github.com/runrin/tt.git -cd tt || exit +cd tt make chmod 755 tt diff --git a/setup/wayland-logout.sh b/setup/wayland-logout.sh index 6365937..3687dba 100755 --- a/setup/wayland-logout.sh +++ b/setup/wayland-logout.sh @@ -1,7 +1,9 @@ -#!/bin/sh +#!/bin/sh -e + +set -e git clone https://github.com/soreau/wayland-logout.git -cd wayland-logout || exit +cd wayland-logout echo "Build wayland-logout" meson build --prefix /usr