! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Change the associated command from 'xterm top' to 'xfce4-taskmanager'
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-cpugraph-plugin
Component:
General

Comments

Description Johannes Lips 2010-05-14 15:37:49 CEST
 
Comment 1 Johannes Lips 2010-05-14 15:39:03 CEST
We have such a nice application why not use it. And I think this is a very good opportunity to use it, or?

Think that would only be a minor change.

Thanks in advance!
Greetings,

Johannes
Comment 2 Mike Massonnet editbugs 2010-05-14 16:09:51 CEST
I do not complain the change but it's true that opening a GUI instead of top inside xterm (not even the default terminal) is less beautiful than it could be.

Instead of whipping xfce4-taskmanager out[0] for a reason or another, there is a better and cleaner solution: keep xfce4-taskmanager as default command, and if it fails to launch change the setting to a new fallback value and run the command again. This will fix your issue in case the default command is not available.

[0] http://git.xfce.org/panel-plugins/xfce4-cpugraph-plugin/commit/?id=d18d5110a98615a05cd4e2abd75ae6cfedec0b8d
Comment 3 Mike Massonnet editbugs 2010-05-14 16:11:31 CEST
(In reply to comment #2)
> inside xterm (not even the default terminal) 
> http://git.xfce.org/panel-plugins/xfce4-cpugraph-plugin/commit/?id=d18d5110a98615a05cd4e2abd75ae6cfedec0b8d

That was actually wrong, as it depends on libxfcegui4 with which terminal emulator the command will be run.
Comment 4 Florian Rivoal editbugs 2010-05-29 06:05:50 CEST
For a moment, I put xfce4-taskmanager as a default, but was convinced to remove it because:
- it doesn't work well on anything else than linux (*bsd, solaris...)
- xfce4-taskmanager is not a base component of xfce, always guaranteed to be installed, but a goodie. I'd rather not add a dependency on it, as the ability to use only some parts of xfce is one of its strengths.

So, for these reasons, I don't think just adding xfce4-taskmanager as default would be such a good solution.

Now, for your proposal of setting it as a default, and changing the setting to something else if it fails to run, that would technically work, but that would also be very unintuitive. Settings changing themselves isn't expected by users.

Instead, how about changing the default command to this:

sh -c "if which xfce4-taskmanager; then xfce4-taskmanager; else exo-open --launch TerminalEmulator top; fi"
Comment 5 Mike Massonnet editbugs 2010-05-29 16:43:42 CEST
Created attachment 2999 
cpugraph-fallback-command.patch

(In reply to comment #4)
> Now, for your proposal of setting it as a default, and changing the setting to
> something else if it fails to run, that would technically work, but that would
> also be very unintuitive. Settings changing themselves isn't expected by users.

Not the best what one can come out with :) Lets call this a little crap.

> Instead, how about changing the default command to this:
> 
> sh -c "if which xfce4-taskmanager; then xfce4-taskmanager; else exo-open
> --launch TerminalEmulator top; fi"

Nah, this is just gross to have within a text entry.

I attach a patch that does it simple-clean, if the configuration file doesn't exist yet, the AssociatedCommand isn't set, so lets pick up this moment to check for the right fallback command. If the program xfce4-taskmanager is not found, let's go with top :)  Take care to test the patch, cause I didn't.
Comment 6 Mike Massonnet editbugs 2010-05-29 16:47:38 CEST
Well at least it compiles :)
Comment 7 Florian Rivoal editbugs 2010-05-31 11:27:23 CEST
Despite compiling, the proposed patch didn't work, but I agree it is the right idea, so I committed something very closely inspired by it. Check git if you're curious.

Bug #6446

Reported by:
Johannes Lips
Reported on: 2010-05-14
Last modified on: 2010-10-03

People

Assignee:
Florian Rivoal
CC List:
2 users

Version

Attachments

cpugraph-fallback-command.patch (1012 bytes, patch)
2010-05-29 16:43 CEST , Mike Massonnet
no flags

Additional information