diff --git a/bash/pidgin_status/pidgin_ch_sta.pl b/bash/pidgin_status/pidgin_ch_sta.pl new file mode 100755 index 0000000..b267c82 --- /dev/null +++ b/bash/pidgin_status/pidgin_ch_sta.pl @@ -0,0 +1,6 @@ +#!/usr/bin/perl + +use strict; +use XML::Simple; +use Data::Dumper; +print Dumper (XML::Simple->new()->XMLin()); diff --git a/bash/pidgin_status/pidgin_ch_status.sh b/bash/pidgin_status/pidgin_ch_status.sh new file mode 100755 index 0000000..ca5a153 --- /dev/null +++ b/bash/pidgin_status/pidgin_ch_status.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +happy=1295818033 +bored=1295818107 + +status=${!1} + +# неопределённый статус +if [[ "$status" == "" ]]; then + exit 0 +fi + +#echo $status +killall pidgin + +xml_str=`xpath ~/.purple/prefs.xml "//pref/pref/pref[@name='savedstatus']/pref[@name='default'" 2>/dev/null` +new_xml_str=`echo $xml_str |sed ~s~[0-9][0-9]*~$status~` +xml_str=`echo $xml_str|sed 's//\\\>/ ; s/\"/\"/g ; s/\=/\\\=/g ; ~s~/~\\\/~'` +new_xml_str=`echo $new_xml_str|sed 's//\\\>/ ; s/\"/\"/g ; s/\"/\\\"/g ; s/\=/\\\=/g ; ~s~/~\\\/~'` + +echo "$xml_str" +#echo "$new_xml_str" +grep $xml_str ~/.purple/prefs.xml + +#sed -i ~/.purple/prefs.xml "s/$xml_str/$new_xml_str/" + +#(pidgin &>/dev/null)& +