You are not logged in.

#1 2018-12-02 06:29:46

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

Using xfdesktop on BunsenLabs

"Icons on the Desktop" is a common request, and there are many ways of getting them if you want to complicate the austere BL non-desktop. smile

The best choice depends on why you want icons, what you already have installed, your taste in configuration tools... For example, if you want .desktop files to launch applications with, then maybe a better option is to look at some kind of panel, like xfce4-panel, or tint2 launchers, or even jgmenu. Again, many many options.

OTOH, like me, you just might want to use your desktop as somewhere to drop files while you decide what to do with them (like a real desktop). Then, while changing file manager to eg pcmanfm is a possibility, xfdesktop isn't a bad option:
*) It's from the XFCE family so will get along with our file manager Thunar.
*) It gives you some control over how icons are displayed, and their captions.
*) Allows similar control of wallpaper display to nitrogen, including different wallpapers for different desktops.
*) Doesn't bring in as many dependencies as eg Nautilus would.
*) As a bonus, you get a dynamically-updating right-click applications menu.

---
Get it.

sudo apt-get install xfdesktop4

Note the package name is xfdesktop4, but the command to launch it is xfdesktop. roll
So edit ~/.config/openbox/autostart:

## Set a wallpaper
#nitrogen --restore
( sleep 3; xfdesktop ) &

You no longer need nitrogen to draw the desktop, and can set the wallpaper via xfdesktop's right-click menu: Desktop Settings...
The need for sleep is explained later.

---
Annoyances and workarounds.

1) The openbox menu will no longer be available with a right-click on the desktop, except over the tint2 zone, but of course the keyboard shortcuts [Super] or [Super]+[Space] still work. Personally, I never found clicking the desktop convenient anyway, considering it's usually covered by a maximized window.

2) Conkys with own_window_type = 'desktop' will disappear if you click the desktop, never to return!
The fix is to edit the conky file to own_window_type = 'normal'. That means that pressing [Super]+D to show the desktop will now hide the conky. I don't think there's any way round this.

3) The current Stretch package has a bug which prevents opening of non-default folders to choose a wallpaper.
Workaround:

sudo apt-get purge bunsen-thunar

Now image files opened in Thunar will have a "Set as Wallpaper" right-click option which works. (It is suppressed by default because we don't ship xfdesktop.)
Other workaround:
Download xfdesktop4 and xfdesktop4-data 4.12.4-2 from Buster, and install with gdebi. Not recommended in general, but works in this case.
Alternatively, wait for an upgrade to the Stretch package, which the Debian devs seem to be working on.

4) The default display of text under the icons might not be to your taste, but it can be tweaked by adding some code to ~/gtkrc-2.0.mine. See /usr/share/doc/xfdesktop4/README.
Here's my code, to give you an idea. I tried to make the text match conky as closely as possible.

style "xfdesktop-icon-view-new" {

    XfdesktopIconView::label-alpha = 0
    XfdesktopIconView::selected-label-alpha = 120
    XfdesktopIconVIew::ellipsize-icon-labels = 1
	XfdesktopIconView::tooltip-size = 64

    XfdesktopIconView::shadow-x-offset = 1
    XfdesktopIconView::shadow-y-offset = 1
    XfdesktopIconView::shadow-color = "#222222"
    XfdesktopIconView::selected-shadow-x-offset = 0
    XfdesktopIconView::selected-shadow-y-offset = 0
    XfdesktopIconView::selected-shadow-color = "#000000"
	#XfdesktopIconView::shadow-blur-radius = 2

    XfdesktopIconVIew::cell-spacing = 5
    XfdesktopIconView::cell-padding = 5
    XfdesktopIconView::cell-text-width-proportion = 2.5

    base[NORMAL] = "#222222"
    base[SELECTED] = "#333333"
    base[ACTIVE] = "#000000"

    fg[NORMAL] = "#dddddd"
    fg[SELECTED] = "#ffffff"
    fg[ACTIVE] = "#ffffff"

	engine "murrine"
	{
		textstyle = 0
	}

	font_name = "normal"

}

widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view-new"

uGKdp6Um.png

5) Finally, a long-standing bug about icon placement. Every now and then your neat icon arrangement gets messed up. It's due to a race condition at login apparently, but still hasn't been fixed. The biggest thing you can do to to get round it is to wait a bit before starting up xfdesktop, so the data has a chance to be imported (increase sleep if necessary). Even so, those icons still sometimes get misplaced. There are some workarounds posted or linked to on that bug report, and I adapted one of them:
At shutdown, store the current (presumed correct) icon positions.
At login, wait a few seconds for things to settle down, then replace the possibly messed-up config file with the good settings. This script, fix-desktop-icons.sh:

#!/bin/bash
# get xfdesktop's icons in order again

mkdir-p $HOME/.config/user
backup=$HOME/.config/user/icons.screen0-backup.rc
confdir=$HOME/.config/xfce4/desktop

