Page 2 of 3

Re: Tips and Tricks from the Xfce Forum

Posted: Sat Jun 02, 2018 1:28 pm
by Jerry3904
Yeah, was just feeling ornery I guess.

Re: Tips and Tricks from the Xfce Forum

Posted: Sat Jun 02, 2018 10:32 pm
by tascoast
Order partitions in Thunar

Normally Thunar reorders partitions with each login. Here is a trick to get it how you would like it (from user Paul1149):

Go to each internal drive, and from the right pane or address bar drag it into the PLACES list.
Drag them into your desired order.
Now right-click those drives under DEVICES in the left pane and uncheck them.
They will disappear, giving their vertical space back, and you will be left with a tidy list of devices in the order you want.
The "Now right-click those drives under DEVICES in the left pane and uncheck them" step has me stumped. Mind you I needed to change to view the side pane as shortcuts, rather than as a tree, as I usually have it set to.

Open, open in a new tab, open in a new window or unmount appear to be the only right-click options available here.


I do like this one and expect I'll test it out next:
Adjust spacing of Thunar columns

The text inside the columns of Thunar is often jammed up against the right column edge. ToZ looked at the code and found that this snippet will fix it. Create a new file ~/.gtkrc-2.0 and paste in the code below. Then log out and back in to see the effect.

----------

style "my-details-view"
{
GtkTreeView::horizontal-separator = 20
}
widget_class "*ThunarDetailsView*" style "my-details-view"

----------

You can vary the value (10, 15, ,etc.) to suit your tastes.

Center a window using the keyboard

You can center a window using a keyboard with this script:

Re: Tips and Tricks from the Xfce Forum

Posted: Sat Jun 02, 2018 10:49 pm
by tascoast
For: Adjust spacing of Thunar columns
"The text inside the columns of Thunar is often jammed up against the right column edge. ToZ looked at the code and found that this snippet will fix it. Create a new file ~/.gtkrc-2.0 and paste in the code below. Then log out and back in to see the effect."

this worked fine, although I note that I already had a .gtkrc-2.0 file present.

I simply opened with FeatherPad and hit return twice to paste the code as below:

Code: Select all

include ".local/share/mx-tweak-data/whisker-tweak.rc"


style "my-details-view"
{
GtkTreeView::horizontal-separator = 20
}
widget_class "*ThunarDetailsView*" style "my-details-view"
The first line, include ".local/share/mx-tweak-data/whisker-tweak.rc", was already there, for reference.

Not being very familiar with hidden user setting files but seeing how the added code resembles HTML cellpadding=, align= and the like, this seemed quite simple (I did back up the original .gtkrc-2.0 file of course, lest my efforts went wrong).
I will stay with the 'padded' look shown below for a while.
:thumbup:

....turns off Show Hidden Files now....

Re: Tips and Tricks from the Xfce Forum

Posted: Mon Jun 04, 2018 7:44 am
by Jerry3904
rich wrote: Sat Jun 02, 2018 10:21 am My favorite thing I got from there I detailed in this post: viewtopic.php?f=23&t=45293
Basically, the ability to refresh the clock after suspend. Idk how many people actually use the native panel clock though, in pre 4.13 panel there's a bug that makes it tricky to set the timezone. The workaround by the way is to edit the clock panel item properties by opening the panel preferences dialog from the menu and going to panel items instead of just right clicking on the clock item itself in the panel.
Added this, also the padding one from Alt.

Re: Tips and Tricks from the Xfce Forum

Posted: Mon Jun 04, 2018 7:49 am
by Jerry3904
The "Now right-click those drives under DEVICES in the left pane and uncheck them" step has me stumped. Mind you I needed to change to view the side pane as shortcuts, rather than as a tree, as I usually have it set to.

Open, open in a new tab, open in a new window or unmount appear to be the only right-click options available here.
I can't see how that works now, either. Will remove if no one can do it.

Re: Tips and Tricks from the Xfce Forum

Posted: Mon Jun 04, 2018 8:06 am
by dolphin_oracle
you actually need to right click in an open space in the drives area to get the hidden menu.

Re: Tips and Tricks from the Xfce Forum

Posted: Mon Jun 04, 2018 8:36 am
by Jerry3904
Oh--in the space to the right of the word Drives works for me.

th

Re: Tips and Tricks from the Xfce Forum

Posted: Mon Jun 04, 2018 8:54 am
by tascoast
Cheers also. In effect it removes Device listings and shows partitions listed under Places, but in the order a user has added them.
This works well for those who prefer the left pane as View-Shortcuts, but does not allow for these to be displayed in a -Tree view. So ultimately, Device listings cannot be rearranged per user preference. This is still a good tip for those preferring a shortcut view, just not for those users relying on a tree view Thunar.

Re: Tips and Tricks from the Xfce Forum

Posted: Mon Jun 04, 2018 9:06 am
by oops
Jerry3904 wrote: Wed Apr 19, 2017 6:43 am Did you know that we keep a running list created from interesting and useful posts on the Xfce Forum?
https://mxlinux.org/wiki/xfce/xfce-comm ... eful-stuff
The one I just put up there is a neat script that centers a window and can be assigned to a keystroke.
Thank you Jerry ... interesting tricks.

Re: Center a window using the keyboard

Posted: Thu May 07, 2020 2:22 pm
by JRG
While the script may have worked in the past, it now does not. There may have been issues (e.g., "smart quotes") when the script was copied into the post. In the process of debugging it for my own use, I found a number of things in the script and rewrote it (based on the script posted by Jerry3904). I assigned it to the Right Win key.

Here it is:

Code: Select all

#!/bin/bash

# Based on the script by Jerry3904

IFS='x'; read screenWidth screenHeight < <(xdpyinfo | grep dimensions | grep -o '[0-9x]*' | head -n1)

winId=`xdotool getactivewindow`

width=$(xdotool getwindowgeometry -shell $winId | head -4 | tail -1 | sed 's/[^0-9]*//')
height=$(xdotool getwindowgeometry -shell $winId | head -5 | tail -1 | sed 's/[^0-9]*//')

newPosX=$((screenWidth/2-width/2))
newPosY=$((screenHeight/2-height/2))

xdotool windowmove $winId $newPosX $newPosY