Page 1 of 1

How to position a startup app on Desktop? [SOLVED]

Posted: Sun 16 Dec 2018, 19:00
by Sky Aisling
Hello, :)
Machine: HP Pavilion dm1 (64bit) RAM 4GB Display 1366x768 pixels
Distro: DPup(32bit)-7.5 Stretch

How do I position a startup app on the desktop in the position I choose?

Do I change the code in the app (in this case OSMO)?
Is this the correct code to change?
Or is there an easier way?

Location of app placed in startup: /user/bin/osmo

Code: Select all

#!/bin/bash
killall osmo 2>/dev/null
SCRNXY=$(xwininfo -root | grep -o '\-geometry .*' | tr -s ' ' | cut -f 2 -d ' ' | cut -f 1 -d '+')
SCRN_X=$(echo -n "$SCRNXY" | cut -f 1 -d 'x')
SCRN_Y=$(echo -n "$SCRNXY" | cut -f 2 -d 'x')
GUI_X=$(expr $SCRN_X - 540)
GUI_Y=$(expr $SCRN_Y - 600)
sed -i "s/^.*window_x.*$/    <window_x>$GUI_X<\/window_x>/" $HOME/.osmo/config.xml
sed -i "s/^.*window_y.*$/    <window_y>$GUI_Y<\/window_y>/" $HOME/.osmo/config.xml
osmo
Thank you in advance for any suggestions.

How to position a startup app on Desktop? [SOLVED]

Posted: Tue 18 Dec 2018, 06:49
by Sky Aisling
My mistake.
I accidentally placed /usr/bin/osmo-reset into startup as the executable rather than /usr/bin/osmo into startup.

Apparently the ROX filer can remember where the window is placed from the last action. I aligned the frame where I wanted it, closed it, then placed /usr/bin/osmo into startup.

The osmo executable now presents itself in my choice of position on the desktop screen. :D

Sky

Posted: Tue 18 Dec 2018, 10:18
by disciple
Glad your problem is sorted.

FYI rox filer is just a filer - it has nothing to do with placement of any other program's windows.That is the job of your window manager (typically JWM in Puppy).
But many programs will remember their previous position themselves - the code to do so is very simple for a GTK program. You may find if you look at Osmo''s configuration file that it is stored in there.
If you had a program that didn't restore its own geometry you could look at defining it in your window manager configuration. Alternatively, there is a standard "geometry" command line option that GTK programs usually accept, and in an extreme case there are other tools you can use to automatically position a window after it starts.

How to position a startup app on Desktop? [SOLVED]

Posted: Tue 18 Dec 2018, 14:05
by Sky Aisling
Thank you, disciple,

Your explanation is helpful. I wish I had time to truly understand the structure of a Puppy and the Linux system.

Actually, I have all the time in the world, it's just that I'm in the final run at this fantastic life and I'm choosy on where I spend my remaining time.
:)

Sky

Posted: Tue 18 Dec 2018, 19:31
by disciple
disciple wrote:But many programs will remember their previous position themselves - the code to do so is very simple for a GTK program. You may find if you look at Osmo''s configuration file that it is stored in there.
The window geometry itself I mean, not the code

How to position a startup app on Desktop? [SOLVED]

Posted: Wed 19 Dec 2018, 01:19
by Sky Aisling
Here is the finished product of the app positioned as I wanted it to appear.
I'll use the blank space to the left for a couple of other apps that are used a lot. The upper tray is hidden with mouse over activation.