newest ()  {
    candidate='' ;
    for i in "$@";
    do
        [[ -f $i ]] || continue
        [[ -n $candidate ]] || { candidate="$i" ; continue ;}
        [[ $i -nt $candidate ]] && candidate="$i"
    done
    echo "$candidate"
}

target="$(newest "$confdir"/* )"

case $1 in
''|--restore)
    cat "$backup" > "$target"
    xfdesktop --reload
    ;;
--backup)
    cp "$target" "$backup"
    ;;
*)
    echo "$0: $1: no such option" >&2
    exit 1
    ;;
esac

exit

Call it in your shutdown script - er, you do have one? If not, make some arrangement to call:

$HOME/scripts/fix-desktop-icons.sh --backup

before shutting down, and in openbox/autostart:

( sleep 10; $HOME/scripts/fix-desktop-icons.sh --restore ) &

---
Once all that's done, everything should work nicely! cool


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#2 2018-12-02 07:45:17

tubcain
New Member
Registered: 2018-12-01
Posts: 2

Re: Using xfdesktop on BunsenLabs

Thank you John for that comprehensive explanation.

Offline

#3 2018-12-06 13:12:20

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 820

Re: Using xfdesktop on BunsenLabs

The fix is to edit the conky file to own_window_type = 'normal'. That means that pressing [Super]+D to show the desktop will now hide the conky. I don't think there's any way round this.

Does setting own_window_type=override fix the show desktop issue?

Also, since conky is a window (own_window=yes), it can be controlled by the openbox (any window manager) per app settings. In the conkyrc, give the cony window a name and class - for example:

own_window_class = 'ConkyObx',
own_window_title = 'ConkyObx',

Then the user can use those in the application settings of the openbox rc.xml file.

Last edited by PackRat (2018-12-06 13:12:53)


You must unlearn what you have learned.
    -- yoda

Offline

#4 2018-12-07 06:29:15

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

Re: Using xfdesktop on BunsenLabs

PackRat wrote:

Does setting own_window_type=override fix the show desktop issue?

Thanks for the idea. I'll try that out in a day or two - I don't now remember if I checked out all the variations or not.

Anyone else, feel free to go ahead though, if you don't want to wait. smile


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#5 2018-12-08 08:50:00

ohnonot
...again
Registered: 2015-09-29
Posts: 3,197
Website

Re: Using xfdesktop on BunsenLabs

^ no.
the conky vs. desktop manager problem is age-old and there doesn't seem to be a satisfactory solution to it if the desktop manager isn't willing to recognize conky's special role.

prove me wrong.

Offline

#6 2018-12-08 15:57:31

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 820

Re: Using xfdesktop on BunsenLabs

Conkys with own_window_type = 'desktop' will disappear if you click the desktop, never to return!
The fix is to edit the conky file to own_window_type = 'normal'. That means that pressing [Super]+D to show the desktop will now hide the conky. I don't think there's any way round this.

These settings:

own_window_type = 'panel',

or

own_window_type = 'dock',

will get around that by placing the conky window in the openbox dock. Downside is that openbox is hard coded to draw a border around docked applications, and the conky window is placed wherever the dock is positioned. You can sort of hide the border with a background - including a semi-transparent lua background. I suspect setting the border to "0" in the openbox theme will do that as well. The dock can be set to be below windows.

So there is a fix for the issue depending on your priorities and what you can live with aesthetically.

If you're not running xfdesktop, you can use the setting:

own_window = false,

since it's not a window, conky will not iconify with the ToggleDesktop action, but conky will not be visible if you're running compton.

Last edited by PackRat (2018-12-08 16:27:02)


You must unlearn what you have learned.
    -- yoda

Offline

#7 2018-12-08 21:56:07

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 541

Re: Using xfdesktop on BunsenLabs

How easy is it to backport the xfdesktop4 in Buster or Sid?


Real Men Use Linux

Online

#8 2018-12-09 10:06:10

ohnonot
...again
Registered: 2015-09-29
Posts: 3,197
Website

Re: Using xfdesktop on BunsenLabs

DeepDayze wrote:

How easy is it to backport the xfdesktop4 in Buster or Sid?

why?

Offline

#9 2018-12-09 14:10:08

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 541

Re: Using xfdesktop on BunsenLabs

ohnonot wrote:
DeepDayze wrote:

How easy is it to backport the xfdesktop4 in Buster or Sid?

why?

Hopefully to deal with the bugs mentioned?


Real Men Use Linux

Online

#10 2018-12-09 15:24:38

damo
....moderator....
Registered: 2015-08-20
Posts: 4,385

Re: Using xfdesktop on BunsenLabs

DeepDayze wrote:
ohnonot wrote:
DeepDayze wrote:

How easy is it to backport the xfdesktop4 in Buster or Sid?

why?

Hopefully to deal with the bugs mentioned?

But if the bugs haven't been fixed yet, then backporting isn't going to help....


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

Board footer

Powered by FluxBB