Author Topic: Converting our in House Scripts to PerlGTK  (Read 12825 times)

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #60 on: August 17, 2010, 04:49:18 PM »
Hmm...... maybe a separate script to run first, check for empty folder(s), notify the user of the situation, ask to delete the folder(s), delete it/them and then launch the ezswitch app?
« Last Edit: August 18, 2010, 04:47:11 AM by Neal »

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #61 on: August 17, 2010, 06:03:57 PM »
You guys should have looked at the plymouth-set-default-theme script. ::)
Look at this:
Code: [Select]
function list_themes ()
{
        for theme in ${PLYMOUTH_DATADIR}/plymouth/themes/*/*.plymouth; do
                [ -f $theme ] || continue;
                echo "$(basename $theme .plymouth)"
        done
}

plymouth-set-default-theme doesn't use the directories to get a list of themes.
Instead it uses the .plymouth file inside the folder.
If the .plymouth file doesn't exist it skips it. (That's what "continue" does.)

The command `plymouth-set-default-theme -l` (that's a lowercase L) does what we want.
You guys are making this harder than it needs to be. :D
« Last Edit: August 17, 2010, 10:22:48 PM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #62 on: August 27, 2010, 11:05:27 PM »
I just wanted to show everyone what I've been working on:



Current Features:
  • libnotify notifications.

  • On startup, waits for the network connection (up to 25 seconds) before failing (if there is no connection) or checking for updates (if there is a connection).

  • Has the usual interval between checks for updates.

  • Displays a notification that shows when the next check will be.

  • Gtk2::SimpleList dialog that displays what packages are to be updated + their descriptions (and giving the user an option to cancel) before beginning the update.

  • Much more robust settings system (will create a config file with the default settings if it doesn't exist).

  • Right click menu on the icon!  ;)

  • Will display a notification with the error message(s) from apt-get if something goes wrong. :)

What it needs:
  • More Configuration Options? (Need some suggestions)

  • Currently the enable/disable options in the settings dialog don't do anything but write the setting to the config file. :D

  • Currently it doesn't give the user any indication that the update is being performed (gives password dialog then doesn't display any notifications) This is because apt blocks program execution until it finishes. This can be easily solved with a thread like in gezswitch4 but I'm too lazy right now. ;)

  • The "Changes will take effect after the next update" limitation can be fixed, I just need to work on it.

Other Notes:
  • I have a small perl file with code for giving the "Progress value" (1..100) of some apt operations (download, installation, and upgrade). I may use this in the update-notifier.

  • I used the existing update notifier icons because I'm not an artist and I didn't see the need to create new ones, but it can be easily changed to use different icons.

  • I also had a working liveusb creator with mulitple iso support and PCC integration that just needed persistence support and ALOT of error checks + bugfixes, but I found out about the project on mypclinuxos.com so I'm going to scrap it since I'm not very proud of its code (other than controlling HAL using dbus). ;)

I'll post the source for the update-notifier after I clean up some of the code (remove unneeded variables etc), add a few more comments, and finish the installer.

« Last Edit: August 27, 2010, 11:19:34 PM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #63 on: August 28, 2010, 03:15:25 AM »
Looks good so far, Mark.

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: Converting our in House Scripts to PerlGTK
« Reply #64 on: August 28, 2010, 06:05:04 AM »
Great! :)

It should be included in the PCC



Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #65 on: August 28, 2010, 07:19:18 AM »
Great! :)

It should be included in the PCC

That is the goal. :D

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12512
Re: Converting our in House Scripts to PerlGTK
« Reply #66 on: August 28, 2010, 08:08:16 AM »
Great! :)

It should be included in the PCC

That is the goal. :D

GGGOOOAAAALLLL !!!! :D

Thanks to everyone who donates. You keep the servers running.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #67 on: August 28, 2010, 08:16:32 AM »
 ;D ;D ;D

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #68 on: August 28, 2010, 03:01:42 PM »
First Release: Version 0.0.8-2 (Pre Alpha)
http://www.box.net/shared/43eu9hsllj

To install, unzip anywhere and run install.sh as root.
Make sure you cd to the directory of install.sh first
Do not install this on your main machine.
I think all bugs are gone, but I can't be sure.

Information about this new update notifier is on the previous page of this thread.

Currently, there is no PCC integration.

PCC integration was planed, but I decided to drop it for several reasons:

  • The PCC runs as root, currently the settings for update-notifier are at ~/.update-notify and if the config window is run as root the update-notifier won't be able to read the settings when it starts

  • PCC integration would require two separate files, one for the config window and one for the rest of the app

  • There are very few options in the config window, when maximized, it looks really weird  :)

  • I couldn't decide where in the PCC the link should be.:D

  • If PCC integration is wanted, it can be added back very easily
« Last Edit: August 29, 2010, 04:12:34 PM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #69 on: August 28, 2010, 03:05:41 PM »
I've downloaded and will test as soon as I can. :)

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #70 on: August 29, 2010, 12:28:18 AM »
Oops. :o
I forgot to mention that you may need some perl modules from synaptic.

Specifically, these:
perl-Gtk2-notify
perl-date-calc
Perl-Gtk2-Ex-Simple-List
« Last Edit: August 29, 2010, 12:30:55 AM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3735
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Converting our in House Scripts to PerlGTK
« Reply #71 on: August 29, 2010, 03:06:32 AM »
Is it not better, to create a testing package?

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #72 on: August 29, 2010, 07:37:49 AM »
Leiche,
Yes a testing package would be better. Are you going to build one?

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #73 on: August 29, 2010, 08:01:09 AM »
Mark342,
Terminal output:
Code: [Select]
[neal@localhost ~]$ /usr/sbin/update-notify
Ambiguous call resolved as CORE::exit(), qualify as such or use & at /usr/lib/libDrakX/standalone.pm line 200.
Ambiguous call resolved as CORE::exit(), qualify as such or use & at /usr/lib/libDrakX/standalone.pm line 212.
Subroutine main::gtkadd redefined at /usr/sbin/update-notify line 8
main::BEGIN() called at /usr/lib/libDrakX/ugtk2.pm line 8
eval {...} called at /usr/lib/libDrakX/ugtk2.pm line 8
E: Conf Broken libjpeg62
Use of uninitialized value in subroutine entry at /usr/sbin/update-notify line 223.
Use of uninitialized value in subroutine entry at /usr/sbin/update-notify line 223.
Use of uninitialized value $summaries[135] in scalar chomp at /usr/sbin/update-notify line 160.
Use of uninitialized value $summaries[135] in substitution (s///) at /usr/sbin/update-notify line 161.
Use of uninitialized value $summaries[136] in scalar chomp at /usr/sbin/update-notify line 160.
Use of uninitialized value $summaries[136] in substitution (s///) at /usr/sbin/update-notify line 161.
Use of uninitialized value $summaries[137] in scalar chomp at /usr/sbin/update-notify line 160.
Use of uninitialized value $summaries[137] in substitution (s///) at /usr/sbin/update-notify line 161.
Use of uninitialized value $summaries[138] in scalar chomp at /usr/sbin/update-notify line 160.
Use of uninitialized value $summaries[138] in substitution (s///) at /usr/sbin/update-notify line 161.
Use of uninitialized value $summaries[139] in scalar chomp at /usr/sbin/update-notify line 160.
Use of uninitialized value $summaries[139] in substitution (s///) at /usr/sbin/update-notify line 161.
Use of uninitialized value $summaries[140] in scalar chomp at /usr/sbin/update-notify line 160.
Use of uninitialized value $summaries[140] in substitution (s///) at /usr/sbin/update-notify line 161.

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3735
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Converting our in House Scripts to PerlGTK
« Reply #74 on: August 29, 2010, 09:46:39 AM »
Leiche,
Yes a testing package would be better. Are you going to build one?

Sorry, working on shotwell, perhaps later  ;)