maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Maemo 5] Catorise: auto-sort applications menu (https://talk.maemo.org/showthread.php?t=40265)

Bundyo 2010-01-13 20:08

Re: Catorise: auto-sort applications menu
 
What about watching a file in the theme folder with inotify?

Jaffa 2010-01-13 20:17

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by qwerty12 (Post 469029)
When changing themes, I saw nothing significant (when running dbus-monitor) other than applets' osso_contexts being initialized due to hildon-home reloading the applets. But maybe I wasn't looking hard enough...

Damn.

Quote:

/home/user/.osso/current-gtk-theme always seems to point to default; the only thing I've noticed is /etc/hildon/theme now points to the new theme after changing it.
Indeed; that's why 0.0.1 didn't work with other themes.

As Bundyo says, perhaps inotify on /etc/hildon/theme would work; but ideally I'd like some kind of system invocation so that there's nothing running in the background 24/7.

VRe 2010-01-14 12:10

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by aspidites (Post 467470)
I imagine you've figured this out by now, but anything in the ovi repo is categorized under "user/hidden" which is why they aren't getting put into the correct categories.

Oh man, that is ugly hack. Suppose so that the software wouldn't be visible in HAM and only ovi-webgui would be used..

geneven 2010-01-14 12:22

Re: Catorise: auto-sort applications menu
 
Just for fun, I reflashed my N900 yesterday and set everything up fresh.

Catorise doesn't work now, though it is listed as an installed app by app manager.

I had installed it before as a deb and from Qole's repository etc. and it was working fine.

Edit: My mistake: the "more" with uncategorized programs seems to be back. Otherwise, the program seems to work fine. I would prefer an Other or Misc. folder to the More.

adancau 2010-01-14 12:23

Re: Catorise: auto-sort applications menu
 
happy to report that my catorise survived the OTA update to PR1.1 today and is working happily :) thanks

Jaffa 2010-01-14 13:05

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by geneven (Post 470560)
Catorise doesn't work now, though it is listed as an installed app by app manager.

Can you define "doesn't work", please? If possible, can you run /opt/catorise/catorise as root in X Terminal (and send me the output, if any) and the files /opt/catorise/menu and /etc/xdg/menus/hildon.menu/

Quote:

I had installed it before as a deb and from Qole's repository etc. and it was working fine.
I think you're confused, as Catorise has only ever existed in Extras-devel. manzn's MyMenu was available as a deb and in qole's repo.

Jaffa 2010-01-14 13:06

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by geneven (Post 470560)
Edit: My mistake: the "more" with uncategorized programs seems to be back. Otherwise, the program seems to work fine. I would prefer an Other or Misc. folder to the More.

If anyone (doesn't have to be a programmer) wants to help reverse engineer the translation IDs Application Manager uses, I think I can reuse them.

That'd turn "More..." into "Other".

qwerty12 2010-01-14 13:23

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by Jaffa (Post 470683)
If anyone (doesn't have to be a programmer) wants to help reverse engineer the translation IDs Application Manager uses, I think I can reuse them.

That'd turn "More..." into "Other".

textdomain: hildon-application-manager

msgids:

ai_category_all
ai_category_desktop
ai_category_development
ai_category_education
ai_category_games
ai_category_graphics
ai_category_multimedia
ai_category_navigation
ai_category_network
ai_category_office
ai_category_other
ai_category_science
ai_category_sharing_plugins
ai_category_system
ai_category_utilities

Quote:

Originally Posted by Jaffa (Post 469051)
As Bundyo says, perhaps inotify on /etc/hildon/theme would work; but ideally I'd like some kind of system invocation so that there's nothing running in the background 24/7.

If it makes it any better, hildon-home watches /etc/hildon/theme. (Then again, hildon-home is expected to be running 24/7, which is your point, I guess...)
Status area plugin? :p (Yes, I know...)

NvyUs 2010-01-14 15:44

Re: Catorise: auto-sort applications menu
 
before i updated to PR1.1 I removed catorise now I've reinstalled it again all my category folders are now in correct order.
I tried same on 1.01 but did not work, so not sure if its a change in PR1.1 that fixed it

Jaffa 2010-01-14 15:54

Re: Catorise: auto-sort applications menu
 
Ah, of course. That could be it - my screenshots were taken using 2.2009.51-1 and so it's likely that as part of the fix for #6932 the behaviour on which I rely for ordering the top-level sections was also fixed.

Thanks for the reassurance! I can now concentrate on using the i18n keys from qwerty12 without worrying about non-determinism :-)

BTW, anyone have any thoughts on where "Conversations" and "Phone" should live? I've currently got them under "Utilities", but that doesn't quite seem right. "Network" perhaps? (phone network/human networking/IP-based comms)

Rob1n 2010-01-14 16:05

Re: Catorise: auto-sort applications menu
 
The menu now has specific ordering tags, or uses alphabetical order for any other apps. The submenus can also go into separate files, all of which get merged into a single menu. Presumably you can also do nested folders, but I've not tried that yet.

NvyUs 2010-01-14 16:13

Re: Catorise: auto-sort applications menu
 
I'd go for network its best suited nothing else seems right to me.

romanianusa 2010-01-14 16:32

Re: Catorise: auto-sort applications menu
 
This will be my first app to download once i updated the NEW firmware. I been using MyMenu. This sound like a great app!!

b666m 2010-01-14 17:27

Re: Catorise: auto-sort applications menu
 
everything is in place now since PR1.1! nice work! ;)

