{"id":1546,"date":"2014-01-06T22:13:04","date_gmt":"2014-01-06T21:13:04","guid":{"rendered":"http:\/\/www.daniel-ritter.de\/blog\/?p=1546"},"modified":"2014-01-06T22:13:04","modified_gmt":"2014-01-06T21:13:04","slug":"monitorswitcher-mit-yad-und-xrandr","status":"publish","type":"post","link":"https:\/\/www.daniel-ritter.de\/blog\/monitorswitcher-mit-yad-und-xrandr\/","title":{"rendered":"Monitorswitcher mit YAD und xrandr"},"content":{"rendered":"<p><a href=\"https:\/\/www.daniel-ritter.de\/blog\/wp-content\/uploads\/2014\/01\/yad_monitor_chooser.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.daniel-ritter.de\/blog\/wp-content\/uploads\/2014\/01\/yad_monitor_chooser.jpg\" alt=\"yad_monitor_chooser\" width=\"438\" height=\"82\" class=\"alignleft size-full wp-image-1547\" srcset=\"https:\/\/www.daniel-ritter.de\/blog\/wp-content\/uploads\/2014\/01\/yad_monitor_chooser.jpg 438w, https:\/\/www.daniel-ritter.de\/blog\/wp-content\/uploads\/2014\/01\/yad_monitor_chooser-300x56.jpg 300w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><\/a><br \/>\nDa ich h\u00e4ufiger mal den Video-Output von meinem Notebook \u00e4ndern muss, habe ich ein kleines Script geschrieben, das mir die Aufgabe erheblich erleichtert. Ich habe mir das Script auf einen Keyboard-Shortcut gelegt und kann so in Sekundenschnelle die gew\u00fcnschte Anzeige w\u00e4hlen. F\u00fcr das grafische Interface benutze ich YAD, zur eigentlichen Einstellung des Outputs xrandr.<\/p>\n<p>\n<pre>\r\n#!\/bin\/bash\r\n\r\naction=$(yad --width 300 --title \"OUTPUT\" \\\r\n    --button=\"Monitor + Notebook :1\" \\\r\n    --button=\"Notebook:2\" \\\r\n    --button=\"Monitor:3\" \\\r\n    --button=\"TV MODE:4\")\r\n\r\nret=$?\r\n\r\n# Notebook + Monitor\r\nif [[ $ret -eq 1 ]]; then\r\nxrandr --output LVDS1 --mode 1366x768  --output DP1 --mode 1920x1200 --left-of LVDS1 --primary --output VGA1 --off\r\nfi\r\n\r\n# Notebook Only \r\nif [[ $ret -eq 2 ]]; then\r\nxrandr --output LVDS1 --mode 1366x768  --output VGA1  --off --output DP1 --off\r\nfi\r\n\r\n# Monitor Only\r\nif [[ $ret -eq 3 ]]; then\r\nxrandr --output DP1 --mode 1920x1200 --primary --output VGA1 --off --output LVDS1 --off\r\nfi\r\n\r\n# TV MODE (Monitor  + TV)\r\nif [[ $ret -eq 4 ]]; then\r\nxrandr --output DP1 --mode 1920x1200 --right-of VGA1 --primary --output VGA1 --mode 1920x1080 --output LVDS1 --off\r\nfi\r\n\r\nexit 0\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Da ich h\u00e4ufiger mal den Video-Output von meinem Notebook \u00e4ndern muss, habe ich ein kleines Script geschrieben, das mir die Aufgabe erheblich erleichtert. Ich habe mir das Script auf einen Keyboard-Shortcut gelegt und kann so in Sekundenschnelle die gew\u00fcnschte Anzeige w\u00e4hlen. F\u00fcr das grafische Interface benutze ich YAD, zur eigentlichen Einstellung des Outputs xrandr. #!\/bin\/bash [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1546","post","type-post","status-publish","format-standard","hentry","category-diesunddas"],"_links":{"self":[{"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/posts\/1546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/comments?post=1546"}],"version-history":[{"count":5,"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/posts\/1546\/revisions"}],"predecessor-version":[{"id":1552,"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/posts\/1546\/revisions\/1552"}],"wp:attachment":[{"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/media?parent=1546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/categories?post=1546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.daniel-ritter.de\/blog\/wp-json\/wp\/v2\/tags?post=1546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}