setup: use sh -e; forgit: add clipboard env var

This commit is contained in:
Hoang Nguyen 2021-05-03 04:09:07 +03:00
parent 8688bd5364
commit 0423ec56e6
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
13 changed files with 54 additions and 24 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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