Menu

D-Bus

Manual (7)
Konrad Twardowski

Run "qdbus net.sf.kshutdown" to display all D-Bus commands.

qdbus net.sf.kshutdown /kshutdown

method QStringList net.sf.kshutdown.MainWindow.actionList(bool showDescription)

Returns a list of available action names.

Example 1:

qdbus net.sf.kshutdown /kshutdown actionList true

Output 1:

extras - Extras
hibernate - Hibernate Computer
test - Test Action (does nothing)
reboot - Restart Computer
suspend - Suspend Computer (Sleep)
shutdown - Turn Off Computer
logout - Logout
lock - Lock Screen

Example 2:

$ qdbus net.sf.kshutdown /kshutdown actionList false

Output 2:

extras
hibernate
test
reboot
suspend
shutdown
logout
lock

method QStringList net.sf.kshutdown.MainWindow.triggerList(bool showDescription)

Returns a list of available trigger/event names.

Example 1:

$ qdbus net.sf.kshutdown /kshutdown triggerList true

Output 1:

idle-monitor - On User Inactivity (HH:MM)
process-monitor - When selected application exit
time-from-now - Time From Now (HH:MM)
date-time - At Date/Time
no-delay - No Delay

Example 2:

$ qdbus net.sf.kshutdown /kshutdown triggerList false

Output 2:

idle-monitor
process-monitor
time-from-now
date-time
no-delay

method bool net.sf.kshutdown.MainWindow.active()

Returns true if countdown is active; otherwise false.

method void net.sf.kshutdown.MainWindow.setActive(bool yes)

Start/stop countdown.

Example 1 (same as the OK button click):

$ qdbus net.sf.kshutdown /kshutdown setActive true

Example 2 (same as the Cancel button click):

$ qdbus net.sf.kshutdown /kshutdown setActive false

method void net.sf.kshutdown.MainWindow.setSelectedAction(QString id)

Selects an action identified by id,
where id is a one of the names listed by the "actionList false".

Example:

$ qdbus net.sf.kshutdown /kshutdown setSelectedAction lock

method void net.sf.kshutdown.MainWindow.setSelectedTrigger(QString id)

Selects a time/event/trigger identified by id,
where id is a one of the names listed by "triggerList false".

Example:

$ qdbus net.sf.kshutdown /kshutdown setSelectedTrigger time-from-now

method void net.sf.kshutdown.MainWindow.setTime(QString trigger, QString time)

Sets the "time" and activates the countdown.

  • trigger - one of the names listed by "triggerList false"
  • time - a time in HH:MM format (with leading zero)

Example:

$ qdbus net.sf.kshutdown /kshutdown setTime time-from-now 01:30

method void net.sf.kshutdown.MainWindow.setExtrasCommand(QString command)

Same as the --extra command line option.

method void net.sf.kshutdown.MainWindow.setWaitForProcess(qlonglong pid)

Activates the "When selected application exit" trigger.

  • pid - the Process ID

Example:

$ qdbus net.sf.kshutdown /kshutdown setWaitForProcess `pidof wget`

Examples

Wait for wget and hibernate

$ qdbus net.sf.kshutdown /kshutdown setSelectedAction hibernate
$ qdbus net.sf.kshutdown /kshutdown setWaitForProcess `pidof wget`

Hide/show main window

$ qdbus net.sf.kshutdown /kshutdown/main_window hide
$ qdbus net.sf.kshutdown /kshutdown/main_window show

Quit KShutdown

$ qdbus net.sf.kshutdown /MainApplication quit

See Also

[Command Line]
[FAQ]


Related

Wiki: Command Line
Wiki: Extras
Wiki: FAQ

Monday.com Logo