Toon posts:

[KDE] gebruiker extern afmelden

Pagina: 1
Acties:

Verwijderd

Topicstarter
Weet iemand met welk commando een KDE sessie van een gebruiker vanuit de console (dus ook extern) beëindigd kan worden?

Alvast bedankt!

  • DeMoN
  • Registratie: Maart 2001
  • Laatst online: 06-01 23:13

DeMoN

Pastafari

How do I logout (end session) from KDE using command line (script)?
One command:

dcop kdesktop default logout


And is there a way to skip this dialog (ie logout with no confirmation)?

dcop ksmserver default logout 0 -1 -1
edit: bron

[ Voor 16% gewijzigd door DeMoN op 31-03-2006 12:47 ]

Gamertag: Cosmicv0id
"Het woord Gods is voor mij niets meer dan een expressie en het product van menselijke zwakheid. De Bijbel is een verzamelwerk van legendes die achtenswaardig zijn maar ook primitief en kinderachtig.'' - Albert Einstein


Verwijderd

Topicstarter
Thanks!

Verwijderd

Let op, dat dcop-commando werkt alleen als je als die gebruiker bent ingelogd. Je kunt er dus geen kde-desktops van willekeurige gebruikers (bijv. als root) mee afsluiten.

Zie ook http://docs.kde.org/stabl...erguide/kde-diy.html#dcop voor meer info over dcop.

Om dcop remote aan te roepen, moet je eerst even je omgevingsvariabele voor $DISPLAY goed zetten.
Hoe je dcop-aanroepen naar een andere gebruiker stuurt weet ik niet.

  • daft_dutch
  • Registratie: December 2003
  • Laatst online: 02-12-2025

daft_dutch

>.< >.< >.< >.<

Rinse dat is niet waar. met dcop kan je --all-sessions --allusers mee geven moet je wel root volgens zijn
ik past wel ff me hele power button script.
code:
1
2
3
4
5
6
7
#!/bin/sh
if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
then
    dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0
else
    /sbin/shutdown -h now "Power button pressed"
fi

>.< >.< >.< >.<


Verwijderd

Ah, TNX
Die wist ik nog niet!!

  • daft_dutch
  • Registratie: December 2003
  • Laatst online: 02-12-2025

daft_dutch

>.< >.< >.< >.<

zit bij debian standaard bij het pakketje acpid
kan je weer lekker op je power knop drukken om alles netjes af te sluiten

>.< >.< >.< >.<


  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

mja dan trek je meer dan 1 user onderuit :P

Zaram module kopen voor je glasvezelaansluiting?


Verwijderd

Yep, maar als je alle sessies in 1 x kunt beëindigen, dan is er vast ook een dcop-commando waarmee je specifieke sessies kunt beëindigen.

Hier een uitvoer van dcop --help:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
dcop --help
Usage: dcop [options] [application [object [function [arg1] [arg2] ... ] ] ]

Console DCOP client

Generic options:
  --help          Show help about options

Options:
  --pipe          Call DCOP for each line read from stdin. The string '%1'
                  will be used in the argument list as a placeholder for
                  the substituted line.
                  For example,
                      dcop --pipe konqueror html-widget1 evalJS %1
                  is equivalent to calling
                      while read line ; do
                          dcop konqueror html-widget1 evalJS "$line"
                      done
                  in bash, but because no new dcop instance has to be started
                  for each line this is generally much faster, especially for
                  the slower GNU dynamic linkers.
                  The '%1' placeholder cannot be used to replace e.g. the
                  program, object or method name.
  --user <user>   Connect to the given user's DCOP server. This option will
                  ignore the values of the environment vars $DCOPSERVER and
                  $ICEAUTHORITY, even if they are set.
                  If the user has more than one open session, you must also
                  use one of the --list-sessions, --session or --all-sessions
                  command-line options.
  --all-users     Send the same DCOP call to all users with a running DCOP
                  server. Only failed calls to existing DCOP servers will
                  generate an error message. If no DCOP server is available
                  at all, no error will be generated.
  --session <ses> Send to the given KDE session. This option can only be
                  used in combination with the --user option.
  --all-sessions  Send to all sessions found. Only works with the --user
                  and --all-users options.
  --list-sessions List all active KDE session for a user or all users.
  --no-user-time  Don't update the user activity timestamp in the called
                  application (for usage in scripts running
                  in the background).


dcop heeft tegenwoordig iig een stuk meer mogelijkheden dan ik had verwacht :)
Pagina: 1