You are not logged in.

#1 2011-01-22 18:01:55

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

[SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

Since the upgrade to Thunar 1.2.0, I now have two additional, unwanted items that I can't seem to remove:

Network and
500 GB LVM2 Physical Volume

JMamct.png

The LVM being the most distracting, as it gets mixed in with other disks that I mount.  Is there any straightforward way to remove/hide those items? Remove Shortcut / Rename Shortcut are grayed out in the context menu for both.

Thanks in advance.

EDIT: this is now [SOLVED].  See post #6 for hiding disks with udev rules, and post #7 for removing the Network shortcut by recompiling Thunar.

Last edited by MkFly (2011-01-23 07:26:51)

Offline

#2 2011-01-22 22:36:38

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 3,026

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

You either hide it all, that is the whole left panel, or you don't hide it as far as I can tell.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2011-01-23 00:04:21

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

I'm just wondering if there's any way to set up something like udev rules that would keep them from showing up there?

Also, when I'm mounting from the command line, those mounts don't show up in Thunar's shortcut pane at all -- what needs to be done to allow them to do so?

Last edited by MkFly (2011-01-23 00:04:46)

Offline

#4 2011-01-23 01:01:45

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 3,026

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

MkFly wrote:

I'm just wondering if there's any way to set up something like udev rules that would keep them from showing up there?

No idea here.

MkFly wrote:

Also, when I'm mounting from the command line, those mounts don't show up in Thunar's shortcut pane at all -- what needs to be done to allow them to do so?

If I'm not wrong, thunar now uses udisks to mount/unmount partitions so you would need to use udisks to mount/unmount the partitions if you want them to show up there, see man udisks.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2011-01-23 01:23:22

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

R00KIE wrote:

If I'm not wrong, thunar now uses udisks to mount/unmount partitions so you would need to use udisks to mount/unmount the partitions if you want them to show up there, see man udisks.

Hmm, well I mounted that way from the command line (which worked), but still nothing in Thunar.  Only after I restart X does it show up in Thunar, which is certainly a hassle ...

EDIT: If I launch Thunar with dbus-launch thunar, the manually mounted drive shows up without restarting X.  But I'd have to open it like that every time ... is there any way to "refresh" the current dbus session?

My .xinit is:

exec dbus-launch ck-launch-session startxfce4

Last edited by MkFly (2011-01-23 03:08:25)

Offline

#6 2011-01-23 04:45:05

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

Well, after perusing the source for udisks, I got the LVM hidden at least.  The answer is in the section 7 manpage for udisks:

       UDISKS_PRESENTATION_HIDE
           If set to 1 this is a hint to presentation level software that the device should not be shown to the
           user.

So, I made a new rule in /etc/udev/rules.d:

KERNEL=="sda2", ENV{UDISKS_PRESENTATION_HIDE}="1"

Where sda2 is my LVM.  It's gone now! smile Network is still here, though.  I'll be working on that one next.

As for the "refreshing" dbus question, I think I should just create another thread for that, so I'm marking this one as [SOLVED].

Thanks for the tip on udisks, R00KIE.

Last edited by MkFly (2011-01-23 04:46:02)

Offline

#7 2011-01-23 07:25:14

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

MkFly wrote:

Network is still here, though.  I'll be working on that one next.

Well, I just went to the source for that one.  I already had made some changes to Thunar, so a a couple more before compiling wasn't a biggie. smile

If anybody else wants to remove the Network icon from either the Sidebar Pane:

Thunar-1.2.0/thunar/thunar-shortcuts-model.c:

if (thunar_g_vfs_is_uri_scheme_supported ("network"))                                                         
    system_paths = g_list_append (system_paths, g_file_new_for_uri ("network://"));

Comment that out (see thunar-tree-model.c for the Tree Panel), recompile and:

HZGjot.png

Horray. smile

Offline

#8 2011-01-23 15:54:38

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 3,026

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

For your .xinit you may want to use 'exec ck-launch-session dbus-launch --sh-syntax --exit-with-session startxfce4', it's what I have found to work better.

You may also want to export DE=xfce somewhere because xdg-open (which is used by some programs) does not "detect" xfce anymore after the update to 4.8 (I have added that in an extra file in /etc/profile.d/extras.sh).


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2011-01-23 19:55:53

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

R00KIE wrote:

For your .xinit you may want to use 'exec ck-launch-session dbus-launch --sh-syntax --exit-with-session startxfce4', it's what I have found to work better.

Thanks, I'll give that a try. smile

R00KIE wrote:

You may also want to export DE=xfce somewhere because xdg-open (which is used by some programs) does not "detect" xfce anymore after the update to 4.8 (I have added that in an extra file in /etc/profile.d/extras.sh).

Forgot to mention that, I do have DE exported right above the startxfce4 line in .xinitrc.  I put it there specifically to fix xdg-open, but I realized that I didn't like the behavior of xdg-open anyway (when used manually from the command line): it won't open more than one file on the command line, and it and exo-open both tried to open non-existant files as URLs in my browser, which I found very annoying.

So I ended up just writing my own little wrapper script for exo-open for my command-line use. smile Figured DE needed to be set anyway though, so I left it.

Last edited by MkFly (2011-01-23 19:57:56)

Offline

#10 2011-01-23 21:04:39

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 3,026

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

Xdg-open actually uses exo-open if it can detect you are using xfce, you can look inside it as it is a bash script.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#11 2011-01-23 22:23:33

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

R00KIE wrote:

Xdg-open actually uses exo-open if it can detect you are using xfce, you can look inside it as it is a bash script.

Yep, but xdg-open only will allow one file to be opened at a time, and it also let exo-open open non-existant files as URLs.

exo-open by itself will open multiple files, but it still tries to open non-existant files as URLs.

Both very annoying to me. tongue

Last edited by MkFly (2011-01-23 22:24:17)

Offline

#12 2012-02-13 08:52:23

monash
Member
From: Hong Kong
Registered: 2011-11-10
Posts: 9

Re: [SOLVED] Thunar 1.2.0: How to hide default items from Shortcut Pane

Better late than never smile

Remove thunar network gvfs icon
   

# sudo chmod 000 /usr/share/gvfs/mounts/network.mount

Keepinitlite: AsusP5K+Nvidia210+Core2+2gbRam

Offline

Board footer

Powered by FluxBB