SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-02-07 23:35:13

kmason
#! Member
From: Tempe, AZ, USA
Registered: 2010-02-04
Posts: 54
Website

A purple-remote powered shell script for setting pidgin/finch status.

As the title says, this is a shell script for setting your status in Pidgin/Finch, using purple-remote.

Simply copy/paste this code into a new file, and set the permissions with chmod +x <filename>.

#!/bin/bash
echo "Status? (Valid Options are available,away,unavailable,invisible, and offline):"
read status
case $status in
"available") purple-remote setstatus?status=available;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"away") purple-remote setstatus?status=away;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"unavailable") purple-remote setstatus?status=unavailable;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"invisible") purple-remote setstatus?status=invisible;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"offline") purple-remote setstatus?status=offline;echo "Message?:";read message;purple-remote setstatus?message="$message";;
*) echo "Invalid Status.  Please Try Again.";;
esac

Be nice, as its my first shell script, well, at least my first one that takes user input.

EDIT

Changelog

v0.1: Initial release
v0.1-1: Fixed a small bug where the status message was only able to be one word.

Last edited by kmason (2010-02-08 02:03:08)


[Acer Aspire One ZG5|Intel Atom N270|1GB RAM|8GB SSD|Intel Integrated Graphics|#! 9.04]
[Custom Desktop|Intel C2D E8400|2GB RAM|80GB & 250GB HDD|NVIDIA GeForce GT220|Win7Pro|#! 9.04]
[last.fm|deviantART|Bloodstar Studios]

Offline

Be excellent to each other!

#2 2010-02-08 00:04:18

ultralytenment
Member
From: Harpers Ferry, West Virginia
Registered: 2010-01-22
Posts: 19

Re: A purple-remote powered shell script for setting pidgin/finch status.

Thanks! It works, mostly... is there anyway that you can work around the fact that the script limits your "message" (away, available, etc.)  to just one word? If I try setting it to "Watching the Super Bowl", it sets it to Watching and then exits.

Offline

#3 2010-02-08 00:13:28

kmason
#! Member
From: Tempe, AZ, USA
Registered: 2010-02-04
Posts: 54
Website

Re: A purple-remote powered shell script for setting pidgin/finch status.

Hm.  I'll have to look into that, there should be a way of including strings as variables...


[Acer Aspire One ZG5|Intel Atom N270|1GB RAM|8GB SSD|Intel Integrated Graphics|#! 9.04]
[Custom Desktop|Intel C2D E8400|2GB RAM|80GB & 250GB HDD|NVIDIA GeForce GT220|Win7Pro|#! 9.04]
[last.fm|deviantART|Bloodstar Studios]

Offline

#4 2010-02-08 00:48:41

ultralytenment
Member
From: Harpers Ferry, West Virginia
Registered: 2010-01-22
Posts: 19

Re: A purple-remote powered shell script for setting pidgin/finch status.

Great! You'd think that there would be. At any rate, apart from that, it works flawlessly when it comes to actually setting the general status as available, away, invisible, and so forth.

Offline

#5 2010-02-08 02:01:28

kmason
#! Member
From: Tempe, AZ, USA
Registered: 2010-02-04
Posts: 54
Website

Re: A purple-remote powered shell script for setting pidgin/finch status.

I simply needed to add quotes around the $message variable.  lol

#!/bin/bash
echo "Status? (Valid Options are available,away,unavailable,invisible, and offline):"
read status
case $status in
"available") purple-remote setstatus?status=available;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"away") purple-remote setstatus?status=away;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"unavailable") purple-remote setstatus?status=unavailable;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"invisible") purple-remote setstatus?status=invisible;echo "Message?:";read message;purple-remote setstatus?message="$message";;
"offline") purple-remote setstatus?status=offline;echo "Message?:";read message;purple-remote setstatus?message="$message";;
*) echo "Invalid Status.  Please Try Again.";;
esac

[Acer Aspire One ZG5|Intel Atom N270|1GB RAM|8GB SSD|Intel Integrated Graphics|#! 9.04]
[Custom Desktop|Intel C2D E8400|2GB RAM|80GB & 250GB HDD|NVIDIA GeForce GT220|Win7Pro|#! 9.04]
[last.fm|deviantART|Bloodstar Studios]

Offline

#6 2010-02-08 03:15:00

ultralytenment
Member
From: Harpers Ferry, West Virginia
Registered: 2010-01-22
Posts: 19

Re: A purple-remote powered shell script for setting pidgin/finch status.

Works perfectly! Thanks smile

Offline

#7 2010-02-08 04:01:33

kmason
#! Member
From: Tempe, AZ, USA
Registered: 2010-02-04
Posts: 54
Website

Re: A purple-remote powered shell script for setting pidgin/finch status.

You're welcome.  Glad that it works well.


[Acer Aspire One ZG5|Intel Atom N270|1GB RAM|8GB SSD|Intel Integrated Graphics|#! 9.04]
[Custom Desktop|Intel C2D E8400|2GB RAM|80GB & 250GB HDD|NVIDIA GeForce GT220|Win7Pro|#! 9.04]
[last.fm|deviantART|Bloodstar Studios]

Offline

#8 2010-02-14 01:04:40

kmason
#! Member
From: Tempe, AZ, USA
Registered: 2010-02-04
Posts: 54
Website

Re: A purple-remote powered shell script for setting pidgin/finch status.

I just made a new version, with options and a gui (using zenity).

I also gave it a name. zen-status.


[Acer Aspire One ZG5|Intel Atom N270|1GB RAM|8GB SSD|Intel Integrated Graphics|#! 9.04]
[Custom Desktop|Intel C2D E8400|2GB RAM|80GB & 250GB HDD|NVIDIA GeForce GT220|Win7Pro|#! 9.04]
[last.fm|deviantART|Bloodstar Studios]

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo