moved all desktop utils into this repo
This commit is contained in:
parent
cd7e93374e
commit
2241d30a86
28 changed files with 151 additions and 45 deletions
40
ewwScripts/monitors.sh
Executable file
40
ewwScripts/monitors.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
|
||||
unset id name horizontal vertical scale activeWorkspace
|
||||
|
||||
i=0
|
||||
|
||||
while read -r k n h v s t; do
|
||||
id[i]="$k"
|
||||
name[i]="$n"
|
||||
horizontal[i]="$h"
|
||||
vertical[i]="$v"
|
||||
scale[i]="$s"
|
||||
if [[ $((t%2)) == 1 ]]; then
|
||||
temp=${vertical[$i]}
|
||||
vertical[i]=${horizontal[$i]}
|
||||
horizontal[i]=$temp
|
||||
fi
|
||||
((i=i+1))
|
||||
done < <(hyprctl monitors -j | jq -r '.[]|"\(.id) \(.name) \(.width) \(.height) \(.scale) \(.transform)"')
|
||||
|
||||
echo -n "" > "$XDG_CONFIG_HOME"/eww/bar.yuck
|
||||
|
||||
eww close-all
|
||||
|
||||
sleep 2
|
||||
|
||||
for ((i = 0; i < ${#id[@]}; i++)); do
|
||||
scale_value=$(echo "${scale[$i]}" | bc -l)
|
||||
|
||||
new_width_float=$(echo "(${horizontal[$i]} / ${scale_value}) -10" | bc)
|
||||
|
||||
new_width=$(echo "$new_width_float / 1" | bc)
|
||||
|
||||
monitorID=$(xrandr --listactivemonitors | grep +"${name[$i]}" | awk '{sub(/.$/,"",$1); print $1}')
|
||||
|
||||
eww open bar --id bar"${monitorID}" --arg monitor="${monitorID}" --arg width="${new_width}" --arg height=30
|
||||
sleep 2
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue