lots: shellcheck, streaming stuff, fixes
[distro-setup] / i3-sway / common.conf
index a658f3b218695581f1f89f36985f191d5eb41fdd..9e4cedcccf44836336889f260cf61d62c4a94a00 100644 (file)
@@ -1,12 +1,25 @@
 ####### DO NOT EDIT LIVE CONFIG. generated from /a/bin/distro-setup/i3-sway/gen #######
 
+# random thoughts: what to do with a window I don't have room for?
+# * I could tabify it
+# * I could split an existing window with it
+# * I could send it away to another workspace,
+# * I could resize it to be very small.
+
+
+# todo: think whether this is useful: https://github.com/tmfink/i3-wk-switch
+# todo: see comment by Jakstern551 here for tip about jumping to windows
+
 # https://i3wm.org/docs/userguide.html#keybindings
 #To get the current mapping of your keys, use xmodmap -pke. To
 #interactively enter a key and see what keysym it is configured to, use
 #xev.
 set $mod Mod4
 
-bindsym $mod+2 exec "pavucontrol"
+# for non-gui apps, use this.
+set $ex exec --no-startup-id
+
+bindsym $mod+2 $ex "/b/ds/i3-split-maybe"; exec "pavucontrol"
 # calling without -no-remote makes this to be the instance that links
 # will open in from other applications.
 bindsym $mod+3 exec "abrowser"
@@ -16,49 +29,59 @@ bindsym $mod+3 exec "abrowser"
 #bindsym $mod+3 exec "abrowser 2>&1 >/tmp/l"
 #bindsym $mod+3 exec "abrowser -no-remote -P sfw"
 bindsym $mod+4 exec "abrowser -no-remote -P firefox-main-profile"
-bindsym $mod+5 exec "/a/bin/ds/laptop-xrandr"
+# todo: figure out a stream delay & way to cut the stream.
+# settings, advanced, stream delay
+bindsym $mod+5 $ex "/a/bin/ds/obs-i3-interlude"
 bindsym $mod+6 exec "/usr/local/bin/start-tor-browser"
-#bindsym $mod+6 exec "/a/bin/redshift.sh"
-# bindsym $mod+equal exec "t s w; t in"
-# bindsym $mod+Home exec "t out"
-# #bindsym $mod+End exec "t s x; t in"
-# bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
+bindsym $mod+7 $ex "/a/bin/ds/laptop-xrandr"
+#bindsym $mod+6 $ex "/a/bin/redshift.sh"
+# bindsym $mod+equal $ex "t s w; t in"
+# bindsym $mod+Home $ex "t out"
+# #bindsym $mod+End $ex "t s x; t in"
+# bindsym $mod+grave $ex "t s lunch; t in; t out -a '45 minutes from now'"
 
 
 bindsym $mod+1 focus parent
-bindsym $mod+equal exec "dunstctl close-all"
+bindsym $mod+shift+1 focus child
+# undo split: https://github.com/i3/i3/issues/3808
+bindsym $mod+grave floating toggle; floating toggle
+bindsym $mod+equal $ex "dunstctl close-all"
 # move firefox to current workspace.
 # https://i3wm.org/docs/userguide.html#keybindings
 # get class with xprop, example output
 # WM_CLASS(STRING) = "irssi", "URxvt"
 # xprop |& grep WM_CLASS
-bindsym $mod+w [class="abrowser"] move workspace current
+bindsym $mod+w $ex i3-pull abrowser
+bindsym $mod+shift+w fullscreen toggle
 
-bindsym $mod+e fullscreen toggle
-bindsym $mod+r exec "/a/bin/ds/xl"
+bindsym $mod+e $ex i3-pull emacs
+bindsym $mod+shift+e unmark emacs; mark emacs
+bindsym $mod+r $ex "/a/bin/ds/xl"
 # todo, in newer i3, make this toggle split tabbed
-bindsym $mod+t layout toggle split
+bindsym $mod+t layout toggle splith splitv tabbed
 #bindsym $mod+Shift+t move workspace to output up
 bindsym $mod+Shift+t move workspace to output right
-bindsym $mod+g layout tabbed
+# there's a bug about this. it is not logical that there is no "split
+# tabbed", but you accomplish that by doing this.
+bindsym $mod+g split vertical, layout tabbed
+bindsym $mod+shift+g $ex "/b/ds/i3-auto-layout-toggle"
 
 # Use Mouse+$mod to drag floating windows to their wanted position
 floating_modifier $mod
 
-bindsym $mod+u focus left
-bindsym $mod+i focus right
-bindsym $mod+o focus up
-bindsym $mod+p focus down
+bindsym $mod+u focus left; $ex "i3-mouse-warp"
+bindsym $mod+i focus right; $ex "i3-mouse-warp"
+bindsym $mod+o focus up; $ex "i3-mouse-warp"
+bindsym $mod+p focus down; $ex "i3-mouse-warp"
 
-bindsym $mod+Left move left
-bindsym $mod+Right move right
-bindsym $mod+Up move up
-bindsym $mod+Down move down
+bindsym $mod+Left $ex "/a/exe/i3-maybe-double-move left"
+bindsym $mod+Right $ex "i3-maybe-double-move right"
+bindsym $mod+Up $ex "i3-maybe-double-move up"
+bindsym $mod+Down $ex "i3-maybe-double-move down"
 
