First commit. Add .i3 directory
This commit is contained in:
24
.i3/lemonbar/set_bg.sh
Normal file
24
.i3/lemonbar/set_bg.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
function get_index(){
|
||||
for i in "${!xra_out[@]}"; do
|
||||
if [[ "${xra_out[$i]}" = "$value" ]]; then
|
||||
echo "${i}";
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
xra_out=($(xrandr | grep ' connected' | awk '{print $1}'))
|
||||
in=($@)
|
||||
for i in `seq 0 2 ${#in[@]}`; do
|
||||
value="${in[$i]}"
|
||||
idx=$(get_index)
|
||||
if [ ! -z "$idx" ]; then
|
||||
screen_idx="$idx"
|
||||
#"${xra_out[$idx-1]}"
|
||||
paths[${screen_idx%:}]="--bg-scale ${in[$i+1]}"
|
||||
fi
|
||||
done
|
||||
#echo "${paths[@]}"
|
||||
str=`printf -v var "%s\n" "${System[@]}"`
|
||||
sh -c "feh ${paths[@]}"
|
||||
Reference in New Issue
Block a user