The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.

# Scripting a floating window

I am struggling a little with alsamixer, have a small script that I can run from dmenu

  $TERMINAL --command="alsamixer" i3-msg floating enable i3-msg move absolute position center  It does work but not how I wanted it, need a terminal window to open in the middle of workspace free form tiling [floating] Or would it be easier with a simple key bind? edit retag close merge delete ## 2 answers Sort by » oldest newest most voted It’s a better idea to launch your terminal with a property that you can identify in the i3 config, like so: i3-msg exec urxvt -name alsamixer  Then, in your i3 config, place the commands you want to use: for_window [instance="^alsamixer$" class="^URxvt\$"] floating enable, move absolute position center

more

See my comment above

( 2013-01-28 16:44:57 +0000 )edit

( 2013-01-29 09:28:23 +0000 )edit

If you need to use (?i)alsamixer that means your capitalization is different from mine. i means case insensitive.

( 2013-01-29 09:28:48 +0000 )edit

Sorry I meant to post a comment not an answer. As for having a for_window line for every instance of a script that needs to be run in a terminal, am thinking could I use a variable? or a mode like function so I do not need to specify that it needs to run in a terminal each time? As I already have

( 2013-01-29 11:58:45 +0000 )edit

Curious, why the need to specify an absolute position of center? Floating windows position themselves centered automatically.

more

No its not required if you do not need it, still new to i3 so working my way through the options

( 2013-01-29 08:41:29 +0000 )edit

that's okay, we'll all learning. It was just as much a question as a statement. I just figured out how to force position elsewhere besides center for floaters!

( 2013-01-29 12:48:16 +0000 )edit