diff --git a/.travis.yml b/.travis.yml index 938db1e..c23b80f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,14 +13,14 @@ script: - export CWD=`pwd` - mkdir $CWD/qt5 - cd $CWD/qt5 - - qmake -qt=qt5 CONFIG+=release PREFIX=/usr .. + - qmake -qt=qt5 CONFIG+=release CONFIG+=install_lib PREFIX=/usr .. - make - make INSTALL_ROOT=`pwd`/pkg install - tree pkg - cd $CWD - mkdir $CWD/qt4 - cd $CWD/qt4 - - qmake -qt=qt4 CONFIG+=release PREFIX=/usr .. + - qmake -qt=qt4 CONFIG+=release CONFIG+=bundle_icons PREFIX=/usr .. - make - make INSTALL_ROOT=`pwd`/pkg install - tree pkg diff --git a/ChangeLog b/ChangeLog index 1c847f3..e6970ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,2 +1,6 @@ +## 1.0.0rc2 - 20181103 + * Added more configuration options + * Added option to bundle failsafe icons + ## 1.0.0rc1 - 20181025 * first public release diff --git a/LICENSE b/LICENSE index 4ac1353..da62f36 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ -PowerKit Copyright (c) 2018, Ole-André Rodlie All rights reserved. diff --git a/README.md b/README.md index f2da013..daae43d 100644 --- a/README.md +++ b/README.md @@ -106,16 +106,13 @@ powerkit requires the following dependencies to work: * [ConsoleKit](https://www.freedesktop.org/wiki/Software/ConsoleKit/) (or logind) * [UPower](https://upower.freedesktop.org/) 0.9.23(+) * [XScreenSaver](https://www.jwz.org/xscreensaver/) - * [adwaita-icon-theme](https://github.com/GNOME/adwaita-icon-theme) (or similar) + * [adwaita-icon-theme](https://github.com/GNOME/adwaita-icon-theme) (if built without ``CONFIG+=bundle_icons``) ### Icons -powerkit does not bundle any icons, so you will need a compatible theme installed. powerkit will use the existing icon theme from your running DE/WM or fallback to a known theme: +powerkit will use the existing icon theme from the running DE/WM, else check the GTK settings then fallback to Adwaita if no theme was found. So you should have (a proper version) of Adwaita installed or enable ``CONFIG+=bundle_icons`` when building powerkit. - * Adwaita - * Gnome - * Oxygen - * Tango (not recommended) +You can override the icon theme in the `~/.config/powerkit/powerkit.conf` file, see ``icon_theme=``. ## Build @@ -137,6 +134,7 @@ First make sure you have the required dependencies installed, then review the bu * **``CONFIG+=install_lib``**: Build and install shared library. * **``CONFIG+=no_include_install``**: Do not install include files. * **``CONFIG+=no_pkgconfig_install``**: Do not install pkgconfig file. + * **``CONFIG+=bundle_icons``**: Bundle a set of fallback icons (Adwaita), this will add 200k to the binary size. ### Build application diff --git a/app/app.pro b/app/app.pro index 0c6ccf9..25816e7 100644 --- a/app/app.pro +++ b/app/app.pro @@ -14,6 +14,7 @@ TEMPLATE = app SOURCES += main.cpp systray.cpp dialog.cpp common.cpp HEADERS += systray.h dialog.h common.h + LIBS += -L../lib -lPowerKit INCLUDEPATH += ../lib @@ -21,12 +22,18 @@ include(../powerkit.pri) DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" DEFINES += APP_VERSION_EXTRA=\"\\\"$${VERSION_EXTRA}\\\"\" +CONFIG(bundle_icons) { + RESOURCES += icons.qrc + DEFINES += BUNDLE_ICONS +} !CONFIG(no_app_install) { target.path = $${PREFIX}/bin INSTALLS += target !CONFIG(no_doc_install) { target_docs.path = $${DOCDIR}/$${TARGET}-$${VERSION}$${VERSION_EXTRA} target_docs.files = ../LICENSE ../README.md ../ChangeLog + CONFIG(bundle_icons): target_docs.files += icons/Adwaita/LICENSE.Adwaita + exists(../ChangeLog.git): target_docs.files += ../ChangeLog.git INSTALLS += target_docs } !CONFIG(no_man_install) { diff --git a/app/common.cpp b/app/common.cpp index 46e026b..4b4d809 100644 --- a/app/common.cpp +++ b/app/common.cpp @@ -82,6 +82,12 @@ void Common::saveDefaultSettings() true); savePowerSettings(CONF_NOTIFY_ON_AC, true); + savePowerSettings(CONF_BACKLIGHT_MOUSE_WHEEL, + true); + savePowerSettings(CONF_SUSPEND_LOCK_SCREEN, + true); + savePowerSettings(CONF_RESUME_LOCK_SCREEN, + false); } void Common::setIconTheme() @@ -90,59 +96,43 @@ void Common::setIconTheme() QStringList iconsPath = QIcon::themeSearchPaths(); QString iconsHomeLocal = QString("%1/.local/share/icons").arg(QDir::homePath()); QString iconsHome = QString("%1/.icons").arg(QDir::homePath()); - if (QFile::exists(iconsHomeLocal) && !iconsPath.contains(iconsHomeLocal)) { iconsPath.prepend(iconsHomeLocal); } - if (QFile::exists(iconsHome) && !iconsPath.contains(iconsHome)) { iconsPath.prepend(iconsHome); } + if (QFile::exists(iconsHomeLocal) && + !iconsPath.contains(iconsHomeLocal)) { iconsPath.prepend(iconsHomeLocal); } + if (QFile::exists(iconsHome) && + !iconsPath.contains(iconsHome)) { iconsPath.prepend(iconsHome); } iconsPath << QString("%1/../share/icons").arg(qApp->applicationDirPath()); QIcon::setThemeSearchPaths(iconsPath); qDebug() << "using icon theme search path" << QIcon::themeSearchPaths(); QString theme = QIcon::themeName(); if (theme.isEmpty() || theme == "hicolor") { // try to load saved theme - qDebug() << "checking for icon theme in settings"; - theme = loadPowerSettings("icon_theme").toString(); + theme = loadPowerSettings(CONF_ICON_THEME).toString(); } if(theme.isEmpty() || theme == "hicolor") { // Nope, then scan for first available // gtk if(QFile::exists(QDir::homePath() + "/" + ".gtkrc-2.0")) { - qDebug() << "checking for icon theme in gtkrc-2.0"; QSettings gtkFile(QDir::homePath() + "/.gtkrc-2.0", QSettings::IniFormat); theme = gtkFile.value("gtk-icon-theme-name").toString().remove("\""); } else { - qDebug() << "checking for icon theme in gtk-3.0"; QSettings gtkFile(QDir::homePath() + "/.config/gtk-3.0/settings.ini", QSettings::IniFormat); theme = gtkFile.value("gtk-fallback-icon-theme").toString().remove("\""); } // fallback - if(theme.isNull()) { - qDebug() << "checking for icon theme in static fallback"; - QStringList themes; - themes << QString("%1/../share/icons/Humanity").arg(qApp->applicationFilePath()); - themes << "/usr/share/icons/Humanity" << "/usr/local/share/icons/Humanity"; - themes << QString("%1/../share/icons/Adwaita").arg(qApp->applicationFilePath()); - themes << "/usr/share/icons/Adwaita" << "/usr/local/share/icons/Adwaita"; - themes << QString("%1/../share/icons/gnome").arg(qApp->applicationFilePath()); - themes << "/usr/share/icons/gnome" << "/usr/local/share/icons/gnome"; - themes << QString("%1/../share/icons/oxygen").arg(qApp->applicationFilePath()); - themes << "/usr/share/icons/oxygen" << "/usr/local/share/icons/oxygen"; - themes << QString("%1/../share/icons/hicolor").arg(qApp->applicationFilePath()); - themes << QString("%1/../share/icons/Tango").arg(qApp->applicationFilePath()); - themes << "/usr/share/icons/Tango" << "/usr/local/share/icons/Tango"; - themes << "/usr/share/icons/hicolor" << "/usr/local/share/icons/hicolor"; - for (int i=0;isetToolTip(tr("Disable lid action if an external monitor is connected" " to your laptop.")); + backlightMouseWheel = new QCheckBox(this); + backlightMouseWheel->setIcon(QIcon::fromTheme(DEFAULT_TRAY_ICON)); + backlightMouseWheel->setText(tr("Adjust backlight in system tray")); + backlightMouseWheel->setToolTip(tr("Adjust the display backlight with the mouse wheel on the system tray icon.")); + daemonContainerLayout->addWidget(showSystemTray); daemonContainerLayout->addWidget(showNotifications); daemonContainerLayout->addWidget(disableLidAction); + daemonContainerLayout->addWidget(backlightMouseWheel); + + // screensaver + QGroupBox *ssContainer = new QGroupBox(this); + ssContainer->setTitle(tr("Screensaver")); + QVBoxLayout *ssContainerLayout = new QVBoxLayout(ssContainer); + + suspendLockScreen = new QCheckBox(this); + suspendLockScreen->setIcon(QIcon::fromTheme(DEFAULT_LOCK_ICON)); + suspendLockScreen->setText(tr("Lock screen on suspend")); + suspendLockScreen->setToolTip(tr("Lock the screen before suspending the computer")); + + resumeLockScreen = new QCheckBox(this); + resumeLockScreen->setIcon(QIcon::fromTheme(DEFAULT_LOCK_ICON)); + resumeLockScreen->setText(tr("Lock screen on resume")); + resumeLockScreen->setToolTip(tr("Lock the screen before resuming the computer.")); + + ssContainerLayout->addWidget(suspendLockScreen); + ssContainerLayout->addWidget(resumeLockScreen); // notify QGroupBox *notifyContainer = new QGroupBox(this); @@ -563,6 +590,7 @@ Dialog::Dialog(QWidget *parent) settingsLayout->addWidget(batteryContainer); settingsLayout->addWidget(acContainer); settingsLayout->addWidget(daemonContainer); + settingsLayout->addWidget(ssContainer); settingsLayout->addWidget(notifyContainer); settingsLayout->addWidget(advContainer); settingsLayout->addStretch(); @@ -653,6 +681,12 @@ Dialog::Dialog(QWidget *parent) this, SLOT(handleNotifyBattery(bool))); connect(notifyOnAC, SIGNAL(toggled(bool)), this, SLOT(handleNotifyAC(bool))); + connect(backlightMouseWheel, SIGNAL(toggled(bool)), + this, SLOT(handleBacklightMouseWheel(bool))); + connect(suspendLockScreen, SIGNAL(toggled(bool)), + this, SLOT(handleSuspendLockScreen(bool))); + connect(resumeLockScreen, SIGNAL(toggled(bool)), + this, SLOT(handleResumeLockScreen(bool))); } Dialog::~Dialog() @@ -834,6 +868,18 @@ void Dialog::loadSettings() } notifyOnAC->setChecked(defaultNotifyOnAC); + bool defaultSuspendLockScreen = true; + if (Common::validPowerSettings(CONF_SUSPEND_LOCK_SCREEN)) { + defaultSuspendLockScreen = Common::loadPowerSettings(CONF_SUSPEND_LOCK_SCREEN).toBool(); + } + suspendLockScreen->setChecked(defaultSuspendLockScreen); + + bool defaultResumeLockScreen = false; + if (Common::validPowerSettings(CONF_RESUME_LOCK_SCREEN)) { + defaultResumeLockScreen = Common::loadPowerSettings(CONF_RESUME_LOCK_SCREEN).toBool(); + } + resumeLockScreen->setChecked(defaultResumeLockScreen); + // power actions bool canSuspend = man->CanSuspend(); bool canHibernate = man->CanHibernate() && Common::kernelCanResume(); @@ -901,6 +947,11 @@ void Dialog::loadSettings() Common::loadPowerSettings(CONF_BACKLIGHT_AC_DISABLE_IF_HIGHER) .toBool()); } + bool defaultBacklightMouseWheel = true; + if (Common::validPowerSettings(CONF_BACKLIGHT_MOUSE_WHEEL)) { + defaultBacklightMouseWheel = Common::loadPowerSettings(CONF_BACKLIGHT_MOUSE_WHEEL).toBool(); + } + backlightMouseWheel->setChecked(defaultBacklightMouseWheel); enableBacklight(hasBacklight); enableLid(man->LidIsPresent()); @@ -962,6 +1013,12 @@ void Dialog::saveSettings() notifyOnBattery->isChecked()); Common::savePowerSettings(CONF_NOTIFY_ON_AC, notifyOnAC->isChecked()); + Common::savePowerSettings(CONF_BACKLIGHT_MOUSE_WHEEL, + backlightMouseWheel->isChecked()); + Common::savePowerSettings(CONF_SUSPEND_LOCK_SCREEN, + suspendLockScreen->isChecked()); + Common::savePowerSettings(CONF_RESUME_LOCK_SCREEN, + resumeLockScreen->isChecked()); } // set default action in combobox @@ -1248,15 +1305,15 @@ void Dialog::checkDevices() devicesProg[uid] = new QProgressBar(this); devicesProg[uid]->setMinimum(0); devicesProg[uid]->setMaximum(100); - devicesProg[uid]->setValue(i.value()->percentage); + devicesProg[uid]->setValue((int)i.value()->percentage); deviceTree->setItemWidget(item, 1, devicesProg[uid]); } else { - devicesProg[i.value()->path]->setValue(i.value()->percentage); + devicesProg[i.value()->path]->setValue((int)i.value()->percentage); } } QIcon icon = QIcon::fromTheme(DEFAULT_AC_ICON); - if (left == 0 || !man->HasBattery()) { + if (left <1 || !man->HasBattery()) { batteryIcon->setPixmap(icon.pixmap(QSize(48, 48))); return; } @@ -1270,7 +1327,7 @@ void Dialog::checkDevices() icon = QIcon::fromTheme(man->OnBattery()?DEFAULT_BATTERY_ICON_FULL:DEFAULT_BATTERY_ICON_FULL_AC); } else { icon = QIcon::fromTheme(man->OnBattery()?DEFAULT_BATTERY_ICON_FULL:DEFAULT_BATTERY_ICON_CHARGED); - if (left == 100 && !man->OnBattery()) { + if (left > 99 && !man->OnBattery()) { icon = QIcon::fromTheme(DEFAULT_AC_ICON); } } @@ -1373,7 +1430,7 @@ void Dialog::getInhibitors() QTreeWidgetItem *item = new QTreeWidgetItem(inhibitorTree); item->setText(0, inhibitor); item->setFlags(Qt::ItemIsEnabled); - item->setIcon(0, QIcon::fromTheme("application-x-executable")); + item->setIcon(0, QIcon::fromTheme(DEFAULT_TRAY_ICON)); } for (int i=0;isetText(0, inhibitor); item->setFlags(Qt::ItemIsEnabled); - item->setIcon(0, QIcon::fromTheme("application-x-executable")); + item->setIcon(0, QIcon::fromTheme(DEFAULT_TRAY_ICON)); } } @@ -1396,6 +1453,7 @@ void Dialog::enableBacklight(bool enabled) backlightACHigherCheck->setEnabled(enabled); batteryBacklightLabel->setEnabled(enabled); acBacklightLabel->setEnabled(enabled); + backlightMouseWheel->setEnabled(enabled); } void Dialog::showAboutDialog() @@ -1421,6 +1479,13 @@ void Dialog::showAboutDialog() .arg(tr("file for full details.")) .arg(tr("Available on")) .arg(tr("and"))); +#ifdef BUNDLE_ICONS + about.setDetailedText(tr("Includes icons from the GNOME project .\n\n" + "This work is licenced under the Creative Commons Attribution-Share Alike 3.0 " + "United States License.\n\nTo view a copy of this licence, visit " + "http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative " + "Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.")); +#endif about.exec(); } @@ -1452,3 +1517,18 @@ void Dialog::enableLid(bool enabled) lidActionBatteryLabel->setEnabled(enabled); disableLidAction->setEnabled(enabled); } + +void Dialog::handleBacklightMouseWheel(bool triggered) +{ + Common::savePowerSettings(CONF_BACKLIGHT_MOUSE_WHEEL, triggered); +} + +void Dialog::handleSuspendLockScreen(bool triggered) +{ + Common::savePowerSettings(CONF_SUSPEND_LOCK_SCREEN, triggered); +} + +void Dialog::handleResumeLockScreen(bool triggered) +{ + Common::savePowerSettings(CONF_RESUME_LOCK_SCREEN, triggered); +} diff --git a/app/dialog.h b/app/dialog.h index d49d6cd..d2ab86b 100644 --- a/app/dialog.h +++ b/app/dialog.h @@ -109,6 +109,9 @@ class Dialog : public QDialog QLabel *lidActionBatteryLabel; QLabel *batteryBacklightLabel; QLabel *acBacklightLabel; + QCheckBox *backlightMouseWheel; + QCheckBox *suspendLockScreen; + QCheckBox *resumeLockScreen; private slots: void populate(); @@ -158,6 +161,9 @@ private slots: void handleNotifyBattery(bool triggered); void handleNotifyAC(bool triggered); void enableLid(bool enabled); + void handleBacklightMouseWheel(bool triggered); + void handleSuspendLockScreen(bool triggered); + void handleResumeLockScreen(bool triggered); }; #endif // DIALOG_H diff --git a/app/icons.qrc b/app/icons.qrc new file mode 100644 index 0000000..aac594a --- /dev/null +++ b/app/icons.qrc @@ -0,0 +1,140 @@ + + + icons/Adwaita/16x16/actions/system-hibernate.png + icons/Adwaita/16x16/actions/system-lock-screen.png + icons/Adwaita/16x16/actions/system-log-out.png + icons/Adwaita/16x16/actions/system-shutdown.png + icons/Adwaita/16x16/actions/system-suspend.png + icons/Adwaita/16x16/categories/preferences-other.png + icons/Adwaita/16x16/devices/ac-adapter.png + icons/Adwaita/16x16/devices/battery.png + icons/Adwaita/16x16/devices/input-keyboard.png + icons/Adwaita/16x16/devices/input-mouse.png + icons/Adwaita/16x16/devices/video-display.png + icons/Adwaita/16x16/emblems/emblem-unreadable.png + icons/Adwaita/16x16/status/battery-caution-charging.png + icons/Adwaita/16x16/status/battery-caution.png + icons/Adwaita/16x16/status/battery-empty.png + icons/Adwaita/16x16/status/battery-full-charged.png + icons/Adwaita/16x16/status/battery-full-charging.png + icons/Adwaita/16x16/status/battery-full.png + icons/Adwaita/16x16/status/battery-good-charging.png + icons/Adwaita/16x16/status/battery-good.png + icons/Adwaita/16x16/status/battery-low-charging.png + icons/Adwaita/16x16/status/battery-low.png + icons/Adwaita/16x16/status/battery-missing.png + icons/Adwaita/16x16/status/dialog-information.png + icons/Adwaita/16x16/status/dialog-question.png + icons/Adwaita/16x16/status/user-available.png + icons/Adwaita/16x16/status/weather-clear.png + icons/Adwaita/22x22/actions/system-hibernate.png + icons/Adwaita/22x22/actions/system-lock-screen.png + icons/Adwaita/22x22/actions/system-log-out.png + icons/Adwaita/22x22/actions/system-shutdown.png + icons/Adwaita/22x22/actions/system-suspend.png + icons/Adwaita/22x22/categories/preferences-other.png + icons/Adwaita/22x22/devices/ac-adapter.png + icons/Adwaita/22x22/devices/battery.png + icons/Adwaita/22x22/devices/input-keyboard.png + icons/Adwaita/22x22/devices/input-mouse.png + icons/Adwaita/22x22/devices/video-display.png + icons/Adwaita/22x22/emblems/emblem-unreadable.png + icons/Adwaita/22x22/status/battery-caution-charging.png + icons/Adwaita/22x22/status/battery-caution.png + icons/Adwaita/22x22/status/battery-empty.png + icons/Adwaita/22x22/status/battery-full-charged.png + icons/Adwaita/22x22/status/battery-full-charging.png + icons/Adwaita/22x22/status/battery-full.png + icons/Adwaita/22x22/status/battery-good-charging.png + icons/Adwaita/22x22/status/battery-good.png + icons/Adwaita/22x22/status/battery-low-charging.png + icons/Adwaita/22x22/status/battery-low.png + icons/Adwaita/22x22/status/battery-missing.png + icons/Adwaita/22x22/status/dialog-information.png + icons/Adwaita/22x22/status/dialog-question.png + icons/Adwaita/22x22/status/user-available.png + icons/Adwaita/22x22/status/weather-clear.png + icons/Adwaita/24x24/actions/system-hibernate.png + icons/Adwaita/24x24/actions/system-lock-screen.png + icons/Adwaita/24x24/actions/system-log-out.png + icons/Adwaita/24x24/actions/system-shutdown.png + icons/Adwaita/24x24/actions/system-suspend.png + icons/Adwaita/24x24/categories/preferences-other.png + icons/Adwaita/24x24/devices/ac-adapter.png + icons/Adwaita/24x24/devices/battery.png + icons/Adwaita/24x24/devices/input-keyboard.png + icons/Adwaita/24x24/devices/input-mouse.png + icons/Adwaita/24x24/devices/video-display.png + icons/Adwaita/24x24/emblems/emblem-unreadable.png + icons/Adwaita/24x24/status/battery-caution-charging.png + icons/Adwaita/24x24/status/battery-caution.png + icons/Adwaita/24x24/status/battery-empty.png + icons/Adwaita/24x24/status/battery-full-charged.png + icons/Adwaita/24x24/status/battery-full-charging.png + icons/Adwaita/24x24/status/battery-full.png + icons/Adwaita/24x24/status/battery-good-charging.png + icons/Adwaita/24x24/status/battery-good.png + icons/Adwaita/24x24/status/battery-low-charging.png + icons/Adwaita/24x24/status/battery-low.png + icons/Adwaita/24x24/status/battery-missing.png + icons/Adwaita/24x24/status/dialog-information.png + icons/Adwaita/24x24/status/dialog-question.png + icons/Adwaita/24x24/status/user-available.png + icons/Adwaita/24x24/status/weather-clear.png + icons/Adwaita/32x32/actions/system-hibernate.png + icons/Adwaita/32x32/actions/system-lock-screen.png + icons/Adwaita/32x32/actions/system-log-out.png + icons/Adwaita/32x32/actions/system-shutdown.png + icons/Adwaita/32x32/actions/system-suspend.png + icons/Adwaita/32x32/categories/preferences-other.png + icons/Adwaita/32x32/devices/ac-adapter.png + icons/Adwaita/32x32/devices/battery.png + icons/Adwaita/32x32/devices/input-keyboard.png + icons/Adwaita/32x32/devices/input-mouse.png + icons/Adwaita/32x32/devices/video-display.png + icons/Adwaita/32x32/emblems/emblem-unreadable.png + icons/Adwaita/32x32/status/battery-caution-charging.png + icons/Adwaita/32x32/status/battery-caution.png + icons/Adwaita/32x32/status/battery-empty.png + icons/Adwaita/32x32/status/battery-full-charged.png + icons/Adwaita/32x32/status/battery-full-charging.png + icons/Adwaita/32x32/status/battery-full.png + icons/Adwaita/32x32/status/battery-good-charging.png + icons/Adwaita/32x32/status/battery-good.png + icons/Adwaita/32x32/status/battery-low-charging.png + icons/Adwaita/32x32/status/battery-low.png + icons/Adwaita/32x32/status/battery-missing.png + icons/Adwaita/32x32/status/dialog-information.png + icons/Adwaita/32x32/status/dialog-question.png + icons/Adwaita/32x32/status/user-available.png + icons/Adwaita/32x32/status/weather-clear.png + icons/Adwaita/48x48/actions/system-hibernate.png + icons/Adwaita/48x48/actions/system-lock-screen.png + icons/Adwaita/48x48/actions/system-log-out.png + icons/Adwaita/48x48/actions/system-shutdown.png + icons/Adwaita/48x48/actions/system-suspend.png + icons/Adwaita/48x48/categories/preferences-other.png + icons/Adwaita/48x48/devices/ac-adapter.png + icons/Adwaita/48x48/devices/battery.png + icons/Adwaita/48x48/devices/input-keyboard.png + icons/Adwaita/48x48/devices/input-mouse.png + icons/Adwaita/48x48/devices/video-display.png + icons/Adwaita/48x48/emblems/emblem-unreadable.png + icons/Adwaita/48x48/status/battery-caution-charging.png + icons/Adwaita/48x48/status/battery-caution.png + icons/Adwaita/48x48/status/battery-empty.png + icons/Adwaita/48x48/status/battery-full-charged.png + icons/Adwaita/48x48/status/battery-full-charging.png + icons/Adwaita/48x48/status/battery-full.png + icons/Adwaita/48x48/status/battery-good-charging.png + icons/Adwaita/48x48/status/battery-good.png + icons/Adwaita/48x48/status/battery-low-charging.png + icons/Adwaita/48x48/status/battery-low.png + icons/Adwaita/48x48/status/battery-missing.png + icons/Adwaita/48x48/status/dialog-information.png + icons/Adwaita/48x48/status/dialog-question.png + icons/Adwaita/48x48/status/user-available.png + icons/Adwaita/48x48/status/weather-clear.png + icons/Adwaita/index.theme + + diff --git a/app/icons/Adwaita/16x16/actions/system-hibernate.png b/app/icons/Adwaita/16x16/actions/system-hibernate.png new file mode 100644 index 0000000..a7da82a Binary files /dev/null and b/app/icons/Adwaita/16x16/actions/system-hibernate.png differ diff --git a/app/icons/Adwaita/16x16/actions/system-lock-screen.png b/app/icons/Adwaita/16x16/actions/system-lock-screen.png new file mode 100644 index 0000000..05e3bd8 Binary files /dev/null and b/app/icons/Adwaita/16x16/actions/system-lock-screen.png differ diff --git a/app/icons/Adwaita/16x16/actions/system-log-out.png b/app/icons/Adwaita/16x16/actions/system-log-out.png new file mode 100644 index 0000000..ea40957 Binary files /dev/null and b/app/icons/Adwaita/16x16/actions/system-log-out.png differ diff --git a/app/icons/Adwaita/16x16/actions/system-shutdown.png b/app/icons/Adwaita/16x16/actions/system-shutdown.png new file mode 100644 index 0000000..e20d8ec Binary files /dev/null and b/app/icons/Adwaita/16x16/actions/system-shutdown.png differ diff --git a/app/icons/Adwaita/16x16/actions/system-suspend.png b/app/icons/Adwaita/16x16/actions/system-suspend.png new file mode 100644 index 0000000..2e8fcc2 Binary files /dev/null and b/app/icons/Adwaita/16x16/actions/system-suspend.png differ diff --git a/app/icons/Adwaita/16x16/categories/preferences-other.png b/app/icons/Adwaita/16x16/categories/preferences-other.png new file mode 100644 index 0000000..26aa6e6 Binary files /dev/null and b/app/icons/Adwaita/16x16/categories/preferences-other.png differ diff --git a/app/icons/Adwaita/16x16/devices/ac-adapter.png b/app/icons/Adwaita/16x16/devices/ac-adapter.png new file mode 100644 index 0000000..cbd8284 Binary files /dev/null and b/app/icons/Adwaita/16x16/devices/ac-adapter.png differ diff --git a/app/icons/Adwaita/16x16/devices/battery.png b/app/icons/Adwaita/16x16/devices/battery.png new file mode 100644 index 0000000..3111404 Binary files /dev/null and b/app/icons/Adwaita/16x16/devices/battery.png differ diff --git a/app/icons/Adwaita/16x16/devices/input-keyboard.png b/app/icons/Adwaita/16x16/devices/input-keyboard.png new file mode 100644 index 0000000..aafa1ca Binary files /dev/null and b/app/icons/Adwaita/16x16/devices/input-keyboard.png differ diff --git a/app/icons/Adwaita/16x16/devices/input-mouse.png b/app/icons/Adwaita/16x16/devices/input-mouse.png new file mode 100644 index 0000000..4266677 Binary files /dev/null and b/app/icons/Adwaita/16x16/devices/input-mouse.png differ diff --git a/app/icons/Adwaita/16x16/devices/video-display.png b/app/icons/Adwaita/16x16/devices/video-display.png new file mode 100644 index 0000000..e0fa075 Binary files /dev/null and b/app/icons/Adwaita/16x16/devices/video-display.png differ diff --git a/app/icons/Adwaita/16x16/emblems/emblem-unreadable.png b/app/icons/Adwaita/16x16/emblems/emblem-unreadable.png new file mode 100644 index 0000000..8aa4a46 Binary files /dev/null and b/app/icons/Adwaita/16x16/emblems/emblem-unreadable.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-caution-charging.png b/app/icons/Adwaita/16x16/status/battery-caution-charging.png new file mode 100644 index 0000000..ae57414 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-caution-charging.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-caution.png b/app/icons/Adwaita/16x16/status/battery-caution.png new file mode 100644 index 0000000..4c9c132 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-caution.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-empty.png b/app/icons/Adwaita/16x16/status/battery-empty.png new file mode 100644 index 0000000..68b4d02 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-empty.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-full-charged.png b/app/icons/Adwaita/16x16/status/battery-full-charged.png new file mode 100644 index 0000000..6264182 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-full-charged.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-full-charging.png b/app/icons/Adwaita/16x16/status/battery-full-charging.png new file mode 100644 index 0000000..ee4e862 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-full-charging.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-full.png b/app/icons/Adwaita/16x16/status/battery-full.png new file mode 100644 index 0000000..1f1314f Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-full.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-good-charging.png b/app/icons/Adwaita/16x16/status/battery-good-charging.png new file mode 100644 index 0000000..4291d53 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-good-charging.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-good.png b/app/icons/Adwaita/16x16/status/battery-good.png new file mode 100644 index 0000000..4d21410 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-good.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-low-charging.png b/app/icons/Adwaita/16x16/status/battery-low-charging.png new file mode 100644 index 0000000..20f2d22 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-low-charging.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-low.png b/app/icons/Adwaita/16x16/status/battery-low.png new file mode 100644 index 0000000..4d00dc2 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-low.png differ diff --git a/app/icons/Adwaita/16x16/status/battery-missing.png b/app/icons/Adwaita/16x16/status/battery-missing.png new file mode 100644 index 0000000..56121af Binary files /dev/null and b/app/icons/Adwaita/16x16/status/battery-missing.png differ diff --git a/app/icons/Adwaita/16x16/status/dialog-information.png b/app/icons/Adwaita/16x16/status/dialog-information.png new file mode 100644 index 0000000..a90c024 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/dialog-information.png differ diff --git a/app/icons/Adwaita/16x16/status/dialog-question.png b/app/icons/Adwaita/16x16/status/dialog-question.png new file mode 100644 index 0000000..b8fe1ac Binary files /dev/null and b/app/icons/Adwaita/16x16/status/dialog-question.png differ diff --git a/app/icons/Adwaita/16x16/status/user-available.png b/app/icons/Adwaita/16x16/status/user-available.png new file mode 100644 index 0000000..eb67717 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/user-available.png differ diff --git a/app/icons/Adwaita/16x16/status/weather-clear.png b/app/icons/Adwaita/16x16/status/weather-clear.png new file mode 100644 index 0000000..112a667 Binary files /dev/null and b/app/icons/Adwaita/16x16/status/weather-clear.png differ diff --git a/app/icons/Adwaita/22x22/actions/system-hibernate.png b/app/icons/Adwaita/22x22/actions/system-hibernate.png new file mode 100644 index 0000000..30dbaad Binary files /dev/null and b/app/icons/Adwaita/22x22/actions/system-hibernate.png differ diff --git a/app/icons/Adwaita/22x22/actions/system-lock-screen.png b/app/icons/Adwaita/22x22/actions/system-lock-screen.png new file mode 100644 index 0000000..3b4a5b1 Binary files /dev/null and b/app/icons/Adwaita/22x22/actions/system-lock-screen.png differ diff --git a/app/icons/Adwaita/22x22/actions/system-log-out.png b/app/icons/Adwaita/22x22/actions/system-log-out.png new file mode 100644 index 0000000..63c0c02 Binary files /dev/null and b/app/icons/Adwaita/22x22/actions/system-log-out.png differ diff --git a/app/icons/Adwaita/22x22/actions/system-shutdown.png b/app/icons/Adwaita/22x22/actions/system-shutdown.png new file mode 100644 index 0000000..be4b42f Binary files /dev/null and b/app/icons/Adwaita/22x22/actions/system-shutdown.png differ diff --git a/app/icons/Adwaita/22x22/actions/system-suspend.png b/app/icons/Adwaita/22x22/actions/system-suspend.png new file mode 100644 index 0000000..6ebdfc6 Binary files /dev/null and b/app/icons/Adwaita/22x22/actions/system-suspend.png differ diff --git a/app/icons/Adwaita/22x22/categories/preferences-other.png b/app/icons/Adwaita/22x22/categories/preferences-other.png new file mode 100644 index 0000000..2619168 Binary files /dev/null and b/app/icons/Adwaita/22x22/categories/preferences-other.png differ diff --git a/app/icons/Adwaita/22x22/devices/ac-adapter.png b/app/icons/Adwaita/22x22/devices/ac-adapter.png new file mode 100644 index 0000000..07e2cf4 Binary files /dev/null and b/app/icons/Adwaita/22x22/devices/ac-adapter.png differ diff --git a/app/icons/Adwaita/22x22/devices/battery.png b/app/icons/Adwaita/22x22/devices/battery.png new file mode 100644 index 0000000..8c61bc8 Binary files /dev/null and b/app/icons/Adwaita/22x22/devices/battery.png differ diff --git a/app/icons/Adwaita/22x22/devices/input-keyboard.png b/app/icons/Adwaita/22x22/devices/input-keyboard.png new file mode 100644 index 0000000..0ff7c28 Binary files /dev/null and b/app/icons/Adwaita/22x22/devices/input-keyboard.png differ diff --git a/app/icons/Adwaita/22x22/devices/input-mouse.png b/app/icons/Adwaita/22x22/devices/input-mouse.png new file mode 100644 index 0000000..54298da Binary files /dev/null and b/app/icons/Adwaita/22x22/devices/input-mouse.png differ diff --git a/app/icons/Adwaita/22x22/devices/video-display.png b/app/icons/Adwaita/22x22/devices/video-display.png new file mode 100644 index 0000000..bdcb8fb Binary files /dev/null and b/app/icons/Adwaita/22x22/devices/video-display.png differ diff --git a/app/icons/Adwaita/22x22/emblems/emblem-unreadable.png b/app/icons/Adwaita/22x22/emblems/emblem-unreadable.png new file mode 100644 index 0000000..466046f Binary files /dev/null and b/app/icons/Adwaita/22x22/emblems/emblem-unreadable.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-caution-charging.png b/app/icons/Adwaita/22x22/status/battery-caution-charging.png new file mode 100644 index 0000000..856c91e Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-caution-charging.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-caution.png b/app/icons/Adwaita/22x22/status/battery-caution.png new file mode 100644 index 0000000..798af3f Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-caution.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-empty.png b/app/icons/Adwaita/22x22/status/battery-empty.png new file mode 100644 index 0000000..1b08ebb Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-empty.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-full-charged.png b/app/icons/Adwaita/22x22/status/battery-full-charged.png new file mode 100644 index 0000000..db67ec6 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-full-charged.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-full-charging.png b/app/icons/Adwaita/22x22/status/battery-full-charging.png new file mode 100644 index 0000000..22840df Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-full-charging.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-full.png b/app/icons/Adwaita/22x22/status/battery-full.png new file mode 100644 index 0000000..231e42d Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-full.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-good-charging.png b/app/icons/Adwaita/22x22/status/battery-good-charging.png new file mode 100644 index 0000000..3adb593 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-good-charging.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-good.png b/app/icons/Adwaita/22x22/status/battery-good.png new file mode 100644 index 0000000..2ca7bd4 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-good.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-low-charging.png b/app/icons/Adwaita/22x22/status/battery-low-charging.png new file mode 100644 index 0000000..4c4810f Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-low-charging.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-low.png b/app/icons/Adwaita/22x22/status/battery-low.png new file mode 100644 index 0000000..93ff293 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-low.png differ diff --git a/app/icons/Adwaita/22x22/status/battery-missing.png b/app/icons/Adwaita/22x22/status/battery-missing.png new file mode 100644 index 0000000..887d031 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/battery-missing.png differ diff --git a/app/icons/Adwaita/22x22/status/dialog-information.png b/app/icons/Adwaita/22x22/status/dialog-information.png new file mode 100644 index 0000000..00accf1 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/dialog-information.png differ diff --git a/app/icons/Adwaita/22x22/status/dialog-question.png b/app/icons/Adwaita/22x22/status/dialog-question.png new file mode 100644 index 0000000..ec07761 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/dialog-question.png differ diff --git a/app/icons/Adwaita/22x22/status/user-available.png b/app/icons/Adwaita/22x22/status/user-available.png new file mode 100644 index 0000000..12f43ff Binary files /dev/null and b/app/icons/Adwaita/22x22/status/user-available.png differ diff --git a/app/icons/Adwaita/22x22/status/weather-clear.png b/app/icons/Adwaita/22x22/status/weather-clear.png new file mode 100644 index 0000000..be95c91 Binary files /dev/null and b/app/icons/Adwaita/22x22/status/weather-clear.png differ diff --git a/app/icons/Adwaita/24x24/actions/system-hibernate.png b/app/icons/Adwaita/24x24/actions/system-hibernate.png new file mode 100644 index 0000000..0e11863 Binary files /dev/null and b/app/icons/Adwaita/24x24/actions/system-hibernate.png differ diff --git a/app/icons/Adwaita/24x24/actions/system-lock-screen.png b/app/icons/Adwaita/24x24/actions/system-lock-screen.png new file mode 100644 index 0000000..da3656b Binary files /dev/null and b/app/icons/Adwaita/24x24/actions/system-lock-screen.png differ diff --git a/app/icons/Adwaita/24x24/actions/system-log-out.png b/app/icons/Adwaita/24x24/actions/system-log-out.png new file mode 100644 index 0000000..66cb959 Binary files /dev/null and b/app/icons/Adwaita/24x24/actions/system-log-out.png differ diff --git a/app/icons/Adwaita/24x24/actions/system-shutdown.png b/app/icons/Adwaita/24x24/actions/system-shutdown.png new file mode 100644 index 0000000..f24a2f5 Binary files /dev/null and b/app/icons/Adwaita/24x24/actions/system-shutdown.png differ diff --git a/app/icons/Adwaita/24x24/actions/system-suspend.png b/app/icons/Adwaita/24x24/actions/system-suspend.png new file mode 100644 index 0000000..b99b98e Binary files /dev/null and b/app/icons/Adwaita/24x24/actions/system-suspend.png differ diff --git a/app/icons/Adwaita/24x24/categories/preferences-other.png b/app/icons/Adwaita/24x24/categories/preferences-other.png new file mode 100644 index 0000000..3a65fea Binary files /dev/null and b/app/icons/Adwaita/24x24/categories/preferences-other.png differ diff --git a/app/icons/Adwaita/24x24/devices/ac-adapter.png b/app/icons/Adwaita/24x24/devices/ac-adapter.png new file mode 100644 index 0000000..ec59cd0 Binary files /dev/null and b/app/icons/Adwaita/24x24/devices/ac-adapter.png differ diff --git a/app/icons/Adwaita/24x24/devices/battery.png b/app/icons/Adwaita/24x24/devices/battery.png new file mode 100644 index 0000000..13be903 Binary files /dev/null and b/app/icons/Adwaita/24x24/devices/battery.png differ diff --git a/app/icons/Adwaita/24x24/devices/input-keyboard.png b/app/icons/Adwaita/24x24/devices/input-keyboard.png new file mode 100644 index 0000000..7cb8344 Binary files /dev/null and b/app/icons/Adwaita/24x24/devices/input-keyboard.png differ diff --git a/app/icons/Adwaita/24x24/devices/input-mouse.png b/app/icons/Adwaita/24x24/devices/input-mouse.png new file mode 100644 index 0000000..7a158b9 Binary files /dev/null and b/app/icons/Adwaita/24x24/devices/input-mouse.png differ diff --git a/app/icons/Adwaita/24x24/devices/video-display.png b/app/icons/Adwaita/24x24/devices/video-display.png new file mode 100644 index 0000000..61d7a6e Binary files /dev/null and b/app/icons/Adwaita/24x24/devices/video-display.png differ diff --git a/app/icons/Adwaita/24x24/emblems/emblem-unreadable.png b/app/icons/Adwaita/24x24/emblems/emblem-unreadable.png new file mode 100644 index 0000000..28bb17b Binary files /dev/null and b/app/icons/Adwaita/24x24/emblems/emblem-unreadable.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-caution-charging.png b/app/icons/Adwaita/24x24/status/battery-caution-charging.png new file mode 100644 index 0000000..800824f Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-caution-charging.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-caution.png b/app/icons/Adwaita/24x24/status/battery-caution.png new file mode 100644 index 0000000..fe065b5 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-caution.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-empty.png b/app/icons/Adwaita/24x24/status/battery-empty.png new file mode 100644 index 0000000..31962d6 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-empty.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-full-charged.png b/app/icons/Adwaita/24x24/status/battery-full-charged.png new file mode 100644 index 0000000..99f50b0 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-full-charged.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-full-charging.png b/app/icons/Adwaita/24x24/status/battery-full-charging.png new file mode 100644 index 0000000..06b226e Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-full-charging.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-full.png b/app/icons/Adwaita/24x24/status/battery-full.png new file mode 100644 index 0000000..51cd816 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-full.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-good-charging.png b/app/icons/Adwaita/24x24/status/battery-good-charging.png new file mode 100644 index 0000000..e90469a Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-good-charging.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-good.png b/app/icons/Adwaita/24x24/status/battery-good.png new file mode 100644 index 0000000..7eee50a Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-good.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-low-charging.png b/app/icons/Adwaita/24x24/status/battery-low-charging.png new file mode 100644 index 0000000..ef10f52 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-low-charging.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-low.png b/app/icons/Adwaita/24x24/status/battery-low.png new file mode 100644 index 0000000..d0f3752 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-low.png differ diff --git a/app/icons/Adwaita/24x24/status/battery-missing.png b/app/icons/Adwaita/24x24/status/battery-missing.png new file mode 100644 index 0000000..41fca82 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/battery-missing.png differ diff --git a/app/icons/Adwaita/24x24/status/dialog-information.png b/app/icons/Adwaita/24x24/status/dialog-information.png new file mode 100644 index 0000000..e86bcc5 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/dialog-information.png differ diff --git a/app/icons/Adwaita/24x24/status/dialog-question.png b/app/icons/Adwaita/24x24/status/dialog-question.png new file mode 100644 index 0000000..ee1ad9e Binary files /dev/null and b/app/icons/Adwaita/24x24/status/dialog-question.png differ diff --git a/app/icons/Adwaita/24x24/status/user-available.png b/app/icons/Adwaita/24x24/status/user-available.png new file mode 100644 index 0000000..ce67767 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/user-available.png differ diff --git a/app/icons/Adwaita/24x24/status/weather-clear.png b/app/icons/Adwaita/24x24/status/weather-clear.png new file mode 100644 index 0000000..c172273 Binary files /dev/null and b/app/icons/Adwaita/24x24/status/weather-clear.png differ diff --git a/app/icons/Adwaita/32x32/actions/system-hibernate.png b/app/icons/Adwaita/32x32/actions/system-hibernate.png new file mode 100644 index 0000000..7c7cd4d Binary files /dev/null and b/app/icons/Adwaita/32x32/actions/system-hibernate.png differ diff --git a/app/icons/Adwaita/32x32/actions/system-lock-screen.png b/app/icons/Adwaita/32x32/actions/system-lock-screen.png new file mode 100644 index 0000000..aec49c7 Binary files /dev/null and b/app/icons/Adwaita/32x32/actions/system-lock-screen.png differ diff --git a/app/icons/Adwaita/32x32/actions/system-log-out.png b/app/icons/Adwaita/32x32/actions/system-log-out.png new file mode 100644 index 0000000..e835402 Binary files /dev/null and b/app/icons/Adwaita/32x32/actions/system-log-out.png differ diff --git a/app/icons/Adwaita/32x32/actions/system-shutdown.png b/app/icons/Adwaita/32x32/actions/system-shutdown.png new file mode 100644 index 0000000..1384a2c Binary files /dev/null and b/app/icons/Adwaita/32x32/actions/system-shutdown.png differ diff --git a/app/icons/Adwaita/32x32/actions/system-suspend.png b/app/icons/Adwaita/32x32/actions/system-suspend.png new file mode 100644 index 0000000..a535037 Binary files /dev/null and b/app/icons/Adwaita/32x32/actions/system-suspend.png differ diff --git a/app/icons/Adwaita/32x32/categories/preferences-other.png b/app/icons/Adwaita/32x32/categories/preferences-other.png new file mode 100644 index 0000000..2f61e3b Binary files /dev/null and b/app/icons/Adwaita/32x32/categories/preferences-other.png differ diff --git a/app/icons/Adwaita/32x32/devices/ac-adapter.png b/app/icons/Adwaita/32x32/devices/ac-adapter.png new file mode 100644 index 0000000..4b190b8 Binary files /dev/null and b/app/icons/Adwaita/32x32/devices/ac-adapter.png differ diff --git a/app/icons/Adwaita/32x32/devices/battery.png b/app/icons/Adwaita/32x32/devices/battery.png new file mode 100644 index 0000000..9069895 Binary files /dev/null and b/app/icons/Adwaita/32x32/devices/battery.png differ diff --git a/app/icons/Adwaita/32x32/devices/input-keyboard.png b/app/icons/Adwaita/32x32/devices/input-keyboard.png new file mode 100644 index 0000000..f0213d1 Binary files /dev/null and b/app/icons/Adwaita/32x32/devices/input-keyboard.png differ diff --git a/app/icons/Adwaita/32x32/devices/input-mouse.png b/app/icons/Adwaita/32x32/devices/input-mouse.png new file mode 100644 index 0000000..d718aca Binary files /dev/null and b/app/icons/Adwaita/32x32/devices/input-mouse.png differ diff --git a/app/icons/Adwaita/32x32/devices/video-display.png b/app/icons/Adwaita/32x32/devices/video-display.png new file mode 100644 index 0000000..fda6bf5 Binary files /dev/null and b/app/icons/Adwaita/32x32/devices/video-display.png differ diff --git a/app/icons/Adwaita/32x32/emblems/emblem-unreadable.png b/app/icons/Adwaita/32x32/emblems/emblem-unreadable.png new file mode 100644 index 0000000..a7d5c03 Binary files /dev/null and b/app/icons/Adwaita/32x32/emblems/emblem-unreadable.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-caution-charging.png b/app/icons/Adwaita/32x32/status/battery-caution-charging.png new file mode 100644 index 0000000..a66815c Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-caution-charging.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-caution.png b/app/icons/Adwaita/32x32/status/battery-caution.png new file mode 100644 index 0000000..5e667cc Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-caution.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-empty.png b/app/icons/Adwaita/32x32/status/battery-empty.png new file mode 100644 index 0000000..c7045d5 Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-empty.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-full-charged.png b/app/icons/Adwaita/32x32/status/battery-full-charged.png new file mode 100644 index 0000000..7a248af Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-full-charged.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-full-charging.png b/app/icons/Adwaita/32x32/status/battery-full-charging.png new file mode 100644 index 0000000..c352fe7 Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-full-charging.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-full.png b/app/icons/Adwaita/32x32/status/battery-full.png new file mode 100644 index 0000000..f80529b Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-full.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-good-charging.png b/app/icons/Adwaita/32x32/status/battery-good-charging.png new file mode 100644 index 0000000..cc2a9bf Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-good-charging.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-good.png b/app/icons/Adwaita/32x32/status/battery-good.png new file mode 100644 index 0000000..8bae646 Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-good.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-low-charging.png b/app/icons/Adwaita/32x32/status/battery-low-charging.png new file mode 100644 index 0000000..f999837 Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-low-charging.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-low.png b/app/icons/Adwaita/32x32/status/battery-low.png new file mode 100644 index 0000000..bba45d7 Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-low.png differ diff --git a/app/icons/Adwaita/32x32/status/battery-missing.png b/app/icons/Adwaita/32x32/status/battery-missing.png new file mode 100644 index 0000000..632907e Binary files /dev/null and b/app/icons/Adwaita/32x32/status/battery-missing.png differ diff --git a/app/icons/Adwaita/32x32/status/dialog-information.png b/app/icons/Adwaita/32x32/status/dialog-information.png new file mode 100644 index 0000000..d46095a Binary files /dev/null and b/app/icons/Adwaita/32x32/status/dialog-information.png differ diff --git a/app/icons/Adwaita/32x32/status/dialog-question.png b/app/icons/Adwaita/32x32/status/dialog-question.png new file mode 100644 index 0000000..2cb857f Binary files /dev/null and b/app/icons/Adwaita/32x32/status/dialog-question.png differ diff --git a/app/icons/Adwaita/32x32/status/user-available.png b/app/icons/Adwaita/32x32/status/user-available.png new file mode 100644 index 0000000..1d00cbe Binary files /dev/null and b/app/icons/Adwaita/32x32/status/user-available.png differ diff --git a/app/icons/Adwaita/32x32/status/weather-clear.png b/app/icons/Adwaita/32x32/status/weather-clear.png new file mode 100644 index 0000000..c708ada Binary files /dev/null and b/app/icons/Adwaita/32x32/status/weather-clear.png differ diff --git a/app/icons/Adwaita/48x48/actions/system-hibernate.png b/app/icons/Adwaita/48x48/actions/system-hibernate.png new file mode 100644 index 0000000..b9e317c Binary files /dev/null and b/app/icons/Adwaita/48x48/actions/system-hibernate.png differ diff --git a/app/icons/Adwaita/48x48/actions/system-lock-screen.png b/app/icons/Adwaita/48x48/actions/system-lock-screen.png new file mode 100644 index 0000000..2ab8237 Binary files /dev/null and b/app/icons/Adwaita/48x48/actions/system-lock-screen.png differ diff --git a/app/icons/Adwaita/48x48/actions/system-log-out.png b/app/icons/Adwaita/48x48/actions/system-log-out.png new file mode 100644 index 0000000..ffa2cbb Binary files /dev/null and b/app/icons/Adwaita/48x48/actions/system-log-out.png differ diff --git a/app/icons/Adwaita/48x48/actions/system-shutdown.png b/app/icons/Adwaita/48x48/actions/system-shutdown.png new file mode 100644 index 0000000..8c811a6 Binary files /dev/null and b/app/icons/Adwaita/48x48/actions/system-shutdown.png differ diff --git a/app/icons/Adwaita/48x48/actions/system-suspend.png b/app/icons/Adwaita/48x48/actions/system-suspend.png new file mode 100644 index 0000000..86d3d01 Binary files /dev/null and b/app/icons/Adwaita/48x48/actions/system-suspend.png differ diff --git a/app/icons/Adwaita/48x48/categories/preferences-other.png b/app/icons/Adwaita/48x48/categories/preferences-other.png new file mode 100644 index 0000000..313d91c Binary files /dev/null and b/app/icons/Adwaita/48x48/categories/preferences-other.png differ diff --git a/app/icons/Adwaita/48x48/devices/ac-adapter.png b/app/icons/Adwaita/48x48/devices/ac-adapter.png new file mode 100644 index 0000000..f74543a Binary files /dev/null and b/app/icons/Adwaita/48x48/devices/ac-adapter.png differ diff --git a/app/icons/Adwaita/48x48/devices/battery.png b/app/icons/Adwaita/48x48/devices/battery.png new file mode 100644 index 0000000..45b713e Binary files /dev/null and b/app/icons/Adwaita/48x48/devices/battery.png differ diff --git a/app/icons/Adwaita/48x48/devices/input-keyboard.png b/app/icons/Adwaita/48x48/devices/input-keyboard.png new file mode 100644 index 0000000..e6e01fa Binary files /dev/null and b/app/icons/Adwaita/48x48/devices/input-keyboard.png differ diff --git a/app/icons/Adwaita/48x48/devices/input-mouse.png b/app/icons/Adwaita/48x48/devices/input-mouse.png new file mode 100644 index 0000000..4c9930e Binary files /dev/null and b/app/icons/Adwaita/48x48/devices/input-mouse.png differ diff --git a/app/icons/Adwaita/48x48/devices/video-display.png b/app/icons/Adwaita/48x48/devices/video-display.png new file mode 100644 index 0000000..ab63982 Binary files /dev/null and b/app/icons/Adwaita/48x48/devices/video-display.png differ diff --git a/app/icons/Adwaita/48x48/emblems/emblem-unreadable.png b/app/icons/Adwaita/48x48/emblems/emblem-unreadable.png new file mode 100644 index 0000000..5f8a57d Binary files /dev/null and b/app/icons/Adwaita/48x48/emblems/emblem-unreadable.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-caution-charging.png b/app/icons/Adwaita/48x48/status/battery-caution-charging.png new file mode 100644 index 0000000..61c8238 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-caution-charging.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-caution.png b/app/icons/Adwaita/48x48/status/battery-caution.png new file mode 100644 index 0000000..7dce54b Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-caution.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-empty.png b/app/icons/Adwaita/48x48/status/battery-empty.png new file mode 100644 index 0000000..f300305 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-empty.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-full-charged.png b/app/icons/Adwaita/48x48/status/battery-full-charged.png new file mode 100644 index 0000000..8368c71 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-full-charged.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-full-charging.png b/app/icons/Adwaita/48x48/status/battery-full-charging.png new file mode 100644 index 0000000..b2e0c80 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-full-charging.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-full.png b/app/icons/Adwaita/48x48/status/battery-full.png new file mode 100644 index 0000000..d3fb24e Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-full.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-good-charging.png b/app/icons/Adwaita/48x48/status/battery-good-charging.png new file mode 100644 index 0000000..93091fc Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-good-charging.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-good.png b/app/icons/Adwaita/48x48/status/battery-good.png new file mode 100644 index 0000000..362f38a Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-good.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-low-charging.png b/app/icons/Adwaita/48x48/status/battery-low-charging.png new file mode 100644 index 0000000..8c968c6 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-low-charging.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-low.png b/app/icons/Adwaita/48x48/status/battery-low.png new file mode 100644 index 0000000..a7d8d91 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-low.png differ diff --git a/app/icons/Adwaita/48x48/status/battery-missing.png b/app/icons/Adwaita/48x48/status/battery-missing.png new file mode 100644 index 0000000..95d7c54 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/battery-missing.png differ diff --git a/app/icons/Adwaita/48x48/status/dialog-information.png b/app/icons/Adwaita/48x48/status/dialog-information.png new file mode 100644 index 0000000..cca5804 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/dialog-information.png differ diff --git a/app/icons/Adwaita/48x48/status/dialog-question.png b/app/icons/Adwaita/48x48/status/dialog-question.png new file mode 100644 index 0000000..2361f74 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/dialog-question.png differ diff --git a/app/icons/Adwaita/48x48/status/user-available.png b/app/icons/Adwaita/48x48/status/user-available.png new file mode 100644 index 0000000..ffb5317 Binary files /dev/null and b/app/icons/Adwaita/48x48/status/user-available.png differ diff --git a/app/icons/Adwaita/48x48/status/weather-clear.png b/app/icons/Adwaita/48x48/status/weather-clear.png new file mode 100644 index 0000000..1c8e27a Binary files /dev/null and b/app/icons/Adwaita/48x48/status/weather-clear.png differ diff --git a/app/icons/Adwaita/LICENSE.Adwaita b/app/icons/Adwaita/LICENSE.Adwaita new file mode 100644 index 0000000..fc45d78 --- /dev/null +++ b/app/icons/Adwaita/LICENSE.Adwaita @@ -0,0 +1,7 @@ +This work is licenced under the Creative Commons Attribution-Share Alike 3.0 +United States License. To view a copy of this licence, visit +http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative +Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA. + +When attributing the artwork, using "GNOME Project" is enough. +Please link to http://www.gnome.org where available. diff --git a/app/icons/Adwaita/README.md b/app/icons/Adwaita/README.md new file mode 100644 index 0000000..1ed470b --- /dev/null +++ b/app/icons/Adwaita/README.md @@ -0,0 +1 @@ +Stripped-down version for use with powerkit. diff --git a/app/icons/Adwaita/index.theme b/app/icons/Adwaita/index.theme new file mode 100644 index 0000000..38e1283 --- /dev/null +++ b/app/icons/Adwaita/index.theme @@ -0,0 +1,248 @@ +[Icon Theme] +Name=Adwaita +Name[an]=Adwaita +Name[ar]=أداويتا +Name[as]=Adwaita +Name[bg]=Адвайта +Name[bs]=Adwaita +Name[ca]=Adwaita +Name[ca@valencia]=Adwaita +Name[cs]=Adwaita +Name[da]=Adwaita +Name[de]=Adwaita +Name[el]=Adwaita +Name[eo]=Advaita +Name[es]=Adwaita +Name[eu]=Adwaita +Name[fa]=Adwaita +Name[fi]=Adwaita +Name[fr]=Adwaita +Name[gl]=Adwaita +Name[he]=Adwaita +Name[hu]=Adwaita +Name[id]=Adwaita +Name[is]=Adwaita +Name[it]=Adwaita +Name[kk]=Адвайта +Name[kn]=ಅದ್ವೈತಾ +Name[ko]=애드와이타 +Name[lt]=Adwaita +Name[lv]=Adwaita +Name[nb]=Adwaita +Name[ne]=अदविता +Name[oc]=Adwaita +Name[pa]=ਵਿਲੱਖਣ +Name[pl]=Adwaita +Name[pt]=Adwaita +Name[pt_BR]=Adwaita +Name[ro]=Adwaita +Name[ru]=Adwaita +Name[sk]=Adwaita +Name[sl]=Adwaita +Name[sr]=Адвајта +Name[sr@latin]=Advajta +Name[sv]=Adwaita +Name[tg]=Эдвэйта +Name[tr]=Adwaita +Name[uk]=Adwaita +Name[vi]=Adwaita +Name[zh_CN]=Adwaita +Name[zh_HK]=Adwaita +Name[zh_TW]=Adwaita +Comment=The Only One +Comment[an]=L'unico +Comment[ar]=الوحيدة +Comment[as]=একমাত্ৰ +Comment[bg]=Единствената +Comment[bs]=Jedini +Comment[ca]=L'únic +Comment[ca@valencia]=L'únic +Comment[cs]=Je jen jediná +Comment[da]=Den eneste +Comment[de]=Das einzige +Comment[el]=Το μοναδικό +Comment[eo]=La ununurulo +Comment[es]=El único +Comment[eu]=Paregabea +Comment[fa]=تنها برگزیده +Comment[fi]=Se ainoa +Comment[fr]=L'unique +Comment[gl]=O único +Comment[he]=האחד והיחיד +Comment[hu]=Az Egyetlen +Comment[id]=Satu-satunya +Comment[is]=Hið eina +Comment[it]=L'unico +Comment[kk]=Бірегей +Comment[kn]=ಕೇವಲ ಒಂದೇ ಒಂದು +Comment[ko]=오직 하나 뿐! +Comment[lt]=Vienintelė +Comment[lv]=Vienīgais +Comment[nb]=Det eneste +Comment[ne]=एकै मात्र +Comment[oc]=L'unic +Comment[pa]=ਕੇਵਲ ਇੱਕ +Comment[pl]=Może być tylko jeden +Comment[pt]=O único +Comment[pt_BR]=O único +Comment[ro]=Singura +Comment[ru]=Единственный +Comment[sk]=Jedinečná +Comment[sl]=Edina +Comment[sr]=Једна и једина +Comment[sr@latin]=Jedna i jedina +Comment[sv]=Det enda +Comment[tg]=Якка +Comment[tr]=Bir Tek +Comment[uk]=Тільки одна-єдина +Comment[vi]=Cái duy nhất +Comment[zh_CN]=惟一的 +Comment[zh_HK]=唯一 +Comment[zh_TW]=唯一 +Example=folder +Inherits=hicolor + +# KDE Specific Stuff +DisplayDepth=32 +LinkOverlay=link_overlay +LockOverlay=lock_overlay +ZipOverlay=zip_overlay +DesktopDefault=48 +DesktopSizes=16,22,32,48 +ToolbarDefault=22 +ToolbarSizes=16,22,32,48 +MainToolbarDefault=22 +MainToolbarSizes=16,22,32,48 +SmallDefault=16 +SmallSizes=16 +PanelDefault=32 +PanelSizes=16,22,32,48 + +# Directory list +Directories=16x16/actions,16x16/categories,16x16/devices,16x16/emblems,16x16/status,22x22/actions,22x22/categories,22x22/devices,22x22/emblems,22x22/status,24x24/actions,24x24/categories,24x24/devices,24x24/emblems,24x24/status,32x32/actions,32x32/categories,32x32/devices,32x32/emblems,32x32/status,48x48/actions,48x48/categories,48x48/devices,48x48/emblems,48x48/status, + +[16x16/actions] +Context=Actions +Size=16 +Type=Fixed + +[16x16/categories] +Context=Categories +Size=16 +Type=Fixed + +[16x16/devices] +Context=Devices +Size=16 +Type=Fixed + +[16x16/emblems] +Context=Emblems +Size=16 +Type=Fixed + +[16x16/status] +Context=Status +Size=16 +Type=Fixed + +[22x22/actions] +Context=Actions +Size=22 +Type=Fixed + +[22x22/categories] +Context=Categories +Size=22 +Type=Fixed + +[22x22/devices] +Context=Devices +Size=22 +Type=Fixed + +[22x22/emotes] +Context=Emotes +Size=22 +Type=Fixed + +[22x22/status] +Context=Status +Size=22 +Type=Fixed + +[24x24/actions] +Context=Actions +Size=24 +Type=Fixed + +[24x24/categories] +Context=Categories +Size=24 +Type=Fixed + +[24x24/devices] +Context=Devices +Size=24 +Type=Fixed + +[24x24/emblems] +Context=Emblems +Size=24 +Type=Fixed + +[24x24/status] +Context=Status +Size=24 +Type=Fixed + +[32x32/actions] +Context=Actions +Size=32 +Type=Fixed + +[32x32/categories] +Context=Categories +Size=32 +Type=Fixed + +[32x32/devices] +Context=Devices +Size=32 +Type=Fixed + +[32x32/emblems] +Context=Emblems +Size=32 +Type=Fixed + +[32x32/status] +Context=Status +Size=32 +Type=Fixed + +[48x48/actions] +Context=Actions +Size=48 +Type=Fixed + +[48x48/categories] +Context=Categories +Size=48 +Type=Fixed + +[48x48/devices] +Context=Devices +Size=48 +Type=Fixed + +[48x48/emblems] +Context=Emblems +Size=48 +Type=Fixed + +[48x48/status] +Context=Status +Size=48 +Type=Fixed + diff --git a/app/share/man/powerkit.1 b/app/share/man/powerkit.1 index 41b3b78..3d3e2e4 100644 --- a/app/share/man/powerkit.1 +++ b/app/share/man/powerkit.1 @@ -110,7 +110,7 @@ then save and restart. .B REQUIREMENTS .PP powerkit requires -.I ConsoleKit/logind, UPower, XScreenSaver +.I ConsoleKit/logind, UPower, XScreenSaver, adwaita-icon-theme. available during run-time. .SH OPTIONS diff --git a/app/systray.cpp b/app/systray.cpp index b662807..cad18cd 100644 --- a/app/systray.cpp +++ b/app/systray.cpp @@ -53,6 +53,9 @@ SysTray::SysTray(QObject *parent) , warnOnVeryLowBattery(true) , notifyOnBattery(true) , notifyOnAC(true) + , backlightMouseWheel(true) + , lockScreenOnSuspend(true) + , lockScreenOnResume(false) { // setup tray tray = new TrayIcon(this); @@ -238,7 +241,7 @@ void SysTray::checkDevices() if (man->TimeToEmpty()>0 && man->OnBattery()) { tray->setToolTip(tray->toolTip() .append(QString(", %1 %2") - .arg(QDateTime::fromTime_t(man->TimeToEmpty()) + .arg(QDateTime::fromTime_t((uint)man->TimeToEmpty()) .toUTC().toString("hh:mm"))) .arg(tr("left"))); } @@ -248,7 +251,7 @@ void SysTray::checkDevices() if (man->TimeToFull()>0) { tray->setToolTip(tray->toolTip() .append(QString(", %1 %2") - .arg(QDateTime::fromTime_t(man->TimeToFull()) + .arg(QDateTime::fromTime_t((uint)man->TimeToFull()) .toUTC().toString("hh:mm"))) .arg(tr("left"))); } @@ -472,6 +475,12 @@ void SysTray::loadSettings() if (Common::validPowerSettings(CONF_NOTIFY_ON_AC)) { notifyOnAC = Common::loadPowerSettings(CONF_NOTIFY_ON_AC).toBool(); } + if (Common::validPowerSettings(CONF_SUSPEND_LOCK_SCREEN)) { + lockScreenOnSuspend = Common::loadPowerSettings(CONF_SUSPEND_LOCK_SCREEN).toBool(); + } + if (Common::validPowerSettings(CONF_RESUME_LOCK_SCREEN)) { + lockScreenOnResume = Common::loadPowerSettings(CONF_RESUME_LOCK_SCREEN).toBool(); + } // verify if (!Common::kernelCanResume()) { @@ -490,6 +499,9 @@ void SysTray::loadSettings() // backlight backlightDevice = Common::backlightDevice(); hasBacklight = Common::canAdjustBacklight(backlightDevice); + if (Common::validPowerSettings(CONF_BACKLIGHT_MOUSE_WHEEL)) { + backlightMouseWheel = Common::loadPowerSettings(CONF_BACKLIGHT_MOUSE_WHEEL).toBool(); + } } // register session services @@ -812,7 +824,8 @@ void SysTray::showMessage(const QString &title, if (tray->isVisible() && showNotifications) { if (critical) { tray->showMessage(title, msg, - QSystemTrayIcon::Critical, 900000); + QSystemTrayIcon::Critical, + 900000); } else { tray->showMessage(title, msg); } @@ -832,27 +845,32 @@ void SysTray::disableHibernate() if (criticalAction == criticalHibernate) { qWarning() << "reset critical action to shutdown"; criticalAction = criticalShutdown; - Common::savePowerSettings(CONF_CRITICAL_BATTERY_ACTION, criticalAction); + Common::savePowerSettings(CONF_CRITICAL_BATTERY_ACTION, + criticalAction); } if (lidActionBattery == lidHibernate) { qWarning() << "reset lid battery action to lock"; lidActionBattery = lidLock; - Common::savePowerSettings(CONF_LID_BATTERY_ACTION, lidActionBattery); + Common::savePowerSettings(CONF_LID_BATTERY_ACTION, + lidActionBattery); } if (lidActionAC == lidHibernate) { qWarning() << "reset lid ac action to lock"; lidActionAC = lidLock; - Common::savePowerSettings(CONF_LID_AC_ACTION, lidActionAC); + Common::savePowerSettings(CONF_LID_AC_ACTION, + lidActionAC); } if (autoSuspendBatteryAction == suspendHibernate) { qWarning() << "reset auto suspend battery action to none"; autoSuspendBatteryAction = suspendNone; - Common::savePowerSettings(CONF_SUSPEND_BATTERY_ACTION, autoSuspendBatteryAction); + Common::savePowerSettings(CONF_SUSPEND_BATTERY_ACTION, + autoSuspendBatteryAction); } if (autoSuspendACAction == suspendHibernate) { qWarning() << "reset auto suspend ac action to none"; autoSuspendACAction = suspendNone; - Common::savePowerSettings(CONF_SUSPEND_AC_ACTION, autoSuspendACAction); + Common::savePowerSettings(CONF_SUSPEND_AC_ACTION, + autoSuspendACAction); } } @@ -862,22 +880,26 @@ void SysTray::disableSuspend() if (lidActionBattery == lidSleep) { qWarning() << "reset lid battery action to lock"; lidActionBattery = lidLock; - Common::savePowerSettings(CONF_LID_BATTERY_ACTION, lidActionBattery); + Common::savePowerSettings(CONF_LID_BATTERY_ACTION, + lidActionBattery); } if (lidActionAC == lidSleep) { qWarning() << "reset lid ac action to lock"; lidActionAC = lidLock; - Common::savePowerSettings(CONF_LID_AC_ACTION, lidActionAC); + Common::savePowerSettings(CONF_LID_AC_ACTION, + lidActionAC); } if (autoSuspendBatteryAction == suspendSleep) { qWarning() << "reset auto suspend battery action to none"; autoSuspendBatteryAction = suspendNone; - Common::savePowerSettings(CONF_SUSPEND_BATTERY_ACTION, autoSuspendBatteryAction); + Common::savePowerSettings(CONF_SUSPEND_BATTERY_ACTION, + autoSuspendBatteryAction); } if (autoSuspendACAction == suspendSleep) { qWarning() << "reset auto suspend ac action to none"; autoSuspendACAction = suspendNone; - Common::savePowerSettings(CONF_SUSPEND_AC_ACTION, autoSuspendACAction); + Common::savePowerSettings(CONF_SUSPEND_AC_ACTION, + autoSuspendACAction); } } @@ -885,12 +907,14 @@ void SysTray::disableSuspend() void SysTray::handlePrepareForSuspend(bool suspend) { qDebug() << "system prepare for suspend/resume" << suspend; - man->LockScreen(); resetTimer(); + man->UpdateDevices(); if (!suspend) { // resume + if (lockScreenOnResume) { man->LockScreen(); } tray->showMessage(QString(), QString()); - man->UpdateDevices(); ss->SimulateUserActivity(); + } else { // suspend + if (lockScreenOnSuspend) { man->LockScreen(); } } } @@ -909,17 +933,17 @@ void SysTray::switchInternalMonitor(bool toggle) // adjust backlight on wheel event (on systray) void SysTray::handleTrayWheel(TrayIcon::WheelAction action) { - if (!hasBacklight) { return; } + if (!hasBacklight || !backlightMouseWheel) { return; } switch (action) { case TrayIcon::WheelUp: Common::adjustBacklight(backlightDevice, - Common::backlightValue(backlightDevice)+10); + Common::backlightValue(backlightDevice)+BACKLIGHT_MOVE_VALUE); break; case TrayIcon::WheelDown: Common::adjustBacklight(backlightDevice, - Common::backlightValue(backlightDevice)-10); + Common::backlightValue(backlightDevice)-BACKLIGHT_MOVE_VALUE); break; - default: ; + default:; } } diff --git a/app/systray.h b/app/systray.h index 7788a18..505c1bc 100644 --- a/app/systray.h +++ b/app/systray.h @@ -120,6 +120,9 @@ class SysTray : public QObject bool warnOnVeryLowBattery; bool notifyOnBattery; bool notifyOnAC; + bool backlightMouseWheel; + bool lockScreenOnSuspend; + bool lockScreenOnResume; private slots: void trayActivated(QSystemTrayIcon::ActivationReason reason); diff --git a/lib/def.h b/lib/def.h index 45cb7f2..94e217f 100644 --- a/lib/def.h +++ b/lib/def.h @@ -54,9 +54,11 @@ enum criticalAction #define LID_AC_DEFAULT lidLock #define CRITICAL_DEFAULT criticalNone +#define BACKLIGHT_MOVE_VALUE 10 #define LOW_BATTERY 5 // % over critical #define CRITICAL_BATTERY 10 #define AUTO_SLEEP_BATTERY 15 +#define DEFAULT_THEME "Adwaita" #define DEFAULT_AC_ICON "ac-adapter" #define DEFAULT_BATTERY_ICON "battery" #define DEFAULT_BATTERY_ICON_CRIT "battery-caution" @@ -124,10 +126,14 @@ enum criticalAction #define CONF_BACKLIGHT_AC "backlight_ac_value" #define CONF_BACKLIGHT_AC_ENABLE "backlight_ac_enable" #define CONF_BACKLIGHT_AC_DISABLE_IF_HIGHER "backlight_ac_disable_if_higher" +#define CONF_BACKLIGHT_MOUSE_WHEEL "backlight_mouse_wheel" #define CONF_DIALOG "dialog_geometry" #define CONF_WARN_ON_LOW_BATTERY "warn_on_low_battery" #define CONF_WARN_ON_VERYLOW_BATTERY "warn_on_verylow_battery" #define CONF_NOTIFY_ON_BATTERY "notify_on_battery" #define CONF_NOTIFY_ON_AC "notify_on_ac" +#define CONF_SUSPEND_LOCK_SCREEN "lock_screen_on_suspend" +#define CONF_RESUME_LOCK_SCREEN "lock_screen_on_resume" +#define CONF_ICON_THEME "icon_theme" #endif // DEF_H diff --git a/lib/hotplug.cpp b/lib/hotplug.cpp deleted file mode 100644 index b7787a7..0000000 --- a/lib/hotplug.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* -# powerdwarf -# Copyright (c) 2018, Ole-André Rodlie All rights reserved. -# -# Available under the 3-clause BSD license -# See the LICENSE file for full details -*/ - -#include "hotplug.h" - -HotPlug::HotPlug(QObject *parent) : - QObject(parent) - , _scanning(false) -{ - moveToThread(&t); - t.start(); -} - -HotPlug::~HotPlug() -{ - _scanning = false; - t.wait(); - t.quit(); -} - -void HotPlug::requestScan() -{ - QMetaObject::invokeMethod(this, "scan"); -} - -void HotPlug::scan() -{ - if (_scanning) { return; } - _scanning = true; - - Display *dpy; - if ((dpy = XOpenDisplay(NULL)) == NULL) { return; } - - XRRScreenResources *sr; - XRROutputInfo *info; - XEvent ev; - - getScreens(dpy); - - XRRSelectInput(dpy, DefaultRootWindow(dpy), RROutputChangeNotifyMask); - XSync(dpy, 0); - while(_scanning) { - if (!XNextEvent(dpy, &ev)) { - sr = XRRGetScreenResources(OCNE(&ev)->display, OCNE(&ev)->window); - if (sr == NULL) { continue; } - info = XRRGetOutputInfo(OCNE(&ev)->display, sr, OCNE(&ev)->output); - if (info == NULL) { - XRRFreeScreenResources(sr); - continue; - } - QString screenName = info->name; - bool screenConnected = false; - if (info->connection == RR_Connected) { screenConnected = true; } - emit status(screenName, screenConnected); - XRRFreeScreenResources(sr); - XRRFreeOutputInfo(info); - } - } - XCloseDisplay(dpy); -} - -void HotPlug::requestSetScan(bool scanning) -{ - QMetaObject::invokeMethod(this, "setScan", Q_ARG(bool, scanning)); -} - -void HotPlug::getScreens(Display *dpy) -{ - if (dpy == NULL) { return; } - QMap result = Screens::outputsDpy(dpy); - emit found(result); -} - -void HotPlug::setScan(bool scanning) -{ - _scanning = scanning; -} diff --git a/lib/hotplug.h b/lib/hotplug.h deleted file mode 100644 index a4ddda5..0000000 --- a/lib/hotplug.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -# powerdwarf -# Copyright (c) 2018, Ole-André Rodlie All rights reserved. -# -# Available under the 3-clause BSD license -# See the LICENSE file for full details -*/ - -#ifndef HOTPLUG_H -#define HOTPLUG_H - -#include -#include -#include - -#include "screens.h" -#include - -#undef Bool // fix X11 inc -#define OCNE(X) ((XRROutputChangeNotifyEvent*)X) - -class HotPlug : public QObject -{ - Q_OBJECT - -public: - explicit HotPlug(QObject *parent = 0); - ~HotPlug(); - -private: - QThread t; - bool _scanning; - -signals: - void status(QString display, bool connected); - void found(QMap devices); - -public slots: - void requestScan(); - void requestSetScan(bool scanning); -private slots: - void scan(); - void getScreens(Display *dpy); - void setScan(bool scanning); -}; - -#endif // HOTPLUG_H diff --git a/lib/lib.pro b/lib/lib.pro index e22d1e5..26567ba 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -34,6 +34,7 @@ CONFIG(install_lib) { !CONFIG(no_doc_install) { target_docs.path = $${DOCDIR}/powerkit-$${VERSION}$${VERSION_EXTRA} target_docs.files = ../LICENSE ../README.md ../ChangeLog + exists(../ChangeLog.git): target_docs.files += ../ChangeLog.git INSTALLS += target_docs } !CONFIG(no_include_install) { diff --git a/lib/powerkit.cpp b/lib/powerkit.cpp index dc0b0b4..5c1ed41 100644 --- a/lib/powerkit.cpp +++ b/lib/powerkit.cpp @@ -48,7 +48,6 @@ bool PowerKit::availableService(const QString &service, path, interface, QDBusConnection::systemBus()); - //qDebug() << "has service?" << iface.isValid() << service << path << interface; if (iface.isValid()) { return true; } return false; } @@ -105,7 +104,6 @@ bool PowerKit::availableAction(const PowerKit::PKMethod &method, QDBusConnection::systemBus()); if (!iface.isValid()) { return false; } QDBusMessage reply = iface.call(cmd); - //qDebug() << "available action?" << cmd << reply << service << path << interface; if (reply.arguments().first().toString() == DBUS_OK_REPLY) { return true; } bool result = reply.arguments().first().toBool(); if (!reply.errorMessage().isEmpty()) { result = false; } @@ -261,13 +259,15 @@ void PowerKit::setup() upower = new QDBusInterface(UPOWER_SERVICE, UPOWER_PATH, UPOWER_MANAGER, - system); + system, + this); } if (logind == NULL) { logind = new QDBusInterface(LOGIND_SERVICE, LOGIND_PATH, LOGIND_MANAGER, - system); + system, + this); } scan(); } diff --git a/lib/powermanagement.cpp b/lib/powermanagement.cpp index c01ad2c..56ce601 100644 --- a/lib/powermanagement.cpp +++ b/lib/powermanagement.cpp @@ -33,10 +33,10 @@ quint32 PowerManagement::genCookie() { int low = 0; int high = 1000; - quint32 cookie = randInt(low, high); + quint32 cookie = (quint32)randInt(low, high); while(!clients.contains(cookie)) { if (!clients.contains(cookie)) { clients[cookie] = QTime::currentTime(); } - else { cookie = randInt(low, high); } + else { cookie = (quint32)randInt(low, high); } } return cookie; } diff --git a/lib/screensaver.cpp b/lib/screensaver.cpp index 4ee8daf..3c1e9b5 100644 --- a/lib/screensaver.cpp +++ b/lib/screensaver.cpp @@ -34,10 +34,10 @@ quint32 ScreenSaver::genCookie() { int low = 0; int high = 1000; - quint32 cookie = randInt(low, high); + quint32 cookie = (quint32)randInt(low, high); while(!clients.contains(cookie)) { if (!clients.contains(cookie)) { clients[cookie] = QTime::currentTime(); } - else { cookie = randInt(low, high); } + else { cookie = (quint32)randInt(low, high); } } return cookie; } @@ -61,17 +61,8 @@ bool ScreenSaver::canInhibit() return false; } -void ScreenSaver::checkForDBusSession() -{ - //if (!QDBusConnection::sessionBus().isConnected()) { - // DBus session has probably ended(?), so quit ... - //qApp->quit(); - //} -} - void ScreenSaver::timeOut() { - checkForDBusSession(); if (canInhibit()) { SimulateUserActivity(); } } diff --git a/lib/screensaver.h b/lib/screensaver.h index 0a0e2c2..acce995 100644 --- a/lib/screensaver.h +++ b/lib/screensaver.h @@ -37,7 +37,6 @@ private slots: quint32 genCookie(); void checkForExpiredClients(); bool canInhibit(); - void checkForDBusSession(); void timeOut(); void pingPM(); diff --git a/powerkit.pri b/powerkit.pri index d6ffb31..5a552c7 100644 --- a/powerkit.pri +++ b/powerkit.pri @@ -7,7 +7,7 @@ # VERSION = 1.0.0 -VERSION_EXTRA = "rc1" +VERSION_EXTRA = "rc2" isEmpty(PREFIX) { PREFIX = /usr/local