nightIMPgale (IMProved nightingale)

Amarok 1.x Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on git.opendesktop.org

0
Score 50%
Description:

This Amarok script shuts down your PC for you. This comes in handy if you like to go to bed listening to your favourite music. Just tell nightIMPgale when to shut down with as few as one, two, three clicks. Done. A set of options is available for convenient use (at least I hope so).

Last changelog:

12 years ago


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.

reaperfh

9 years ago

When can we expect an amarok 2 version? that would be so awesome!!!!

Report

reaperfh

10 years ago

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

Report

donchristophe

10 years ago

I like this script.
Since bash 3.2 line 340 must be changed from
Quote:if [[ "$input" =~ '([a-zA-Z]*)(: )?(.*)' ]]
to
Quote:if [[ "$input" =~ ([a-zA-Z]*)(: )?(.*) ]]
Without the ' around the regular expression. If not, nigthIMPgale will not detect any change of amarok state.

Report

Sobriety

10 years ago

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.

Report

Sobriety

10 years ago

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.

Report

C

ugh-bough

10 years ago

@ 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

Report

jewgienij

11 years ago

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!

Report

C

ugh-bough

11 years ago

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 '.' ?!

Report

charleso

11 years ago

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\ (.*)\ (.*://.*) ]]

Report

jewgienij

11 years ago

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...

Report

amirhomayoun

10 years ago

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.

Report

C

ugh-bough

10 years ago

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

Report

C

ugh-bough

10 years ago

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

Report

amirhomayoun

10 years ago

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.

Report

camico

11 years ago

When Amarok crashes, the script hangs and eats all cpu...

Report

bugmenot

11 years ago

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?

Report

C

ugh-bough

11 years ago

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.

Report

reggler

11 years ago

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!

Report

C

ugh-bough

11 years ago

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.

Report

reggler

11 years ago

Still doesn't work for me with Amarok 1.4-SVN0703091957. Does it work for anyone? What do I miss?
Thank you!

Report

C

ugh-bough

11 years ago

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).

Report

keba

12 years ago

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

Report

12 years ago


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.

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
0.3
updated Mar 09 2007
added Mar 28 2006
downloads today
0
page views today 2
System Tags addon