-# switch to workspace
 bindsym $mod+Shift+a move container to workspace 4
 bindsym $mod+a workspace 4
-# move focused container to workspace
+
 bindsym $mod+Shift+s move container to workspace 3
 bindsym $mod+s workspace 3
 
@@ -78,13 +101,19 @@ bindsym $mod+x workspace 6
 # todo, in newer i3, make this split toggle
 bindsym $mod+v split vertical
 bindsym $mod+Shift+v split horizontal
+#
+## temp for testing, add antying here
+##bindsym $mod+shift+g
+bindsym $mod+b $ex i3-pull term
+bindsym $mod+shift+b unmark term; mark term
+# for use to cleanup extra emacs windows
 # https://faq.i3wm.org/question/7662/reverse-perl-matches-in-criteria-in-i3-config.1.html
 # I found their regex slightly wrong. This is a hacky way to
 # ignore my irc emacs instances, their window titles
 # are irc room names. Another way would be to hack on the
 # window title, or xprop stuff, but I figure I'm switching
 # to wayland soon, lets wait and see how things work there.
-bindsym $mod+b [class="Emacs" title="^(?!#[a-zA-Z][a-zA-Z-]*$)"] move workspace current
+bindsym $mod+shift+6 [class="Emacs" title="^(?!#[a-zA-Z][a-zA-Z-]*$)"] move workspace current
 
 bindsym $mod+c kill
 
@@ -99,32 +128,45 @@ bindsym $mod+8 workspace 9
 bindsym $mod+Shift+9 move container to workspace 10
 bindsym $mod+9 workspace 10
 
-b
-indsym $mod+Shift+m border toggle
+bindsym $mod+Shift+m border toggle
 
 # 65 = space.
-# toggle tiling / floating
-bindcode $mod+Shift+65 floating toggle
+# toggle tiling / floating.
+#
+# The idea here is: when floating a window, make it sticky and 1080p,
+# because the only reason we want to do this is to keep it on screen
+# when doing an obs broacast. When unfloating a window, just act as a
+# normal unfloat. There is a quirk with this: in a layout with 3 windows,
+# 2 stacked, 1 tall, floating and ufloating the tall one will make it
+# another stacked one, but still 1920x1080, you need to move it to the
+# right to get it back into its tall spot. I could automate this,
+# but I'm not bothering right now
+bindcode $mod+65 $ex obs-auto-scene-switch-toggle; floating toggle; sticky enable; resize set 1920 1080; move position 100 ppt 0 ppt
 
 # change focus between tiling / floating windows
-bindcode $mod+65 focus mode_toggle
+bindcode $mod+shift+65 focus mode_toggle
 # Use Mouse+$mod to drag floating windows to their wanted position
 floating_modifier $mod
 
-bindsym $mod+j exec emacsclient -c
-bindsym $mod+k exec konsole
-bindsym $mod+l exec dmenu_run
+bindsym $mod+shift+h $ex clip-hc
+bindsym $mod+j $ex emacsclient -c
+bindsym $mod+shift+j $ex clip-up
+bindsym $mod+k $ex konsole
+bindsym $mod+shift+k $ex mpv --profile=a /a/bin/data/clips/enter-in.flac
+bindsym $mod+l $ex dmenu_run
+bindsym $mod+shift+l $ex mpv --profile=a /a/bin/data/clips/tokyo-eye.flac
+bindsym $mod+shift+semicolon $ex clip-sad
 # note default is 27% on my system76. not sure if these
 # keybinds will screw up other laptop brightness keys.
-bindsym XF86MonBrightnessUp exec brightnessctl s +5%
-bindsym XF86MonBrightnessDown exec brightnessctl s 5%-
+bindsym XF86MonBrightnessUp $ex brightnessctl s +5%
+bindsym XF86MonBrightnessDown $ex brightnessctl s 5%-
 
 # Font for window titles. Will also be used by the bar unless a different font
 # is used in the bar {} block below.
-font pango:monospace 8
+font pango:monospace 7
 
 # todo: only available in newer i3n
-#hide_edge_borders smart
+hide_edge_borders vertical
 
 #exec --no-startup-id /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
 
@@ -133,10 +175,11 @@ font pango:monospace 8
 
 
 # shortcut to selection widget (primary)
-bindsym $mod+End exec /a/opt/clipster/clipster -sp
+bindsym $mod+End $ex /a/opt/clipster/clipster -sp
 
-# file:///usr/share/doc/i3-wm/userguide.html#_border_style_for_new_windows
-new_window none
+# title bars but no borders. i tried this out a bit
+#default_border normal 0
+default_border pixel 4
 
 # I dont see a way to make processing windows act like normal windows,
 # this does it.
@@ -148,3 +191,7 @@ new_window none
 
 # this is the processing window for my app named focus.
 for_window [class="focus" instance="focus"] floating disable
+
+client.focused          #4c7899 #285577 #ffffff #2e9ef4   #ff4400
+client.focused_inactive #333333 #5f676a #ffffff #484e50   #DBEEF4
+client.unfocused        #333333 #222222 #888888 #292d2e   #B8C8CD