Ghostface 2010-01-14 17:28

Re: Catorise: auto-sort applications menu
 
Awesome app +1

hippo 2010-01-14 20:10

icons are not updated on install
 
Catorise 0.0.2 on PR1.1

When I install a new app icons do not show up in the categories just in all.

i did an apt-get installation two and i do not see the catorise trigger message.

any thoughts?

Jaffa 2010-01-14 20:30

Re: icons are not updated on install
 
Quote:

Originally Posted by hippo (Post 471987)
When I install a new app icons do not show up in the categories just in all. i did an apt-get installation two and i do not see the catorise trigger message.

So you do not see the message when you install with apt-get and you do not get icons catgorised when installing through App Manager?

Can you let me know which apps you tried with?

Catorise also now has a shiny Bugzilla product for raising bugs in:

https://bugs.maemo.org/enter_bug.cgi?product=Catorise
https://bugs.maemo.org/buglist.cgi?product=Catorise

Bundyo 2010-01-14 21:07

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by Jaffa (Post 469051)
Damn.



Indeed; that's why 0.0.1 didn't work with other themes.

As Bundyo says, perhaps inotify on /etc/hildon/theme would work; but ideally I'd like some kind of system invocation so that there's nothing running in the background 24/7.

You'll still have it running 24/7 - its the kernel :)

http://www.ibm.com/developerworks/li...ify/index.html
http://www.linuxjournal.com/article/8478

geneven 2010-01-14 23:36

Re: Catorise: auto-sort applications menu
 
Sorry; I thought catorise was the new name of mymenu because information for both programs was being posted in the same thread.

atunguyd 2010-01-15 02:01

Re: Catorise: auto-sort applications menu
 
Anyone also finding that freeciv is not turning up in any menu other than ALL?

When I run /opt/catorise/catorise i get the following error:

Code:

Nokia-N900-42-11:/usr/share/applications/hildon# /opt/catorise/catorise
dpkg: /usr/share/applications/hildon/freeciv-client-sdl.desktop not found.
Unknown desktop file: /usr/share/applications/hildon/freeciv-client-sdl.desktop

However if I get a directory listing of /usr/share/applications/hildon i get:

Code:

