Two Firefox desktop files

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 8280
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Two Firefox desktop files

Post#1 by Ed_P » 04 Feb 2024, 20:54

Why does the Firefox module have two .desktop application files? :%)

Code: Select all

guest@porteus:/usr/share/applications$ diff browser.desktop mozilla-firefox.desktop
79c79
< #MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
---
> MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
81d80
< NoDisplay=true
guest@porteus:/usr/share/applications$ 
Do other browsers have two also?
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3914
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two Firefox desktop files

Post#2 by ncmprhnsbl » 05 Feb 2024, 01:28

browser.desktop is a panel only .desktop that changes to whatever the last activated browser module is. (and opens the browser update/chooser tool when no browser module activated)
only works on some 003-DE panels. cinnamon is one that doesn't.
only been this way for maybe 10+ years ;)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8280
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Two Firefox desktop files

Post#3 by Ed_P » 06 Feb 2024, 00:11

ncmprhnsbl wrote:
05 Feb 2024, 01:28
only works on some 003-DE panels. cinnamon is one that doesn't.
It certainly was working in my Cinnamon (003-cinnamon.xzm:20231229) when I was running Firefox 119 that's why I asked. Now that I've upgraded to Firefox 122 it's gone.

BTW Is there a parm for starting Firefox in a certain screen/desktop location?
.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3914
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two Firefox desktop files

Post#4 by ncmprhnsbl » 06 Feb 2024, 03:29

Ed_P wrote:
06 Feb 2024, 00:11
t certainly was working in my Cinnamon
news to me
Ed_P wrote:
06 Feb 2024, 00:11
BTW Is there a parm for starting Firefox in a certain screen/desktop location?
if cinnamon has that level of fine grain control (starting certain apps on a particular workspace) i've never seen where it would be set :unknown:
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

donald
Full of knowledge
Full of knowledge
Posts: 2059
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Two Firefox desktop files

Post#5 by donald » 06 Feb 2024, 07:53

--> starting certain apps on a particular workspace <--
can be done -- with a bit of trickery.

install the wmctrl command [wmctrl-1.07-x86_64-3dj.txz] - 28kB

...run your application(s) per script
> sleep some sec to make sure they are fully loaded
> let wmctrl move them to the desired workspace.
[wmctrl -r <program> -t <workspace>]
done.

User avatar
Ed_P
Contributor
Contributor
Posts: 8280
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Two Firefox desktop files

Post#6 by Ed_P » 06 Feb 2024, 15:45

donald wrote:
06 Feb 2024, 07:53
install the wmctrl command [wmctrl-1.07-x86_64-3dj.txz] - 28kB
That looks promising donald. Thank you.

Added in 1 hour 8 minutes 20 seconds:

Code: Select all

guest@porteus:~$ slapt-mod -s wmctrl
Please enter root's password
Password: 
wmctrl-1.07-x86_64-2salix15.0  (tool to interact with an X Window Manager)
guest@porteus:~$ 
Added in 1 minute 52 seconds:

Code: Select all

guest@porteus:~$ slapt-mod -m wmctrl
Please enter root's password
Password: 
Reading Package Lists...Done
The following NEW packages will be installed:
  wmctrl 
0 upgraded, 0 reinstalled, 1 newly installed, 0 to remove, 0 not upgraded.
Need to get 27.0kB of archives.
Do you want to continue? [y/N] y
1/1 Get http://slackware.uk/salix/x86_64/extra-15.0/ wmctrl 1.07-x86_64-2salix15.0 [27.0kB]...Done

Done
Verifying package wmctrl-1.07-x86_64-2salix15.0.txz.
Installing package wmctrl-1.07-x86_64-2salix15.0.txz:
PACKAGE DESCRIPTION:
# wmctrl (tool to interact with an X Window Manager)
#
# The wmctrl program is a command line tool to interact with an
# EWMH/NetWM-compatible X Window Manager. It provides command line
# access to almost all the features defined in the EWMH specification.
#
# Homepage: http://sweb.cz/tripie/utils/wmctrl
#
Package wmctrl-1.07-x86_64-2salix15.0.txz installed.
Parallel mksquashfs: Using 8 processors
Creating 4.0 filesystem on /tmp/wmctrl-1.07-x86_64-2salix15.0.xzm, block size 262144.
[========================================================================|] 2/2 100%

Exportable Squashfs 4.0 filesystem, zstd compressed, data block size 262144
	compressed data, compressed metadata, compressed fragments,
	compressed xattrs, compressed ids
	duplicates are removed
Filesystem size 13.75 Kbytes (0.01 Mbytes)
	30.75% of uncompressed filesystem size (44.72 Kbytes)
Inode table size 243 bytes (0.24 Kbytes)
	35.42% of uncompressed inode table size (686 bytes)
Directory table size 251 bytes (0.25 Kbytes)
	59.06% of uncompressed directory table size (425 bytes)
Number of duplicate files found 0
Number of inodes 20
Number of files 2
Number of fragments 1
Number of symbolic links 3
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 15
Number of ids (unique uids + gids) 1
Number of uids 1
	root (0)
Number of gids 1
	root (0)

====> '/tmp/wmctrl-1.07-x86_64-2salix15.0.xzm' was created successfully.

