The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Customly repositioned and resized terminal in scratchpad at startup

asked 2014-12-06 12:11:19 +0000

anonymous user

Anonymous

I'm trying to always have a terminal in the scratchpad positioned in the bottom right of my screen and hidden since startup. Since it seems moving a container to the scratchpad always implies it being automatically resized and ripositioned to the center of the screen, I've found here in this site this workaroud.

# Open a terminal during startup and move it to the scratchpad
exec --no-startup-id urxvt -name urxvt_scratchpad
for_window [instance="urxvt_scratchpad"] move scratchpad

# Workaround to resize and reposition urxvt container
for_window [instance="urxvt_scratchpad"] scratchpad show; move position 1000px 200px; move scratchpad

The problems I have are:

1) I don't know how to resize the window to a custom value. (I want the terminal to be a small window for quick commands while browsing, etc)

2) I don't know how to set the exact position I want it to be, the above config example was just a test.

Using the mouse I can position the terminal in the place and with the size I'd like it to have, I'd only like to automatize this behaviour at startup.

Maybe there's a way to query i3 with the position of the terminal in the scratchpad and just copy&paste it to the config?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-12-06 16:50:11 +0000

smlb gravatar image

updated 2014-12-06 16:51:01 +0000

urxvt supports -geometry XxY value, maybe try with

exec --no-startup-id urxvt -name urxvt_scratchpad -geometry 130x40
for_window [instance="urxvt_scratchpad"] floating enable
for_window [instance="urxvt_scratchpad"] move scratchpad

This way the default size created using -geometry should remain the same in scratchpad.

edit flag offensive delete link more

Comments

Thanks! Using --geometry I was able to obtain what I wanted, I had just to try a bit to obtain the right position.

Mariano gravatar imageMariano ( 2014-12-06 19:30:57 +0000 )edit
0

answered 2014-12-06 19:40:04 +0000

Mariano gravatar image

updated 2015-01-26 17:20:09 +0000

For whoever may need it, this is what I used for a 1366x768 screen size.

# Open a small terminal at startup
exec --no-startup-id urxvt -name urxvt_scratchpad --geometry 70x15

# Workaround size&position
for_window [instance="urxvt_scratchpad"] floating enable; move scratchpad; scratchpad show; move position 865px 512px; move scratchpad

Note: This was done on urxvt with this line specifying a custom font and pixelsize in the .Xdefaults file ->

# Font

URxvt*font: xft:Source Code Pro:pixelsize=11:style=regular

Different font and pixelsize may cause the terminal to be in a slightly different position than bottom left just over the status bar, the one I was looking for.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-12-06 12:11:19 +0000

Seen: 420 times

Last updated: Jan 26