Skip to content

Instantly share code, notes, and snippets.

@rfde
Last active January 19, 2016 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfde/936c8c815c223572ee9c to your computer and use it in GitHub Desktop.
Save rfde/936c8c815c223572ee9c to your computer and use it in GitHub Desktop.
#!/usr/bin/wish
# ====== .i3/config ======
# # monitor setup
# for_window [title="^qscr$"] floating enable
# exec --no-startup-id wish /home/ts/.screenlayout/startup.tcl
# # XF86Display = Fn+F7 (@Lenovo T440p)
# bindsym XF86Display exec --no-startup-id wish /home/ts/.screenlayout/startup.tcl
# ========================
# Buttons
button .screen1 \
-bg #aaaaaa \
-text "\[1\] (1024x768 + 1920x1080 + 1600x900)" -width 50 \
-command { exec /bin/sh /home/ts/.screenlayout/a.sh &; exit }
place .screen1 -x 5 -y 5
button .screen2 \
-bg #aaaaaa \
-text "\[2\] (1920x1200 + 1600x900)" -width 50 \
-command { exec /bin/sh /home/ts/.screenlayout/b.sh &; exit }
place .screen2 -x 5 -y 45
button .screen3 \
-bg #aaaaaa \
-text "\[3\] (1680x1050 + 1920x1200 + 1600x900)" -width 50 \
-command { exec /bin/sh /home/ts/.screenlayout/c.sh &; exit }
place .screen3 -x 5 -y 85
button .screenMobile \
-bg #aaaaaa \
-text "\[4\] Mobile (1600x900)" -width 50 \
-command { exec /bin/sh /home/ts/.screenlayout/mobile.sh &; exit }
place .screenMobile -x 5 -y 125
button .screenProjector \
-bg #aaaaaa \
-text "\[5\] Projector (1024x768, mirror to VGA)" -width 50 \
-command { exec /bin/sh /home/ts/.screenlayout/projector.sh &; exit }
place .screenProjector -x 5 -y 165
button .arandr \
-fg #fff -bg #005555 -activebackground #00aaaa -activeforeground #fff \
-text "\[6\] ARandr" -width 10 \
-command { exec arandr &; exit }
place .arandr -x 5 -y 215
button .quit \
-fg #fff -bg #002222 -activebackground #004444 -activeforeground #fff \
-text "\[Return\] Quit" -width 35 \
-command { exit }
place .quit -x 125 -y 215
# Key bindings
bind . 1 ".screen1 invoke"
bind . <Key-KP_1> ".screen1 invoke"
bind . 2 ".screen2 invoke"
bind . <Key-KP_2> ".screen2 invoke"
bind . 3 ".screen3 invoke"
bind . <Key-KP_3> ".screen3 invoke"
bind . 4 ".screenMobile invoke"
bind . <Key-KP_4> ".screenMobile invoke"
bind . 5 ".screenProjector invoke"
bind . <Key-KP_5> ".screenProjector invoke"
bind . 6 ".arandr invoke"
bind . <Key-KP_6> ".arandr invoke"
bind . <Return> ".quit invoke"
bind . <Key-KP_Enter> ".quit invoke"
# Window
wm title . "qscr"
wm geometry . 439x250+300+300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment