feat(display): new edit subcommand to edit script from anywhere; move display IDs to config

This commit is contained in:
ayo 2026-03-07 08:15:49 +01:00
parent f4d6a64b98
commit 137f143f18
2 changed files with 22 additions and 15 deletions

View file

@ -6,13 +6,16 @@
#. ${HOME}/ayo.conf #. ${HOME}/ayo.conf
#. ${scripts_dir}/functions.sh #. ${scripts_dir}/functions.sh
intern=eDP-1-1
extern=HDMI-1
command=$2 command=$2
function main() { function main() {
case $command in case $command in
# 0: +*DP-1-1 2560/798x1080/334+0+0 DP-1-1
# 1: +HDMI-1 1920/521x1080/293+2560+0 HDMI-1
"edit")
vim "${scripts_dir}/display.sh"
;;
"hybrid") "hybrid")
sudo system76-power graphics hybrid sudo system76-power graphics hybrid
sudo reboot sudo reboot
@ -23,11 +26,11 @@ function main() {
;; ;;
"big") "big")
echo "Setting display to big mode (1920x1200)" echo "Setting display to big mode (1920x1200)"
xrandr --output "$intern" --mode 1920x1200 xrandr --output "$secondary" --mode 1920x1200
;; ;;
"small") "small")
echo "Setting display to small mode (1280x800)" echo "Setting display to small mode (1280x800)"
xrandr --output "$intern" --mode 1280x800 xrandr --output "$secondary" --mode 1280x800
;; ;;
"list") "list")
echo "Listing all monitors" echo "Listing all monitors"
@ -35,32 +38,32 @@ function main() {
;; ;;
"dual"|"right") "dual"|"right")
echo "Setting dual display right" echo "Setting dual display right"
xrandr --output "$extern" --primary --auto --left-of "$intern" --output "$intern" --mode 1680x1050 xrandr --output "$main" --primary --auto --left-of "$secondary" --output "$secondary"
;; ;;
"left") "left")
echo "Setting dual display left" echo "Setting dual display left"
xrandr --output "$extern" --primary --auto --right-of "$intern" --output "$intern" --mode 1680x1050 xrandr --output "$main" --primary --auto --right-of "$secondary" --output "$secondary"
;; ;;
"center"|"middle") "center"|"middle")
echo "Setting dual display center" echo "Setting dual display center"
xrandr \ xrandr \
--output "$extern" --auto --above "$intern" \ --output "$main" --auto --above "$secondary" \
--output "$intern" --primary --mode 1680x1050 --output "$secondary" --primary --mode 1680x1050
;; ;;
"ultra") "ultra")
echo "Setting single display mode (ultrawide)" echo "Setting single display mode (ultrawide)"
xrandr --output "$intern" --off \ xrandr --output "$secondary" --off \
--output "$extern" --auto --output "$main" --auto
--mode 3840x2160 --mode 3840x2160
;; ;;
"solo") "solo")
echo "Setting single display mode (internal only)" echo "Setting single display mode (secondaryal only)"
xrandr --output "$extern" --off \ xrandr --output "$main" --off \
--output "$intern" --auto --output "$secondary" --auto
;; ;;
*) *)
echo "Setting display to preferred size (1680x1050)" echo "Setting display to preferred size (1680x1050)"
xrandr --output "$intern" --output "$intern" --mode 1680x1050 xrandr --output "$secondary" --output "$secondary" --mode 1680x1050
;; ;;
esac esac
return 0 return 0

View file

@ -14,3 +14,7 @@ search_modelfile="${HOME}/path-to/Modelfile-researcher"
helper="assistant:helper" helper="assistant:helper"
helper_modelfile="${HOME}/path-to/Modelfile-helper" helper_modelfile="${HOME}/path-to/Modelfile-helper"
# display monitors (run `yo d list` to find available)
secondary=HDMI-1
main=DP-1-1