(scripts) minor changes

This commit is contained in:
qvalentin 2021-12-19 14:57:13 +01:00
parent 6ce7df00d1
commit 332b24720d
4 changed files with 66 additions and 2 deletions

View File

@ -37,13 +37,19 @@ fi
echo $PATH_TO_IMG echo $PATH_TO_IMG
# overwrite .Xresources file # overwrite .Xresources file
cat ~/.cache/wal/colors.Xresources > ~/.Xresources cat ~/.cache/wal/colors.Xresources > ~/.Xresources
echo "\nXcursor.theme: Breeze" >> ~./Xresources echo "Xcursor.theme: Breeze" >> ~/.Xresources
#echo "*.alpha: 0.20" >> ~/.Xresources
# merge it into xrdb # merge it into xrdb
xrdb -merge ~/.Xresources xrdb -merge ~/.Xresources
#emacsclient -e '(my-load-xresources)'
cat >> ~/.cache/wal/colors-rofi-dark.rasi<< EOF
element-text, element-icon {
background-color: inherit;
text-color: inherit;
}
EOF
xmobar_change xmobar_change
killall xmobar killall xmobar

51
.scripts/dmenu-with-suggestions Executable file
View File

@ -0,0 +1,51 @@
#!/bin/sh
. "${HOME}/.cache/wal/colors.sh"
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
cache=$cachedir/dmenu_run
historyfile=$cachedir/dmenu_history
else # if no xdg dir, fall back to dotfiles in ~
cache=$HOME/.dmenu_cache
historyfile=$HOME/.dmenu_history
fi
IFS=:
if stest -dqr -n "$cache" $PATH; then
stest -flx $PATH | sort -u > "$cache"
fi
unset IFS
awk -v histfile=$historyfile '
BEGIN {
while( (getline < histfile) > 0 ) {
sub("^[0-9]+\t","")
print
x[$0]=1
}
} !x[$0]++ ' "$cache" \
| dmenu -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15" "$@" \
| awk -v histfile=$historyfile '
BEGIN {
FS=OFS="\t"
while ( (getline < histfile) > 0 ) {
count=$1
sub("^[0-9]+\t","")
fname=$0
history[fname]=count
}
close(histfile)
}
{
history[$0]++
print
}
END {
if(!NR) exit
for (f in history)
print history[f],f | "sort -t '\t' -k1rn >" histfile
}
' \
| while read cmd; do ${SHELL:-"/bin/sh"} -c "$cmd" & done

View File

@ -11,3 +11,5 @@ if [ "$current" = $headphone ]; then
else else
pactl set-default-sink $headphone pactl set-default-sink $headphone
fi fi
pkill xmobar && xmobar&

5
.scripts/zathuraSynctexVsCode Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
zathura $@
vscodium --reuse-window