Nokia-N900-42-11:/usr/share/applications/hildon# ls -l
-rw-r--r--    1 root    root          207 Jan 12 14:54 angrybirds.desktop
-rw-r--r--    1 root    root          242 Oct 30 22:39 ap.desktop
-rw-r--r--    1 root    root          161 Dec  1 21:49 applications.directory
-rw-r--r--    1 root    root          166 Dec  2 22:57 as-daemon.desktop
-rw-r--r--    1 root    root          180 Jan 12 21:20 bounce.desktop
-rw-r--r--    1 root    root        1261 Nov 19 21:18 browser.desktop
-rw-r--r--    1 root    root          286 Dec  3 21:24 calendar.desktop
-rw-r--r--    1 root    root          356 Nov 26 20:59 camera-ui.desktop
-rw-r--r--    1 root    root          446 Oct  1 00:24 chess_startup.desktop
-rw-r--r--    1 root    root          333 Jan  2 15:42 claws-mail.desktop
-rw-r--r--    1 root    root          105 Dec 21 05:25 conky.desktop
-rw-r--r--    1 root    root          254 Oct 30 22:40 dtg.desktop
-rw-r--r--    1 root    root          444 Nov 13 23:40 filemanager.desktop
-rw-r--r--    1 root    root          253 Jan  7 11:31 fm-boost.desktop
lrwxrwxrwx    1 root    root          65 Jan 13 22:48 freeciv-client-sdl.desktop -> /opt/freeciv/share/applications/hildon/freeciv-client-sdl.desktop
-rw-r--r--    1 root    root          471 Dec 11 03:24 hildon-application-manager.desktop
-rw-r--r--    1 root    root          432 Nov 20 23:38 hildon-control-panel.desktop
-rw-r--r--    1 root    root          492 Nov 17 02:41 image-viewer.desktop
-rw-r--r--    1 root    root          136 Nov 21 00:30 intellisyncd.desktop
-rw-r--r--    1 root    root        1742 Nov 14 07:56 leafpad.desktop
-rw-r--r--    1 root    root          483 Sep  4 16:03 maemoblocks.desktop
-rw-r--r--    1 root    root          367 Aug 22 03:58 maemosec_certman_mimehandler.desktop
-rw-r--r--    1 root    root          459 Aug 22 23:02 mahjong_startup.desktop
-rw-r--r--    1 root    root        1083 Nov 30 23:53 mediaplayer.desktop
-rw-r--r--    1 root    root          623 Dec 12 00:24 modest.desktop
-rw-r--r--    1 root    root          380 Jan 14 22:12 nokia-maps.desktop
-rw-r--r--    1 root    root          207 Nov  6 20:35 offscr-anglemeter.desktop
-rw-r--r--    1 root    root          192 Nov 27 01:02 offscr-level.desktop
-rw-r--r--    1 root    root          204 Nov  6 20:40 offscr-resistors.desktop
-rw-r--r--    1 root    root          210 Nov 24 02:55 offscr-speedometer.desktop
-rw-r--r--    1 root    root        1221 Nov 13 22:45 osso-addressbook.desktop
-rw-r--r--    1 root    root          388 Oct  5 22:03 osso-backup.desktop
-rw-r--r--    1 root    root          282 Nov 10 02:28 osso-xterm.desktop
-rw-r--r--    1 root    root          417 Oct 14 21:38 osso_calculator.desktop
-rw-r--r--    1 root    root          490 Sep 21 16:13 osso_lmarbles.desktop
-rw-r--r--    1 root    root          427 Nov 29 15:49 osso_notes.desktop
-rw-r--r--    1 root    root          360 Oct  1 00:03 osso_pdfviewer.desktop
-rw-r--r--    1 root    root          522 Nov 26 01:12 osso_rss_feed_reader.desktop
-rw-r--r--    1 root    root          309 Oct  1 00:13 osso_sketch.desktop
-rw-r--r--    1 root    root          456 Sep 29 21:39 ovi.desktop
-rw-r--r--    1 root    root          955 Dec 12 02:16 rtcom-call-ui.desktop
-rw-r--r--    1 root    root        1033 Dec  9 00:19 rtcom-messaging-ui.desktop
-rw-r--r--    1 root    root          418 Nov 26 20:00 worldclock.desktop

Also I can cat freeciv-client-sdl.desktop and get a valid entry:
Code:

Nokia-N900-42-11:/usr/share/applications/hildon# cat freeciv-client-sdl.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Freeciv
Name[ca]=Freeciv
Name[es]=Freeciv
Name[fr]=Freeciv
Name[no]=Freeciv
Name[pt]=Freeciv
Name[tr]=Freeciv
Comment=Turn-based strategy game inspired by the history of human civilization
Comment[ca]=Joc d'estratègia inspirat en la història de la civilització humana
Comment[da]=Strategispil inspireret af den menneskelige civilisations historie
Comment[de]=Rundenbasiertes Strategiespiel, inspiriert durch die Geschichte der menschlichen Zivilisation
Comment[fi]=Ihmiskunnan historian inspiroima vuoropohjainen strategiapeli
Comment[no]=Strategispill inspirert av historien til menneskelig sivilisasjon
Comment[pt]=Jogo de estratégia por turnos inspirado na História da civilização humana
Comment[sv]=Turordningsbaserat strategispel inspirerat av den mänskliga
Comment[tr]=İnsanlık tarihinden esinlenerek yapılmıŠsıra tabanlı strateji oyunu
Exec=/usr/bin/civclient-sdl.sh
Icon=freeciv-client
X-Window-Icon=freeciv-client
X-Osso-Type=application/x-executable
X-Osso-Service=civclientsdl
StartupWMClass=civclient-sdl
Terminal=false

Nokia-N900-42-11:/usr/share/applications/hildon#

I can only hazard a guess your script does not follow symbolic links

mtjioe 2010-01-15 08:48

Re: Catorise: auto-sort applications menu
 
Several OVI store games, but also Documents2go programs don't show up after update PR1.1 and if these programs are installed after catorise. Deinstalling and reinstalling catorise fixes this, till other programs are installed.

marcoil 2010-01-15 10:36

Re: Catorise: auto-sort applications menu
 
Hi, everyone,

In the MyMenu thread I described some of the changes PR1.1 made in the handling of menu files: http://talk.maemo.org/showpost.php?p...&postcount=278

labra 2010-01-15 20:29

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by Jaffa (Post 468715)
It's possible (the menu can be customised however you want), but it's not something that Catorise currently facilitates. It's main reason is to implement #3822.

Could tihs be implemented as manual editing of the /opt/catorise/menu -file by adding the application into "main" category for example?

zehjotkah 2010-01-15 21:26

Re: Catorise: auto-sort applications menu
 
1 Attachment(s)
here is a hildon.menu just to compare with the stock file from catorise.
there I've moved bounce and angry birds to the games category.

before (not in that file) I've also tried to traduce to german, but that didn't worked. showed me then "no applications".

Jaffa 2010-01-16 04:10

Re: Catorise: auto-sort applications menu
 
v0.0.3 is being prepared. This includes:
  • Translations (by using the App Manager's labels)
  • Better parsing of .desktop files.
  • A rejig of some of the categories for the built-in apps.
  • Usage of categories from within a .desktop file, if present.

Before release, I'll look at:
  • Symlinked .desktop problem
  • #8026 - triggers problem meaning no-auto recategorisation on app install.

Jaffa 2010-01-16 04:11

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by labra (Post 474888)
Could tihs be implemented as manual editing of the /opt/catorise/menu -file by adding the application into "main" category for example?

It could be implemented like that, but - as I said - if you put anything in a "main" category now it will end up in "other".

There's also been a suggestion of automatically showing the most 5 used apps. Suggestions on how to detect those welcome :-)

dvergin 2010-01-16 05:35

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by Jaffa (Post 475619)
...automatically showing the most 5 used apps. Suggestions on how to detect those welcome :-)

How about: "most used" = "launched most times from w/in Catorise"

Don't worry about launching from other places (shortcuts, etc.) For many of us using this tool, it will be the go-to place to launch from.

Also, consider not just storing a launch count for each app. Rather, you could store a series of date-time stamps for each app. That way you could throw away "hits" over a certain age so that apps I used a lot six months ago (but seldom use now) wouldn't keep cluttering up the top of the list.

Also-also, maybe the "list by freq of use" feature should be a user selectable option. Not everyone will want the list to keep changing (hey! that icon was here yesterday, now it's there).

My dream feature is do-it-yourself custom categorizing and ordering. I'm quite happy to edit a text file to do so if the protocol for doing so is clear.

Jaffa 2010-01-16 08:52

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by dvergin (Post 475690)
How about: "most used" = "launched most times from w/in Catorise"

But Catorise doesn't launch anything. "All" it does is re-arrange the menu used by hildon-desktop.

Quote:

My dream feature is do-it-yourself custom categorizing and ordering. I'm quite happy to edit a text file to do so if the protocol for doing so is clear.
If you don't mind editing text files, you don't need Catorise, MyMenu or anything else. Just edit /etc/xdg/menus/hildon.menu with a copy of the Desktop Menu Specification open. FWIW, icons used are from /usr/share/icons/hicolor/64x64/hildon.

Jaffa 2010-01-16 11:25

Re: Catorise: auto-sort applications menu
 
Catorise 0.0.4 is now in extras-devel (0.0.3 didn't last long); compared with 0.0.2, this includes:
  • Translations (by using the App Manager's labels)
  • Better parsing of .desktop files.
  • A rejig of some of the categories for the built-in apps.
  • Usage of categories from within a .desktop file, if present.
  • Symlinked .desktop problem
  • #8026 - triggers problem meaning no-auto recategorisation on app install.

There is a known bug with Phone, Conversations and other core apps starting: #8111, hopefully marcoil will be able to help with this. I could exclude such apps from the categorisation until the problem is fixed. Thoughts?

gviterbo 2010-01-16 11:50

Re: Catorise: auto-sort applications menu
 
this application is great! thanks for this!

DaSilva 2010-01-16 12:31

Re: Catorise: auto-sort applications menu
 
What do I have to add to a .desktop file to add it to a specific category in the menu?

Categories=Network;

Would this be enough to put a shortcut in the Network menu (using http://standards.freedesktop.org/men...egory-registry for other categories)? Because I have also found a X-Maemo-Category line in a .desktop file.
How can I update the menu without (un)installing anything or rebooting?
Thanks in advance.

atunguyd 2010-01-16 13:37

Re: Catorise: auto-sort applications menu
 
Jaffa,

I can confirm that the problem with freeciv has been fixed.

Thanks

Jaffa 2010-01-16 13:56

Re: Catorise: auto-sort applications menu
 
v0.0.5 is now in extras-devel and contains a workaround for #8111: Phone, Conversations, Calendar and Email won't appear in the "All" section.

Quote:

Originally Posted by DaSilva (Post 476044)
What do I have to add to a .desktop file to add it to a specific category in the menu?

Categories=Network;

Would this be enough to put a shortcut in the Network menu[?]

Yup. Catorise uses the first valid freedesktop.org category if defined in the .desktop file in preference to the Section of the package from which it was installed. Since there's such a close alignment between the freedesktop.org categories and the Maemo package sections, I'd recommend not having them wildly different in your packages!

b666m 2010-01-16 14:23

Re: Catorise: auto-sort applications menu
 
nice work!

everything's fine now in the latest version :D

fabien 2010-01-16 22:49

Re: Catorise: auto-sort applications menu
 
I have installed the version 0.0.3 and have the following issue when running:

Nokia-N900-42-11:~# /opt/catorise/catorise
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_network.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_multimedia.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_games.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_system.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_education.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_desktop.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_office.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_navigation.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_utilities.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_science.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_graphics.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_other.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_ovi.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_development.png': No such file or directory
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_all.png': No such file or directory


Obviously the icone of the directories are blue
Is there anything obvious that I'm missing ?

Jaffa 2010-01-16 23:15

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by fabien (Post 477058)
cp: cannot stat '/usr/share/themes/alpha/backgrounds/app_install_network.png': No such file or directory

What version of Maemo are you using? (Settings > About Product)
Have you done any customisations manually, or using particular software?
Are you using a custom theme? If so, which one?

fabien 2010-01-16 23:42

Re: Catorise: auto-sort applications menu
 
maemo5
version: 1.2009.42-11.203.2

(this is displayed in the shell :) )

I was using Digital nature but reverted to default theme: Nokia Nseries.
I have installed few applications games & networks app mainly but nothing which modify nokia theme settings

romanianusa 2010-01-17 00:42

Re: Catorise: auto-sort applications menu
 
So in the future version...is there an option to opening up a program of some sort and edit the category and icons the way you want it?? Because i don't know how to get into the root and do it from there.

Jaffa 2010-01-17 08:08

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by fabien (Post 477168)
maemo5
version: 1.2009.42-11.203.2

Right, that answers the question :-)

The Application Manager icons were introduced in 1.2009.44-x; so I need to add a dependency on PR1.0.1 or above. In other words, you have three options:
  1. Update your firmware to PR1.1, or at least PR1.0.1. All the cool kids are doing it.
  2. Live with blue squares.
  3. Source some icons with the filenames above to put in /usr/share/icons/hicolor/64x64/hildon. Theoretically, I could ship some with Catorise, but I'm not sure I want to (I can't ship the Nokia icons, after all).

Quote:

(this is displayed in the shell :) )
Firmware updates don't necessarily update the hostname :-)

qwerty12 2010-01-17 11:27

Re: Catorise: auto-sort applications menu
 
Quote:

Originally Posted by qwerty12 (Post 470727)
Status area plugin? :p (Yes, I know...)

OK, it turns out I wasn't joking... :p

This thing is hackish, but works beautifully:

gcc --shared theme-updater-object.c `pkg-config --cflags --libs libhildondesktop-1` -Wall -o theme-updater-object.so
PHP Code:

/*
 * theme-updater-object
 *
 * Copyright (C) 2010 Faheem Pervez <Don't really feel like spam on this lovely morning>. All rights reserved.
 *
 * Licensed under:
 *
 *             DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
 *                   Version 2, December 2004
 *
 *    Copyright (C) 2004 Sam Hocevar
 *    14 rue de Plaisance, 75014 Paris, France
 *    Everyone is permitted to copy and distribute verbatim or modified
 *    copies of this license document, and changing it is allowed as long
 *    as the name is changed.
 *
 *           DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
 *  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 *
 *     0. You just DO WHAT THE **** YOU WANT TO. 
 *
 * This program is free software. It comes without any warranty, to
 * the extent permitted by applicable law. You can redistribute it
 * and/or modify it under the terms of the Do What The **** You Want
 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING for more details.
 *
 */

/* theme-updater-object.c */

#include <stdlib.h>
#include <glib.h>
#include <glib-object.h>
#include <libhildondesktop/libhildondesktop.h>

typedef struct
{
    
HDStatusPluginItem parent;
ThemeUpdaterObject;

typedef struct
{
    
HDStatusPluginItemClass parent_class;
ThemeUpdaterObjectClass;

HD_DEFINE_PLUGIN_MODULE (ThemeUpdaterObjecttheme_updater_objectHD_TYPE_STATUS_PLUGIN_ITEM)

static 
void theme_updater_object_class_init (ThemeUpdaterObjectClass *klass G_GNUC_UNUSED)
{
}

static 
void theme_updater_object_class_finalize (ThemeUpdaterObjectClass *klass G_GNUC_UNUSED)
{
}

static 
void on_theme_changed (GObject *obj G_GNUC_UNUSEDGParamSpec *pspec G_GNUC_UNUSEDgpointer user_data G_GNUC_UNUSED)
{
    static 
gboolean first_emission TRUE/* We recieve notification of the bloody theme changing twice! */

    
first_emission = !first_emission;

    if (!
first_emission)
        return;

    if (!
system ("pidof catorise"))
        return;

    
g_spawn_command_line_async ("/usr/bin/sudo /opt/catorise/catorise"NULL);
}

static 
void theme_updater_object_init (ThemeUpdaterObject *plugin G_GNUC_UNUSED)
{
    
g_signal_connect (G_OBJECT (gtk_settings_get_default ()), "notify::gtk-theme-name"G_CALLBACK (on_theme_changed), NULL);


As you will have realised, this does install as a status area plugin (which is why I derive from HDStatusPluginItem, instead) but displays nothing there. For this to work:

/etc/sudoers.d/catorise.sudoers:
Code:

user ALL = NOPASSWD: /opt/catorise/catorise
And then just do a plain "update-sudoers" as root.


All times are GMT. The time now is 04:02.

vBulletin® Version 3.8.8