We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2014-04-17 16:55:32 +0200

Taking screenshot with simple D-Bus command

dbus-send

dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png"

qdbus (qt5-qttools-qdbus)

/usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png"

Taking screenshot with simple D-Bus command

dbus-send

dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png"

qdbus (qt5-qttools-qdbus)

/usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png"

Qt

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick,
                               "/org/nemomobile/lipstick/screenshot",
                              "org.nemomobile.lipstick",
                               QDBusConnection::sessionBus(),
                               this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));

Taking screenshot with simple D-Bus command

dbus-send

dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png"

qdbus (qt5-qttools-qdbus)

/usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png"

Qt

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick,
QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                               "org.nemomobile.lipstick",
                                QDBusConnection::sessionBus(),
                                this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));

Taking HOWTO: Take a screenshot with simple D-Bus commandfrom the command line

There are a couple of apps available on the Jolla store that will let you take screenshots via the interface, but occasionally you may want/need to capture the screen from the command line, particularly over SSH. The easiest way to do it is to use dbus to send a message to lipstick, the UX manager. It should work on both SailfishOS and Nemomobile, and on all devices.

Here are two ways to do it on the command-line, over SSH or to be included in a shell script:

  1. Using dbus-send

    dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png" string:"/home/nemo/Pictures/Screenshot-date +%d-%m-%y-%H-%M-%S

    .png"

  2. Using qdbus (qt5-qttools-qdbus)

    (from the qt5-qttools-qdbus package)

    /usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-`date +%d-%m-%y-%H-%M-%S`.png" "/home/nemo/Pictures/Screenshot-date +%d-%m-%y-%H-%M-%S

    Qt.png"

The code-snippet below shows how you'd also achieve the same in Qt directly

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                                           "org.nemomobile.lipstick",
                                           QDBusConnection::sessionBus(),
                                           this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));

HOWTO: Take a screenshot from the command line

There are a couple of apps available on the Jolla store that will let you take screenshots via the interface, but occasionally you may want/need to capture the screen from the command line, particularly over SSH. The easiest way to do it is to use dbus to send a message to lipstick, the UX manager. It should work on both SailfishOS and Nemomobile, and on all devices.

Here are two ways to do it on the command-line, over SSH or to be included in a shell script:

  1. Using dbus-send

    dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-date +%d-%m-%y-%H-%M-%S.png"

  2. Using qdbus (from the qt5-qttools-qdbus package)

    /usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-date +%d-%m-%y-%H-%M-%S.png"

The code-snippet below shows how you'd also achieve the same in Qt directly

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                                           "org.nemomobile.lipstick",
                                           QDBusConnection::sessionBus(),
                                           this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));

HOWTO: Take a screenshot from the command line

There are a couple of apps available on the Jolla store that will let you take screenshots via the interface, but occasionally you may want/need to capture the screen from the command line, particularly over SSH. The easiest way to do it is to use dbus to send a message to lipstick, the UX manager. It should work on both SailfishOS and Nemomobile, and on all devices.

Here are two ways to do it on the command-line, over SSH or to be included in a shell script:

  1. Using dbus-send

    dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-date +%d-%m-%y-%H-%M-%Sstring:"/home/nemo/Pictures/Screenshot-$(date +%d-%m-%y-%H-%M-%S).png".png"

  2. Using qdbus (from the qt5-qttools-qdbus package)

    /usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-date +%d-%m-%y-%H-%M-%S"/home/nemo/Pictures/Screenshot-$(date +%d-%m-%y-%H-%M-%S).png".png"

The code-snippet below shows how you'd also achieve the same in Qt directlydirectly:

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                                           "org.nemomobile.lipstick",
                                           QDBusConnection::sessionBus(),
                                           this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));
QString("/home/nemo/Pictures/Screenshot-%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));

HOWTO: Take a screenshot from the command line

There are a couple of apps available on the Jolla store that will let you take screenshots via the interface, but occasionally you may want/need to capture the screen from the command line, particularly over SSH. The easiest way to do it is to use dbus to send a message to lipstick, the UX manager. It should work on both SailfishOS and Nemomobile, and on all devices.

Here are two ways to do it on the command-line, over SSH or to be included in a shell script:

  1. Using dbus-send

    dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-$(date +%d-%m-%y-%H-%M-%S).png"

  2. Using qdbus (from the qt5-qttools-qdbus package)

    /usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-$(date +%d-%m-%y-%H-%M-%S).png"

The code-snippet below shows how you'd also achieve the same in Qt directly:

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                                           "org.nemomobile.lipstick",
                                           QDBusConnection::sessionBus(),
                                           this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/Screenshot-%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));