guest@porteus:~$ 
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2059
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Two Firefox desktop files

Post#7 by donald » 07 Feb 2024, 13:23

This script work for me

Code: Select all

#!/bin/bash

(palemoon &)  & sleep 10 &&
bash -c "wmctrl -i -r `wmctrl -l | grep -i moon` -t 1"
I use palemoon in this script - substitute it with your app.

It start the browser, wait 10 sec (you can adjust the sleep time)
and then move the browser (or whatever) to the 2nd workspace.

XFCE-user(s)
only 1 workspace is configured by default - you can add more.(settings > workspaces)

and 2nd:
if you (double)click a script file in thunar, it is opened in mousepad.
..we will/can change that to execute the script as the default action.

a) quit thunar:

Code: Select all

thunar -q
b) run:

Code: Select all

xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default  --create --type bool --set true
c) check:

Code: Select all

xfconf-query -l -c thunar
there should be a line /misc-exec-shell-scripts-by-default
now, if you (double)click a script file, it will be executed.

User avatar
Ed_P
Contributor
Contributor
Posts: 8280
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Two Firefox desktop files

Post#8 by Ed_P » 08 Feb 2024, 07:11

Thank you donald. :beer: I'll let you know what I end up with. :)
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8280
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Two Firefox desktop files

Post#9 by Ed_P » 10 Feb 2024, 07:57

Code: Select all

guest@porteus:~$ wmctrl -m
Name: Mutter (Muffin)
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A
guest@porteus:~$ wmctrl -l
0x04400028 -1 porteus.example.net Desktop
0x04800028  0 porteus.example.net Optional
0x03e00049  0 porteus.example.net *wmctrl.sh (~)
0x0420003d  0 porteus.example.net wmctrl user documentation (examples) | spiralofhope — Mozilla Firefox
0x05200006  0 porteus.example.net Terminal
guest@porteus:~$ bash -c "wmctrl -i -r `wmctrl -l | grep - firefox` -t 1"
grep: firefox: No such file or directory
guest@porteus:~$ bash -c "wmctrl -i -r `wmctrl -l | grep - Firefox` -t 1"
grep: Firefox: No such file or directory
guest@porteus:~$ bash -c "wmctrl -i -r `wmctrl -l | grep - Mozilla Firefox` -t 1"
grep: Mozilla: No such file or directory
grep: Firefox: No such file or directory
guest@porteus:~$ 
What I would like to do is make the starting or moving of the Firefox window to be about 150 pixels to the right rather than at 0,0 and be 1770,1080.
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2059
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Two Firefox desktop files

Post#10 by donald » 10 Feb 2024, 12:31

.....first change location and size values than move:

Code: Select all

wmctrl -r window_title -e 0,150,70,800,600 && wmctrl -r window_title -t workspace_number
-e = window position x,y window size x,y

Example:
PaleMoon launched with the forum index page displayed - relocated,resized and moved to 2nd workspace

Code: Select all

wmctrl -r 'Porteus - Index page - Pale Moon' -e 0,150,70,800,600 && wmctrl -r 'Porteus - Index page - Pale Moon' -t 1
The important point is to use the correct window name.
In a browser the window title changes depending on which web page is displayed.
IMO best to start the browser with a blank page.

https://blog.spiralofhope.com/1042/wmct ... mples.html

User avatar
Ed_P
Contributor
Contributor
Posts: 8280
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Two Firefox desktop files

Post#11 by Ed_P » 10 Feb 2024, 16:32

donald wrote:
10 Feb 2024, 12:31
In a browser the window title changes depending on which web page is displayed.
Interesting. With my new Firefox I don't display the title bar. My default opening page is Porteus so shouldn't be too hard to figure out.
donald wrote:
10 Feb 2024, 12:31
-e = window position x,y window size x,y
x,y plus x,y indicates 4 numbers.
donald wrote:
10 Feb 2024, 12:31
-e 0,150,70,800,600
This shows 5 numbers.

I'll experiment some more. :)

Added in 1 hour 16 minutes 45 seconds:

Code: Select all

The -e option expects a list of comma separated integers: "gravity,X,Y,width,height"
"Gravity" is the 5th number.

These all seem to work. :good:

Code: Select all

guest@porteus:~$ wmctrl -r 'Porteus - Index page — Mozilla Firefox' -e 0,85,0,1860,1100
guest@porteus:~$ wmctrl -r 'Porteus' -e 0,85,0,1860,1100
guest@porteus:~$ wmctrl -r 'Firefox' -e 0,85,0,1860,1100


guest@porteus:~$ wmctrl -l
0x04400028 -1 porteus.example.net Desktop
0x03e00049  0 porteus.example.net wmctrl.sh (~)
0x04800028  0 porteus.example.net Home
0x05200006  0 porteus.example.net Terminal
0x0420003d  0 porteus.example.net Porteus - Index page — Mozilla Firefox
guest@porteus:~$ 

Arguments:
  <WIN>                This argument specifies the window. By default it's
                       interpreted as a string. The string is matched
                       against the window titles and the first matching
                       window is used. The matching isn't case sensitive
                       and the string may appear in any position
                       of the title.
Thank you donald. :friends:

The "porteus.example.net" is a bit of a question since it certainly doesn't match the Porteus URL. :hmmm:
Ed

Post Reply