Ok, It's yad, precise yad version is at fault, I can't get a functional right click menu with yad 0.12.4.april wrote:Yes but your script does not appear to run on mine. Should I remove /root/Startup/.pkl .Will that make yours start . I get nothing when I do that atm.
I have your second script in /root/Startup/ and have changed the permissions to executeable but checking running processes there is nothing started?
Heres a yad I compiled in precise 5.7.1, yad-0.37.0, it's the latest and afaik the last that supports gtk2.
this revised script will first kill the logger if it is running, then restarts it with the timestamp disabled
Code: Select all
#!/bin/bash
# MyKeylog
ps ax | grep -q '[My]Keylog' && exit 1
logkeys -k >/dev/null 2>&1
KEYLOG=`awk 'NR==2' < /root/Startup/.pkl`
KEYLOG=`echo "$KEYLOG" | awk -F'-o' '{print $1}'`
eval "$KEYLOG"--no-timestamps -o /var/log/kp/secret-keys.log
function my_keylog () {
ps ax | grep -q '[MY]KEYLOG' && kill $(ps -ef | awk '/[MY]KEYLOG/{print $2}') && exit 1
export MYKEYLOG='
<window title="MyKeylog" icon-name="gtk-edit">
<vbox>
<edit file-monitor="true" auto-refresh="true" wrap-mode="3" editable="true">
<variable>MY_KEYLOG</variable>
<input file>/var/log/kp/secret-keys.log</input>
</edit>
<hbox homogeneous="true">
<hbox>
<button>
<label>Save</label>
<input file stock="gtk-save"></input>
<action>`echo "$MY_KEYLOG" > /var/log/kp/secret-keys.log`</action>
</button>
</hbox>
</hbox>
</vbox>
</window>'
gtkdialog -p MYKEYLOG -G 400x200"+`getcurpos | tr " " "+"`"
}
export -f my_keylog
function killkeylog () {
logkeys -k
kill $(ps -ef | awk '/[MY]KEYLOG/{print $2}')
kill $(ps -ef | awk '/[t]ext=MyKeylog/{print $2}')
}
export -f killkeylog
mkfifo /tmp/mykeylog >/dev/null 2>&1
exec 3<> /tmp/mykeylog
exec yad --notification --no-middle --text=$"MyKeylog" --image="gtk-edit" --command "sh -c 'my_keylog >/dev/null 2>&1'" --listen <&3 &
echo "menu:Exit!sh -c 'killkeylog >/dev/null 2>&1'!gtk-cancel" >&3