
nightIMPgale (IMProved nightingale)
Source (link to git-repo or to original if based on someone elses unmodified work):
Makeover 0.3
-- nightIMPgale is now a bash script (bash 3.x). No more dependencies on those python bindings.
-- Added context menu for easier use. There is no need any more to setup a special playlist. nightIMPgale can shut down your PC before the end of the playlist (according to the command you gave it).
-- Removed some (in my eyes) superfluous options for easier use.
Bugfixes 0.2.1.1
-- A bug in the bugfix for version 0.2.1 caused nightIMPgale to shut down the PC not at all if automatic script termination was enabled. This is now fixed. Sorry for that!
Bugfixes 0.2.1
-- nightIMPgale's process did not terminate when hitting stop in amaroK. Now it does.
Features 0.2
-- Option to force nightIMPgale to stop even if amaroK restarts running scripts.
-- Added support for different non-unicode languages. English and German included -- how to add new languages can be read in the README (it's easy).
Features 0.1
-- Shutdown PC after end of playlist.
-- Show interruptable countdown of configurable length.
-- Turn down volume before shutdown with custom command.
Ratings & Comments
22 Comments
When can we expect an amarok 2 version? that would be so awesome!!!!
Hi I just downloaded this wonderful script, but had some trouble making it work under gnome and bash 3.2 I did follow the suggestions in the comments but that didn't do it... I dug around and finally made a version working with kde4 libraries (dunno if that was the problem or not) anyway I'm running Intrepid with Gnome, bash 3.2, kde4 (as amarok and kate depend on it), and i don't think I'm missing anything... so here is my working version of the script in case anyone has the same trouble. http://pastebin.com/f1803599c Reaper
I like this script. Since bash 3.2 line 340 must be changed from to Without the ' around the regular expression. If not, nigthIMPgale will not detect any change of amarok state.
I am currently looking through the script to find out where the problem is, it is at the point read input in the loop at the bottom. It is not getting any input from amarok. Everything else works though. I am currently looking for another way to get input from the context menus. I am fairly new to scripting so I may not be able to solve it.
Scratch that after looking all day for an alternate route they lie in paths which areas of yet unexplored by me in ruby/python it seems that the input isn't the only thing not working it doesn't seem to be able to recognise track changes either.
@ all: sorry for this stupid idea - writing nightIMPgale as a bash script (thanx charleso for making this mess less a.p.i.t.a.). im currently writing my diploma thesis and do not have much time but im definetly planing to go back to python (and perhaps pimp in some features so that i can call the script nightPIMPgale ;) see you
After upgrading to Kubuntu 7.04 (Feisty Fawn) nightIMPgale has stopped working. I've got the same version of Amarok before and after distro-upgrade. I've got KDE 3.5.7, GNU bash version 3.2.13(1)-release (i486-pc-linux-gnu), Amarok 1.4.5. Any suggestions? PS. Even when I click "Just show status" nothing appears!
hi. i had a look at this ( i installed 7.04 too not not time ago ) and it seems that the bash regex "things" do not work right. ill look for a solution to this. its just weird because since when does "h" not match '.' ?!
If you haven't already, you need to remove the single quotes in the two regular expression tests and add backslashes before spaces. This is due to Feisty upgrading from Bash 3.1 to 3.2. https://bugs.launchpad.net/ubuntu/+source/bash/+bug/110407 Eg. [[ "$input" =~ '([a-zA-Z]*)(: )?(.*)' ]] Becomes [[ "$input" =~ ([a-zA-Z]*)(: )?(.*) ]] And if [[ "$1" =~ '$nightIMPgaleMenu (.*) (.*://.*)' ]] Becomes if [[ "$1" =~ $nightIMPgaleMenu\ (.*)\ (.*://.*) ]]
Well, after what you'd said I simply chose to roll back to 3.1 version of bash and everything's fine now :) Thanks for help! PS: BTW, I think that solution for suiting the 3.2 ver. may become urgent...
Hey. Really thanks for the great script. I can't use it on ubuntu 8.04 though, must be that bash 3.2 thing. I corrected the two lines you mentioned above. Are there any other places I have to correct? Right now it does not shutdown the pc. The counter just ends and nothing happens. PS) I guess the problem is with this line: dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0 when I enter this in terminal it says: object not accessible I tried a little but no success! Restarting the dcopserver does not help either. Any help would be appreciated.
hi. if you are in ubuntu you can easily help yourself (although this is ugly) by replacing that line by sudo poweroff be sure then to have everything saved at that moment nightimpgale executes the command for you. you have to change the file /etc/sudoers first (use visudo!) and add the line <yourusername> ALL=NOPASSWD:/sbin/poweroff hope that helps
hi. if you are in ubuntu you can easily help yourself (although this is ugly) by replacing that line by sudo poweroff be sure then to have everything saved at that moment nightimpgale executes the command for you. you have to change the file /etc/sudoers first (use visudo!) and add the line <yourusername> ALL=NOPASSWD:/sbin/poweroff hope that helps
Thanks! It worked. As you mentioned this is not a neat way though. Anyway, if anyone else needs this, to edit the sudoers file via gedit (to use other apps replace gedit with the name of the app): export EDITOR=gedit && sudo -E visudo PS) Good Luck with your thesis! I'm looking forward to seeing your newest version of the script.
When Amarok crashes, the script hangs and eats all cpu...
I like your tool very much and would like to use the new features, but since I use your new (bash) version. I cannot open the configure dialog and therefore can't activate the mode I want. Is this a bug or is the configuration done another way?
you have to right click some song in your playlist and choose the submenu called 'nightIMPgale shuts down'. see the about dialog for a complete manual.
Hi I was able to use that script for quite a while and it was a really good thing....but since the last Amarok svn update it wouldn't do it anymore, I updated to 1.4-SVN-0702240022 and it just wouldn't shut down my computer anymore when the playlist finishes. If you had a look into that, that would be appreciated! Thanks!
hi there. i'm currently doing an enhanced version of the script (more straight forward and easier to use as well as not dependent on any pyqt or things like that). i don't have much time but i thing it'll be finished soon.
Still doesn't work for me with Amarok 1.4-SVN0703091957. Does it work for anyone? What do I miss? Thank you!
im pretty surprised. the script uses: - dcop - amarok - kdialog - ksmserver - some other standard tools (expr, date, sleep) it's written for bash 3.x. i'll try it out with the svn version you have and tell you about it. i can't tell when this will be though (not more than a month).
Hello ugh-bough, I hav got a little problem when running NightImpgale in Amarok 1.4 (Beta 2 and 3). Installation works, but each time I press "configure" or "run" amarok crashes. Could you fix this please? I'd actually really enjoy to be able to use NightImpgale. Thank you