Compare commits
2 commits
40e434d6b9
...
9816ddd536
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9816ddd536 | ||
![]() |
c86e99d073 |
1
devel/g8
1
devel/g8
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
#dep:g8
|
||||||
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
G8=$(next-in-path g8 $0)
|
G8=$(next-in-path g8 $0)
|
||||||
|
|
||||||
|
|
51
misc/qrread
Executable file
51
misc/qrread
Executable file
|
@ -0,0 +1,51 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
#dep:flameshot zbarimg zenity
|
||||||
|
|
||||||
|
code_content=$(flameshot gui --accept-on-select --raw | zbarimg -1 --raw /dev/stdin)
|
||||||
|
|
||||||
|
zenity-ask-clip() {
|
||||||
|
local title="$1"
|
||||||
|
local text="$2"
|
||||||
|
shift 2
|
||||||
|
zenity --question --title "$title" \
|
||||||
|
--text="$text" \
|
||||||
|
--switch \
|
||||||
|
"$@" \
|
||||||
|
--extra-button "Copy to clipboard" \
|
||||||
|
--extra-button "Close"
|
||||||
|
}
|
||||||
|
|
||||||
|
handle-link() {
|
||||||
|
case $(zenity-ask-clip "Link detected" "$1" --extra-button "Open in browser") in
|
||||||
|
"Open in browser")
|
||||||
|
xdg-open $1
|
||||||
|
;;
|
||||||
|
"Copy to clipboard")
|
||||||
|
xclip -selection clipboard -i <(echo $1)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle-other() {
|
||||||
|
case $(zenity-ask-clip "Code contents" "$1") in
|
||||||
|
"Copy to clipboard")
|
||||||
|
xclip -selection clipboard -i <(echo $1)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
case $code_content in
|
||||||
|
http*)
|
||||||
|
handle-link $code_content
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
handle-other $code_content
|
||||||
|
;;
|
||||||
|
esac
|
4
xdg-wrappers/abcde
Executable file
4
xdg-wrappers/abcde
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
#dep:abcde
|
||||||
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
|
$(next-in-path abcde $0) -c ${XDG_CONFIG_HOME:-$HOME/.config}/abcde/abcde.conf $@
|
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
#dep:mbsync
|
||||||
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
$(next-in-path mbsync $0) -c ${XDG_CONFIG_HOME:-$HOME/.config}/mbsyncrc $@
|
$(next-in-path mbsync $0) -c ${XDG_CONFIG_HOME:-$HOME/.config}/mbsyncrc $@
|
||||||
|
|
4
xdg-wrappers/mvn
Executable file
4
xdg-wrappers/mvn
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
#dep:mvn
|
||||||
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
|
$(next-in-path mvn $0) -gs $XDG_CONFIG_HOME/maven/settings.xml $@
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
#dep:node
|
||||||
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history
|
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history
|
||||||
$(next-in-path node $0) $@
|
$(next-in-path node $0) $@
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
#dep:npm
|
||||||
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
|
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
|
||||||
$(next-in-path npm $0) $@
|
$(next-in-path npm $0) $@
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
#dep:rg
|
||||||
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
RIPGREP_CONFIG_PATH=${XDG_CONFIG_HOME:-$HOME/.config}/ripgreprc
|
RIPGREP_CONFIG_PATH=${XDG_CONFIG_HOME:-$HOME/.config}/ripgreprc
|
||||||
if [[ -e $RIPGREP_CONFIG_PATH ]]; then
|
if [[ -e $RIPGREP_CONFIG_PATH ]]; then
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
#dep:sbt
|
||||||
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
opts=(
|
opts=(
|
||||||
"-Dsbt.ivy.home=$XDG_CACHE_HOME/ivy"
|
"-Dsbt.ivy.home=$XDG_CACHE_HOME/ivy"
|
||||||
|
|
32
xdg-wrappers/steam
Executable file
32
xdg-wrappers/steam
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#dep:steam
|
||||||
|
|
||||||
|
FAKEHOME=${XDG_DATA_HOME:-$HOME/.local/share}/steam
|
||||||
|
echo "Starting Steam in faked home $FAKEHOME" >&2
|
||||||
|
|
||||||
|
# Symlink a file to the fake home
|
||||||
|
link_dir() {
|
||||||
|
# Replace HOME with FAKEHOME in the link name
|
||||||
|
link_name=$(echo $1 | sed "s|^$HOME|$FAKEHOME|")
|
||||||
|
|
||||||
|
# Creates the link's parent directory and symlinks it
|
||||||
|
mkdir -p $(dirname $link_name)
|
||||||
|
if [ ! -d $link_name ]; then
|
||||||
|
echo "Linking $link_name" >&2
|
||||||
|
ln -s $1 $link_name
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir -p $FAKEHOME
|
||||||
|
|
||||||
|
link_dir $XDG_DATA_HOME # ~/.local/share
|
||||||
|
link_dir $XDG_CACHE_HOME # ~/.cache
|
||||||
|
link_dir $XDG_CONFIG_HOME # ~/.config
|
||||||
|
|
||||||
|
# If .steam exists in ~/ and not in the fake home, move it to the fake home
|
||||||
|
if [ -d $HOME/.steam ] && [ ! -d $FAKEHOME/.steam ]; then
|
||||||
|
echo "migrating $HOME/.steam to $FAKEHOME" >&2
|
||||||
|
mv $HOME/.steam $FAKEHOME/
|
||||||
|
fi
|
||||||
|
export HOME=$FAKEHOME
|
||||||
|
exec /usr/bin/steam $@
|
4
xdg-wrappers/wget
Executable file
4
xdg-wrappers/wget
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
#dep:wget
|
||||||
|
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
|
||||||
|
$(next-in-path wget $0) --hsts-file="${XDG_DATA_HOME:-$HOME/.local/share}/wget-hsts" "$@"
|
Loading…
Reference in a new issue