Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X Programm von der Shell beenden, Daten vorher speichern
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
ok
Guru
Guru


Joined: 11 Jul 2006
Posts: 390
Location: germany

PostPosted: Wed Mar 14, 2007 7:53 pm    Post subject: X Programm von der Shell beenden, Daten vorher speichern Reply with quote

Kann man ein Programm (z.B. KSpread, OOO ...) extern so beenden, dass dieses nicht gespeicherte Daten vorher sichert, oder noch nachfrägt ob die Daten gesichert werden sollen?
Ich habe schon kill -1, -3, -15 versucht, aber leider beendet sich in dem Beispiel KSpread ohne Sicherung.

Ich bin für jeden Hinweis dankbar....
Back to top
View user's profile Send private message
sschlueter
Guru
Guru


Joined: 26 Jul 2002
Posts: 578
Location: Dortmund, Germany

PostPosted: Thu Mar 15, 2007 1:54 am    Post subject: Reply with quote

Es gibt AFAIK keine universelle Methode, aber KSpread läßt sich via dcop steuern, auch Ausführen des Dokument-Speichern-Befehls und des Programm-Beenden-Befehls ist via dcop möglich. Bei OOO weiß ich es nicht.
Back to top
View user's profile Send private message
ok
Guru
Guru


Joined: 11 Jul 2006
Posts: 390
Location: germany

PostPosted: Thu Mar 15, 2007 7:06 pm    Post subject: Reply with quote

Hab mich etwas mit DCOP beschäftigt, war ein super Hinweis. Damit kann ich einiges mehr machen wie geplant.
Jetzt sollte ich nur noch alle X-Programme geordnet beenden können.
Kann mir jemand sagen wie die WM's den Anwendungen mitteilen, wenn ein Benutzer ein Fenster schließt?
Back to top
View user's profile Send private message
Finswimmer
Bodhisattva
Bodhisattva


Joined: 02 Sep 2004
Posts: 5467
Location: Langen (Hessen), Germany

PostPosted: Thu Mar 15, 2007 7:11 pm    Post subject: Reply with quote

wmctrl -c
_________________
Bitte auf Rechtschreibung, korrekte Formatierung und Höflichkeit achten!
Danke
Back to top
View user's profile Send private message
ok
Guru
Guru


Joined: 11 Jul 2006
Posts: 390
Location: germany

PostPosted: Sat Mar 17, 2007 2:44 pm    Post subject: Reply with quote

funktioniert wie gewünscht. Danke!
Hab mir noch ein Shell-Skript geschrieben:
Code:
#! /bin/bash
tmpwinfile="/tmp/winfile-"$$".tmp"
echo $tmpwinfile

wmctrl -lx | \
   sed \
   -e '/_CloseWins_/d' \
   -e '/kdesktop.Kdesktop/d' \
   -e '/kicker.Kicker/d' \
   -e '/yakuake.Yakuake/d' \
   -e '/Eterm/d' \
   > $tmpwinfile

sed -e 's/^[^ ]* //' -e 's/'$HOSTNAME'/\n\t/' $tmpwinfile
read -p "Type yes to close the windows [Y/n] "
case $REPLY in
   n | N | q | Q )   exit 2 ;;
esac
echo 'Closing the windows...'
for win in $(cut -c -11 $tmpwinfile)
do
   wmctrl -i -c $win
done

Und eine Desktopverknüpfung (CloseWins.desktop):
Code:
[Desktop Entry]
Comment=
Exec=Eterm --pause -n _CloseWins_ -e /usr/local/bin/closewin
GenericName=
Icon=
Name=CloseAllWins
Path=/tmp/
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=


Nebenbei ist mir noch aufgefallen:
- die WindowsID enden bei den selben Programmen immer gleich ( fast immer )
- "Autostart" - Programme im KDE haben als Elternprozess init (PPID 1) und nicht den kdeinit...
- Eterm hat standardmäßig eine ungeschickte WM_CLASS:
0x03200041 1 Eterm 0.9.4.Eterm genlap2 oliver@genlap2:/usr/local/bin
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum