Need a script to open ROX in icon view - SOLVED

Moderator: Forum moderators

Post Reply
mow9902
Posts: 178
Joined: Fri Jul 24, 2020 11:57 pm
Has thanked: 13 times
Been thanked: 51 times

Need a script to open ROX in icon view - SOLVED

Post by mow9902 »

Using frugal install of fossapup64

My default rox view is "list" (not icon) and this suits me almost all of the time.
But - there are occasions when I want to open a rox window in icon view.

Is it possible to launch rox from a bash script which will open the window in "icon" view, and then revert back to the default "list" view when the window is closed?

Thanks in anticipation.

Attachments
rox options.png
rox options.png (58.07 KiB) Viewed 668 times
Last edited by mow9902 on Fri Jan 13, 2023 1:33 am, edited 1 time in total.
geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: Help with Rox - need a script to open with specific view

Post by geo_c »

mow9902 wrote: Thu Jan 12, 2023 9:38 pm

Using frugal install of fossapup64

My default rox view is "list" (not icon) and this suits me almost all of the time.
But - there are occasions when I want to open a rox window in icon view.

Is it possible to launch rox from a bash script which will open the window in "icon" view, and then revert back to the default "list" view when the window is closed?

Thanks in anticipation.

I was just looking at Rox --help in the terminal and I don't see options to open with different default display settings.

If you want to open specific directories with set display settings like icon view, you can right click on the file window and choose: >Display>Save Current Display Settings and that directory will open in the future with whatever settings you have at the moment.

I think you can display the manual in a browser using: file:///usr/share/ROX-Filer/Help/Manual.html

I haven't combed the manual for an answer, but I probably will soon.

Last edited by geo_c on Fri Jan 13, 2023 1:23 am, edited 4 times in total.

geo_c
Old School Hipster, and Such

User avatar
JakeSFR
Posts: 254
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 124 times

Re: Help with Rox - need a script to open with specific view

Post by JakeSFR »

It is possible:

Code: Select all

#!/bin/sh

if [ -z "$1" ]; then
	echo "Usage: $0 <directory>"
	exit 1
fi

filename="$1"
style='Automatic'	# Large, Small, Huge, Automatic
details='None'		# None, ListView, Size, Type, Times, Permissions
sort='Name'		# Name, Type, Date, Size, Owner, Group
hidden='false'		# true, false

rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
	<env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
		<OpenDir>
			<Filename>$filename</Filename>
			<Style>$style</Style>
			<Details>$details</Details>
			<Sort>$sort</Sort>
			<Hidden>$hidden</Hidden>
		</OpenDir>
	</env:Body>
</env:Envelope>
EOF

See Appendix C. SOAP RPC for more info.

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: Help with Rox - need a script to open with specific view

Post by geo_c »

JakeSFR wrote: Thu Jan 12, 2023 10:36 pm

It is possible:

Code: Select all

#!/bin/sh

if [ -z "$1" ]; then
	echo "Usage: $0 <directory>"
	exit 1
fi

filename="$1"
style='Automatic'	# Large, Small, Huge, Automatic
details='None'		# None, ListView, Size, Type, Times, Permissions
sort='Name'		# Name, Type, Date, Size, Owner, Group
hidden='false'		# true, false

rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
	<env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
		<OpenDir>
			<Filename>$filename</Filename>
			<Style>$style</Style>
			<Details>$details</Details>
			<Sort>$sort</Sort>
			<Hidden>$hidden</Hidden>
		</OpenDir>
	</env:Body>
</env:Envelope>
EOF

See Appendix C. SOAP RPC for more info.

Greetings!

How would you suggest running it? Locating the script in /root/my-applications/bin and running it from a terminal or linking to the desktop, something like that?

geo_c
Old School Hipster, and Such

User avatar
JakeSFR
Posts: 254
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 124 times

Re: Help with Rox - need a script to open with specific view

Post by JakeSFR »

Depends on OP's preferences, I guess.
Although the above example is meant to be provided with a directory as an argument, it can be easily done by linking it to the pinboard, then right-click the shortcut -> Edit item -> Arguments to pass (for executable).
Or just hardcode the desired directory in the script itself.

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
mow9902
Posts: 178
Joined: Fri Jul 24, 2020 11:57 pm
Has thanked: 13 times
Been thanked: 51 times

Re: Help with Rox - need a script to open with specific view

Post by mow9902 »

JakeSFR wrote: Thu Jan 12, 2023 10:36 pm

It is possible:

JakeSFR: Thanks a heap for this. It works perfectly and does just what I wanted.

I had seen and read the SOAP RPC but I'm afraid I was not able to understand how it works. Thanks again.

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: Help with Rox - need a script to open with specific view

Post by geo_c »

JakeSFR wrote: Thu Jan 12, 2023 11:56 pm

Or just hardcode the desired directory in the script itself.
Greetings!

Works great! I'll be using this scipt.

I just made an alteration to the script using @mikewalsh's present working directory line from his portable scripts, so that now you can navigate to the directory you want to open in a file manager, open a terminal in that directory (or maybe just use a "run" box) and run the script and it will open the pwd in icon view.

Actually it's great for terminal navigation to see image thumbnails using rox.

I named the script: rxvpwd for Rox view present working directory

Code: Select all

#!/bin/sh

HERE="$(dirname "$(readlink -f "$0")")"
filename=$HERE
style='Automatic'	# Large, Small, Huge, Automatic
details='None'		# None, ListView, Size, Type, Times, Permissions
sort='Name'		# Name, Type, Date, Size, Owner, Group
hidden='false'		# true, false

rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
	<env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
		<OpenDir>
			<Filename>$HERE</Filename>
			<Style>$style</Style>
			<Details>$details</Details>
			<Sort>$sort</Sort>
			<Hidden>$hidden</Hidden>
		</OpenDir>
	</env:Body>
</env:Envelope>
EOF

geo_c
Old School Hipster, and Such

Post Reply

Return to “Filesystem”