HOWTO: Take a screenshot from the command line

There are a couple of apps available on the Jolla store that will let you take screenshots via the interface, but occasionally you may want/need to capture the screen from the command line, particularly over SSH. The easiest way to do it is to use dbus to send a message to lipstick, the UX manager. It should work on both SailfishOS and Nemomobile, and on all devices.

Here are two ways to do it on the command-line, over SSH or to be included in a shell script:

  1. Using dbus-send

    dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-$(date +%d-%m-%y-%H-%M-%S).png"+%y-%m-%d-%H-%M-%S).png"

  2. Using qdbus (from the qt5-qttools-qdbus package)

    /usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-$(date +%d-%m-%y-%H-%M-%S).png"+%y-%m-%d-%H-%M-%S).png"

The code-snippet below shows how you'd also achieve the same in Qt directly:

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                                           "org.nemomobile.lipstick",
                                           QDBusConnection::sessionBus(),
                                           this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/Screenshot-%1.png").arg(QDateTime::currentDateTime().toString("dd-MM-yy-hh-mm-ss")));
QString("/home/nemo/Pictures/Screenshot-%1.png").arg(QDateTime::currentDateTime().toString("yy-MM-dd-hh-mm-ss")));

HOWTO: Take a screenshot from the command line

There are a couple of apps available on the Jolla store that will let you take screenshots via the interface, but occasionally you may want/need to capture the screen from the command line, particularly over SSH. The easiest way to do it is to use dbus to send a message to lipstick, the UX manager. It should work on both SailfishOS and Nemomobile, and on all devices.

Here are two ways to do it on the command-line, over SSH or to be included in a shell script:

  1. Using dbus-send

    dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-$(date +%y-%m-%d-%H-%M-%S).png"

  2. Using qdbus (from the qt5-qttools-qdbus package)

    /usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-$(date +%y-%m-%d-%H-%M-%S).png"

  3. Using grabscreen

    grabscreen

The code-snippet below shows how you'd also achieve the same in Qt directly:

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                                           "org.nemomobile.lipstick",
                                           QDBusConnection::sessionBus(),
                                           this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/Screenshot-%1.png").arg(QDateTime::currentDateTime().toString("yy-MM-dd-hh-mm-ss")));

HOWTO: Take a screenshot from the command line

There are a couple of apps available on the Jolla store that will let you take screenshots via the interface, but occasionally you may want/need to capture the screen from the command line, particularly over SSH. The easiest way to do it is to use dbus to send a message to lipstick, the UX manager. It should work on both SailfishOS and Nemomobile, and on all devices.

Here are two ways to do it on the command-line, over SSH or to be included in a shell script:

  1. Using dbus-send

    dbus-send --session --print-reply --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:"/home/nemo/Pictures/Screenshot-$(date +%y-%m-%d-%H-%M-%S).png"

  2. Using qdbus (from the qt5-qttools-qdbus package)

    /usr/lib/qt5/bin/qdbus org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot "/home/nemo/Pictures/Screenshot-$(date +%y-%m-%d-%H-%M-%S).png"

  3. Using grabscreen

    grabscreengrabscreen "/home/nemo/Pictures/Screenshot-$(date +%y-%m-%d-%H-%M-%S).png"

The code-snippet below shows how you'd also achieve the same in Qt directly:

QDBusInterface *iface = new QDBusInterface("org.nemomobile.lipstick",
                                           "/org/nemomobile/lipstick/screenshot",
                                           "org.nemomobile.lipstick",
                                           QDBusConnection::sessionBus(),
                                           this);
iface->call(QDBus::NoBlock, "saveScreenshot", QString("/home/nemo/Pictures/Screenshot-%1.png").arg(QDateTime::currentDateTime().toString("yy-MM-dd-hh-mm-ss")));