gcmd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gcmd-usr] Need help on Ubuntu 20.04


From: mi
Subject: Re: [gcmd-usr] Need help on Ubuntu 20.04
Date: Sun, 7 Mar 2021 22:38:33 +0100

I'm doing this on old versions of gcmd so i don't know if it still works.


Let's say that device has a label and you want to mount it by label.


Let's say it is labelled 'MYDISK'.

(See tune2fs -L or dosfslabel and packages exfat-utils or exfatprogrs,  on how 
to rename a device)



In the devices dialog, go to the field 'device' and insert

 -L MYDISK > /dev/null && cd

In the mount point field, just put the mount point. It has to be an accesible 
directory. (Create one if not exist)


What does it do ?

gcmd will perform the 'mount' command with the device as first parameter. Then 
-L will be accepted as command option by mount and it will parse the second 
part as label.

Any output will be directed to /dev/null (dismissed).

And since it is (still?) just a shell doing the task, the '&&' will be parsed 
as logical AND and if the first action finished without error, then the next 
command will be executed which is a cd 'change directory'.

In the usual mount commandline, what would follow as last option is the mount 
point and gcmd will still add this.

But since the last part so far was a 'cd', the shell will not mount but just 
change into that mount point directory.


And there is the reason for the /dev/null redirection:

If that mount point is already mounted, i can still clikc on that device 
bookmark and it will just open the folder.

If there was no /dev/null then mount would return an error and the '&& cd' part 
would never be executed.


Now find some nice icon for the respective device, configure View -> Show 
device buttons, and there you go.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]