This commit is contained in:
2023-07-05 19:03:09 +02:00
parent 75ff8ce942
commit b2552d9d1d
2 changed files with 25 additions and 42 deletions

View File

@@ -1,69 +1,37 @@
#!/bin/bash #!/bin/bash
interno=eDP interno=eDP
externo=HDMI-A-0 externo=HDMI-A-0
externo2=DisplayPort-0
eleccion=""
#Todo mal pero tremendo palo cambiarlo: #Todo mal pero tremendo palo cambiarlo:
# ejecutar un solo randr con variables # ejecutar un solo randr con variables
# modificar las variables en función de la entrada # modificar las variables en función de la entrada
# igual renta sacar las opciones del propio xrandr usando awk y grep # igual renta sacar las opciones del propio xrandr usando awk y grep
if xrandr | grep "$externo connected" && xrandr | grep "$externo2 connected"; then if xrandr | grep "$externo connected"; then
eleccion="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'System' -width 12 -line-padding 3 -lines 3 -theme /home/danih/Scripts/rofi/monitor.rasi <<< "Una|Dos|Tres")"
case "$eleccion" in
Dos)
xrandr --output "$interno" --off --output "$externo2" --above "$interno" --auto --output "$externo" --auto --rotate left --right-of "$externo2"
;;
Tres)
xrandr --output "$interno" --auto --output "$externo2" --above "$interno" --auto --output "$externo" --auto --right-of "$externo2"
;;
Una)
xrandr --output "$externo" --off --output "$externo2" --off --output "$interno" --auto
;;
esac
elif xrandr | grep "$externo connected"; then
eleccion="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'System' -width 12 -line-padding 3 -lines 6 -theme /home/danih/Scripts/rofi/monitor.rasi <<< "Dual Side|Dual Top|Dual Side Vertical|Dual Side Low|Interna|Externa|Duplicar")" eleccion="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'System' -width 12 -line-padding 3 -lines 6 -theme /home/danih/Scripts/rofi/monitor.rasi <<< "Dual Side|Dual Top|Dual Side Vertical|Dual Side Low|Interna|Externa|Duplicar")"
case "$eleccion" in case "$eleccion" in
"Dual Top") "Dual Top")
xrandr --output "$interno" --auto --mode 1920x1080 --output "$externo" --auto --above "$interno" --output "$externo2" --off xrandr --output "$interno" --auto --mode 1920x1080 --output "$externo" --auto --above "$interno" --output "$externo2" --off
;; ;;
"Dual Side") "Dual Side")
xrandr --output HDMI-A-0 --primary --mode 1920x1080 --rate 60 --pos 1920x0 --rotate normal --output eDP --mode 1920x1080 --rate 60 --pos 0x600 --rotate normal --output DisplayPort-0 --off --output DisplayPort-1 --off xrandr --output HDMI-A-0 --primary --mode 1920x1080 --rate 60 --pos 1920x0 --rotate normal --output eDP --mode 1920x1080 --rate 60 --pos 0x600 --rotate normal
;; ;;
"Dual Side Low") "Dual Side Low")
xrandr --output HDMI-A-0 --mode 1600x900 --pos 1920x0 --rotate normal --output eDP --primary --mode 1920x1080 --rate 60 --pos 0x315 --rotate normal --output DisplayPort-0 --off --output DisplayPort-1 --off xrandr --output HDMI-A-0 --mode 1600x900 --pos 0x0 --rotate normal --output eDP --primary --mode 1920x1080 --rate 60 --pos 0x1080 --rotate normal
;; ;;
"Dual Side Vertical") "Dual Side Vertical")
xrandr --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate right --output eDP --primary --mode 1920x1080 --pos 1080x1762 --rotate normal --output DisplayPort-0 --off --output DisplayPort-1 --off xrandr --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate right --output eDP --primary --mode 1920x1080 --pos 1080x1762 --rotate normal
;; ;;
Duplicar) Duplicar)
xrandr --output "$interno" --auto --output "$externo" --same-as "$interno" --output "$externo2" --off xrandr --output "$interno" --auto --output "$externo" --same-as "$interno"
;; ;;
Externa) Externa)
xrandr --output "$interno" --auto --output "$externo" --auto --above "$interno" --output "$externo2" --off xrandr --output "$interno" --auto --output "$externo" --auto --above "$interno" --output "$externo2" --off
xrandr --output "$externo" --mode 1920x1080 --rate 144 --output "$interno" --off --output "$externo2" --off xrandr --output "$externo" --mode 1920x1080 --rate 144 --output "$interno" --off
;; ;;
Interna) Interna)
xrandr --output "$externo" --off --output "$externo2" --off --output "$interno" --auto xrandr --output "$externo" --off --output "$interno" --auto
;; ;;
esac esac
elif xrandr | grep "$externo2 connected"; then
eleccion="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'System' -width 12 -line-padding 3 -lines 4 -theme /home/danih/Scripts/rofi/monitor.rasi <<< "Dual|Interna|Externa|Duplicar")"
case "$eleccion" in
Dual)
xrandr --output "$interno" --auto --primary --output "$externo2" --above "$interno" --auto --output "$externo" --off
;;
Duplicar)
xrandr --output "$interno" --auto --output "$externo2" --same-as "$interno" --output "$externo" --off
;;
Externa)
xrandr --output "$interno" --auto --primary --output "$externo2" --above "$interno" --auto --output "$externo" --off
xrandr --output "$externo2" --output "$interno" --off --output "$externo" --off
;;
Interna)
xrandr --output "$externo" --off --output "$externo2" --off --output "$interno" --auto
;;
esac
else else
xrandr --output "$externo" --off --output "$externo2" --off --output "$interno" --auto xrandr --output "$externo" --off --output "$externo2" --off --output "$interno" --auto
fi fi

View File

@@ -5,7 +5,22 @@ then
exit 1 exit 1
fi fi
dir=$(pwd) dir=$(pwd)
pdflatex "$dir/$2"
bibtex "$dir/${2%.*}"
pdflatex "$dir/$2"
pdflatex "$dir/$2"
mv "$dir/${2%.*}.aux" "$dir/$1/"
mv "$dir/${2%.*}.log" "$dir/$1/"
mv "$dir/${2%.*}.out" "$dir/$1/"
mv "$dir/${2%.*}.toc" "$dir/$1/"
mv "$dir/${2%.*}.lot" "$dir/$1/"
mv "$dir/${2%.*}.lof" "$dir/$1/"
echo "$dir/${2%.*}"
#pdflatex --output-directory="$dir/$1" "$dir/$2" #pdflatex --output-directory="$dir/$1" "$dir/$2"
xelatex --output-directory="$dir/$1" "$dir/$2" #bibtex "$dir/$1/${2%.*}"
pdf=$(echo $2 | awk -F'.tex' '{print $1}') #pdflatex --output-directory="$dir/$1" "$dir/$2"
mv "$dir/$1/$pdf.pdf" "$dir/" #pdflatex --output-directory="$dir/$1" "$dir/$2"
#pdf=$(echo $2 | awk -F'.tex' '{print $1}')
#mv "$dir/$1/$pdf.pdf" "$dir/"