├── .gitignore
├── logo.png
├── .arcconfig
├── moon_56frames.png
├── 48-apps-liquidshell.png
├── liquidshell.qrc
├── Messages.sh
├── KWinCompat.hxx
├── Moon.hxx
├── WindowList.hxx
├── LockLogout.hxx
├── QuickLaunch.hxx
├── TaskBar.hxx
├── ClockWidgetConfigureDialog.hxx
├── PopupMenu.hxx
├── SysTrayItem.hxx
├── OnScreenBrightness.hxx
├── Pager.hxx
├── DiskUsageAppletConfigureDialog.hxx
├── DeviceNotifier.hxx
├── DesktopPanel.hxx
├── PictureFrameAppletConfigureDialog.hxx
├── Bluetooth.hxx
├── Launcher.hxx
├── NEWS.yaml
├── WeatherAppletConfigureDialog.hxx
├── OnScreenVolume.hxx
├── IconButton.hxx
├── Network.hxx
├── stylesheet.css
├── StartMenu.hxx
├── ConfigureDesktopDialog.hxx
├── Battery.hxx
├── liquidshell-session.desktop
├── DiskUsageApplet.hxx
├── PictureFrameApplet.hxx
├── PagerButton.hxx
├── SysTray.hxx
├── DesktopApplet.hxx
├── start_liquidshell
├── AppMenu.hxx
├── PictureFrameAppletConfigureDialog.cxx
├── SysTrayNotifyItem.hxx
├── DiskUsageAppletConfigureDialog.cxx
├── TaskBarButton.hxx
├── NotificationServer.hxx
├── DesktopWidget.hxx
├── DBusTypes.hxx
├── org.freedesktop.Notifications.xml
├── ClockWidget.hxx
├── org.kde.liquidshell.desktop
├── PkUpdates.hxx
├── NetworkList.hxx
├── KdeConnect.hxx
├── README-de
├── WeatherApplet.hxx
├── desktop.cxx
├── PopupMenu.cxx
├── SysTrayItem.cxx
├── NotificationList.hxx
├── IconButton.cxx
├── SysLoad.hxx
├── LockLogout.cxx
├── WindowList.cxx
├── Moon.cxx
├── DeviceNotifier.cxx
├── Bluetooth.cxx
├── Launcher.cxx
├── OnScreenBrightness.cxx
├── DeviceList.hxx
├── TaskBar.cxx
├── ClockWidgetConfigureDialog.cxx
├── PictureFrameApplet.cxx
├── PictureFrameAppletConfigureDialog.ui
├── DesktopPanel.cxx
├── README
├── DiskUsageAppletConfigureDialog.ui
├── PkUpdateList.hxx
├── Pager.cxx
├── DesktopApplet.cxx
├── ConfigureDesktopDialog.ui
├── DBusTypes.cxx
├── liquidshell.notifyrc
├── WeatherAppletConfigureDialog.ui
├── CMakeLists.txt
├── QuickLaunch.cxx
├── AppMenu.cxx
├── WeatherAppletConfigureDialog.cxx
├── PagerButton.cxx
├── NotificationServer.cxx
├── Network.cxx
├── Battery.cxx
├── ConfigureDesktopDialog.cxx
├── OnScreenVolume.cxx
└── DiskUsageApplet.cxx
/.gitignore:
--------------------------------------------------------------------------------
1 | compile_commands.json
2 | .cache/
3 |
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KDE/liquidshell/HEAD/logo.png
--------------------------------------------------------------------------------
/.arcconfig:
--------------------------------------------------------------------------------
1 | {
2 | "phabricator.uri" : "https://phabricator.kde.org/"
3 | }
4 |
--------------------------------------------------------------------------------
/moon_56frames.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KDE/liquidshell/HEAD/moon_56frames.png
--------------------------------------------------------------------------------
/48-apps-liquidshell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KDE/liquidshell/HEAD/48-apps-liquidshell.png
--------------------------------------------------------------------------------
/liquidshell.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | moon_56frames.png
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Messages.sh:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env bash
2 | $EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
3 | $XGETTEXT *.cxx rc.cpp -o $podir/liquidshell.pot
4 | rm -f rc.cpp
5 |
--------------------------------------------------------------------------------
/KWinCompat.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _KWINCOMPAT_H_
10 | #define _KWINCOMPAT_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #define KWinCompat KX11Extras
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/Moon.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #include
10 |
11 | class Moon
12 | {
13 | public:
14 | // returns the frame to be used from the moon_56frames.png
15 | static int phase(const QDate &date);
16 |
17 | private:
18 | static double sun_position(double j);
19 | static double moon_position(double j, double ls);
20 | };
21 |
--------------------------------------------------------------------------------
/WindowList.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _WindowList_H_
10 | #define _WindowList_H_
11 |
12 | #include
13 |
14 | class WindowList : public QPushButton
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | WindowList(QWidget *parent);
20 |
21 | protected:
22 | void paintEvent(QPaintEvent *event) override;
23 |
24 | private Q_SLOTS:
25 | void fillMenu();
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/LockLogout.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _LockLogout_H_
10 | #define _LockLogout_H_
11 |
12 | #include
13 | #include
14 |
15 | #include
16 |
17 | class LockLogout : public QWidget
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | LockLogout(DesktopPanel *parent);
23 |
24 | private Q_SLOTS:
25 | void fill(int rows);
26 |
27 | private:
28 | QToolButton *lock, *logout;
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/QuickLaunch.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _QuickLaunch_H_
10 | #define _QuickLaunch_H_
11 |
12 | #include
13 | #include
14 |
15 | #include
16 |
17 | class QuickLaunch : public Launcher
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | QuickLaunch(DesktopPanel *parent);
23 |
24 | private Q_SLOTS:
25 | void fill() override;
26 |
27 | private:
28 | QGridLayout *grid;
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/TaskBar.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _TaskBar_H_
10 | #define _TaskBar_H_
11 |
12 | #include
13 | #include
14 |
15 | #include
16 |
17 | class TaskBar : public QWidget
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | TaskBar(DesktopPanel *parent);
23 |
24 | private Q_SLOTS:
25 | void fill();
26 | void windowChanged(WId wid, NET::Properties props, NET::Properties2 props2);
27 |
28 | private:
29 | QGridLayout *grid;
30 | };
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/ClockWidgetConfigureDialog.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _ClockWidgetConfigureDialog_H_
10 | #define _ClockWidgetConfigureDialog_H_
11 |
12 | #include
13 | class QTreeWidget;
14 |
15 | class ClockWidgetConfigureDialog : public QDialog
16 | {
17 | Q_OBJECT
18 |
19 | public:
20 | ClockWidgetConfigureDialog(QWidget *parent, const QVector &timeZoneIds);
21 |
22 | QVector getSelectedTimeZoneIds() const;
23 |
24 | private:
25 | QTreeWidget *tree;
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/PopupMenu.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _PopupMenu_H_
10 | #define _PopupMenu_H_
11 |
12 | // A QMenu with drag functionality
13 |
14 | #include
15 |
16 | class PopupMenu : public QMenu
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | PopupMenu(QWidget *parent) : QMenu(parent), dragStartPos(-1, -1) { }
22 |
23 | protected:
24 | void mousePressEvent(QMouseEvent *event) override;
25 | void mouseMoveEvent(QMouseEvent *event) override;
26 |
27 | private:
28 | QPoint dragStartPos;
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/SysTrayItem.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _SysTrayItem_H_
10 | #define _SysTrayItem_H_
11 |
12 | #include
13 |
14 | class SysTrayItem : public QLabel
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | SysTrayItem(QWidget *parent, const QString &icon = QString());
20 |
21 | protected Q_SLOTS:
22 | void toggleDetailsList();
23 | void showDetailsList();
24 |
25 | protected:
26 | void mousePressEvent(QMouseEvent *event) override;
27 | virtual QWidget *getDetailsList() { return nullptr; }
28 |
29 | protected:
30 | QString iconName;
31 | };
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/OnScreenBrightness.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _OnScreenBrightness_H_
10 | #define _OnScreenBrightness_H_
11 |
12 | #include
13 | #include
14 | class QDBusMessage;
15 | class QDBusError;
16 |
17 | class OnScreenBrightness : public QProgressBar
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | OnScreenBrightness(QWidget *parent);
23 |
24 | private Q_SLOTS:
25 | void gotBrightnessMax(QDBusMessage msg);
26 | void brightnessMaxChanged(int value);
27 | void brightnessChanged(int value);
28 |
29 | private:
30 | QTimer hideTimer;
31 | };
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/Pager.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _Pager_H_
10 | #define _Pager_H_
11 |
12 | #include
13 | class QButtonGroup;
14 | class PagerButton;
15 | class DesktopPanel;
16 |
17 | class Pager : public QWidget
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | Pager(DesktopPanel *parent);
23 |
24 | protected:
25 | void wheelEvent(QWheelEvent *event) override;
26 |
27 | private Q_SLOTS:
28 | void fill();
29 | void changeDesktop(bool checked);
30 |
31 | private:
32 | QButtonGroup *group;
33 | QVector buttons;
34 | bool showIcons = true;
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/DiskUsageAppletConfigureDialog.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _DiskUsageAppletConfigureDialog_H_
10 | #define _DiskUsageAppletConfigureDialog_H_
11 |
12 | #include
13 | #include
14 | class DiskUsageApplet;
15 |
16 | class DiskUsageAppletConfigureDialog : public QDialog
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | DiskUsageAppletConfigureDialog(DiskUsageApplet *parent);
22 |
23 | private Q_SLOTS:
24 | void accept() override;
25 |
26 | private:
27 | DiskUsageApplet *applet;
28 | Ui::DiskUsageAppletConfigureDialog ui;
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/DeviceNotifier.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _DeviceNotifier_H_
10 | #define _DeviceNotifier_H_
11 |
12 | #include
13 | #include
14 | class DeviceList;
15 |
16 | class DeviceNotifier : public SysTrayItem
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | DeviceNotifier(QWidget *parent);
22 |
23 | protected:
24 | QWidget *getDetailsList() override;
25 | bool eventFilter(QObject *watched, QEvent *event) override;
26 |
27 | private Q_SLOTS:
28 | void checkDeviceList();
29 |
30 | private:
31 | DeviceList *deviceList = nullptr;
32 | QTimer timer;
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/DesktopPanel.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _DesktopPanel_H_
10 | #define _DesktopPanel_H_
11 |
12 | #include
13 |
14 | class DesktopPanel : public QFrame
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | DesktopPanel(QWidget *parent);
20 |
21 | int getRows() const { return rows; }
22 |
23 | Q_SIGNALS:
24 | void resized();
25 | void rowsChanged(int rows);
26 |
27 | protected:
28 | bool event(QEvent *event) override;
29 | void resizeEvent(QResizeEvent *event) override;
30 |
31 | private Q_SLOTS:
32 | void updateRowCount();
33 |
34 | private:
35 | int rows = 2;
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/PictureFrameAppletConfigureDialog.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _PictureFrameAppletConfigureDialog_H_
10 | #define _PictureFrameAppletConfigureDialog_H_
11 |
12 | #include
13 | #include
14 | class PictureFrameApplet;
15 |
16 | class PictureFrameAppletConfigureDialog : public QDialog
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | PictureFrameAppletConfigureDialog(PictureFrameApplet *parent);
22 |
23 | private Q_SLOTS:
24 | void accept() override;
25 |
26 | private:
27 | PictureFrameApplet *applet;
28 | Ui::PictureFrameAppletConfigureDialog ui;
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/Bluetooth.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _Bluetooth_H_
10 | #define _Bluetooth_H_
11 |
12 | #include
13 |
14 | #include
15 | #include
16 | #include
17 |
18 | class Bluetooth : public SysTrayItem
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | Bluetooth(QWidget *parent);
24 | ~Bluetooth() override;
25 |
26 | protected:
27 | QWidget *getDetailsList() override;
28 |
29 | private Q_SLOTS:
30 | void changed();
31 |
32 | private:
33 | BluezQt::Manager *manager;
34 | BluezQt::InitManagerJob *job;
35 | QPointer dialog;
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/Launcher.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _Launcher_H_
10 | #define _Launcher_H_
11 |
12 | #include
13 | #include
14 |
15 | class Launcher : public QWidget
16 | {
17 | Q_OBJECT
18 |
19 | public:
20 | Launcher(QWidget *parent, const QString &theId);
21 |
22 | protected:
23 | void contextMenuEvent(QContextMenuEvent *event) override;
24 | void loadConfig(const QString &defaultDir = QString());
25 | void setDir(const QString &theDirPath);
26 |
27 | private Q_SLOTS:
28 | virtual void fill() = 0;
29 |
30 | protected:
31 | QString id;
32 | QString dirPath;
33 | QFileSystemWatcher dirWatcher;
34 | };
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/NEWS.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | Version: 1.9
3 | Date: 2023-07-25
4 | Description:
5 | - Added install options (sleep/shutdown after install)
6 | - Improved EULA handling on package installation
7 | - Added long format of time and date display to calendar popup
8 | - Create default folder for storing quicklaunch apps
9 | - SysLoad widget width depends on CPU count
10 | - Bugfixes and adjustments to newer KDE components
11 | ---
12 | Version: 1.8.1
13 | Date: 2022-07-26
14 | Description:
15 | - Bugfixes and adjustments to newer KDE components
16 | ---
17 | Version: 1.8
18 | Date: 2021-12-01
19 | Description:
20 | - Notifications show how long they remain open (small animation)
21 | - Weather Applet shows moon phase
22 | - Disk Usage Applet watches for mount/unmount to react quicker for update
23 | - Display improvements in software updates component
24 | - Added DBUS-Menu support (some apps don't provide own menu but only via DBUS, e.g. MS teams)
25 |
--------------------------------------------------------------------------------
/WeatherAppletConfigureDialog.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _WeatherAppletConfigureDialog_H_
10 | #define _WeatherAppletConfigureDialog_H_
11 |
12 | #include
13 | #include
14 | #include
15 | class WeatherApplet;
16 |
17 | class WeatherAppletConfigureDialog : public QDialog
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | WeatherAppletConfigureDialog(WeatherApplet *parent);
23 |
24 | public Q_SLOTS:
25 | void accept() override;
26 |
27 | private Q_SLOTS:
28 | void gotJsonFile(KJob *job);
29 | void readJsonFile(const QString &filePath);
30 |
31 | private:
32 | WeatherApplet *applet;
33 | Ui::WeatherAppletConfigureDialog ui;
34 | QString cityId;
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/OnScreenVolume.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _OnScreenVolume_H_
10 | #define _OnScreenVolume_H_
11 |
12 | #include
13 | #include
14 | #include
15 | class QDBusMessage;
16 | class QDBusError;
17 |
18 | class OnScreenVolume : public QProgressBar
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | OnScreenVolume(QWidget *parent);
24 |
25 | private Q_SLOTS:
26 | void gotMasterMixerError(QDBusError error, QDBusMessage msg);
27 | void getMasterMixer();
28 | void gotMasterMixer(QDBusMessage msg);
29 | void controlChanged();
30 | void gotCurrentControl(QDBusMessage reply);
31 | void volumeChanged(QDBusMessage reply);
32 |
33 | private:
34 | QTimer hideTimer, retryTimer;
35 | QString masterMixer;
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/IconButton.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _IconButton_H_
10 | #define _IconButton_H_
11 |
12 | #include
13 | #include
14 |
15 | // button class to ensure the positioning of the icon and text independent of the style
16 |
17 | class IconButton : public QToolButton
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | IconButton(QWidget *parent = nullptr);
23 | IconButton(QWidget *parent, const QIcon &icon, int iconSize, const QString &name);
24 |
25 | void setText(const QString &txt);
26 | void setIcon(const QIcon &icon);
27 | void setIcon2(const QIcon &icon);
28 |
29 | QSize sizeHint() const override;
30 |
31 | private:
32 | QLabel *iconLabel = nullptr;
33 | QLabel *icon2Label = nullptr;
34 | QLabel *textLabel = nullptr;
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/Network.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _Network_H_
10 | #define _Network_H_
11 |
12 | // network management (status display, activate, switch, ...)
13 |
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | class Network : public SysTrayItem
22 | {
23 | Q_OBJECT
24 |
25 | public:
26 | Network(QWidget *parent);
27 |
28 | protected:
29 | QWidget *getDetailsList() override;
30 |
31 | private Q_SLOTS:
32 | void checkState();
33 | void openConfigureDialog();
34 |
35 | private:
36 | QTimer blinkTimer;
37 | bool blinkState = false;
38 | QPixmap origPixmap;
39 | QPointer networkList;
40 | QPointer dialog;
41 | };
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/stylesheet.css:
--------------------------------------------------------------------------------
1 | /* some examples ...
2 |
3 | DesktopPanel
4 | {
5 | min-height: 65px;
6 | max-height: 65px;
7 | }
8 |
9 | ClockWidget QLabel#time
10 | {
11 | font-size: 26px;
12 | font-weight: bold;
13 | }
14 |
15 | ClockWidget
16 | {
17 | qproperty-dayFormat: "dddd";
18 | qproperty-dateFormat: "dd.MM.yyyy";
19 | }
20 |
21 | SysLoad
22 | {
23 | qproperty-cpuUserColor: orange;
24 | qproperty-cpuSystemColorColor: red;
25 | qproperty-cpuNiceColorColor: yellow;
26 | qproperty-cpuSummaryBar: true;
27 |
28 | qproperty-memUsedColor: blue;
29 | qproperty-memCachedColor: darkGreen;
30 | qproperty-memSwapColor: cyan;
31 |
32 | qproperty-netReceivedColor: green;
33 | qproperty-netSentColor: red;
34 | }
35 |
36 | StartMenu
37 | {
38 | qproperty-themeIcon: "start-here-kde"
39 | }
40 |
41 | WeatherApplet
42 | {
43 | background: rgba(32, 56, 92, 75%);
44 | border: none;
45 | color: white;
46 | font-size: 20px;
47 | }
48 |
49 | WeatherApplet QLabel#city
50 | {
51 | font-size: 28px;
52 | }
53 | */
54 |
--------------------------------------------------------------------------------
/StartMenu.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _StartMenu_H_
10 | #define _StartMenu_H_
11 |
12 | #include
13 | #include
14 |
15 | #include
16 |
17 | #include
18 |
19 | class StartMenu : public QToolButton
20 | {
21 | Q_OBJECT
22 |
23 | Q_PROPERTY(QString themeIcon READ getThemeIcon WRITE setThemeIcon)
24 |
25 | public:
26 | StartMenu(DesktopPanel *parent);
27 |
28 | QString getThemeIcon() const { return themeIcon; }
29 | void setThemeIcon(const QString &icon);
30 |
31 | protected:
32 | void contextMenuEvent(QContextMenuEvent *event) override;
33 |
34 | private Q_SLOTS:
35 | void adjustIconSize();
36 | void fill();
37 | void showMenu();
38 |
39 | private:
40 | void fillFromGroup(QMenu *menu, KServiceGroup::Ptr group);
41 |
42 | private:
43 | QString themeIcon;
44 | QMenu *popup;
45 | };
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/ConfigureDesktopDialog.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _ConfigureDesktopDialog_H_
10 | #define _ConfigureDesktopDialog_H_
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | #include
17 |
18 | class ConfigureDesktopDialog : public QDialog
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | ConfigureDesktopDialog(QWidget *parent, const DesktopWidget::Wallpaper &wp);
24 |
25 | const DesktopWidget::Wallpaper &getWallpaper() const { return wallpaper; }
26 |
27 | Q_SIGNALS:
28 | void changed();
29 |
30 | private Q_SLOTS:
31 | void returnPressed(const QString &text);
32 | void buttonClicked(QAbstractButton *button);
33 |
34 | private:
35 | void showImages();
36 |
37 | private:
38 | Ui::ConfigureDesktopDialog ui;
39 | QButtonGroup buttonGroup;
40 | DesktopWidget::Wallpaper wallpaper;
41 | };
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/Battery.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _Battery_H_
10 | #define _Battery_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | class QDBusMessage;
17 |
18 | class Battery : public SysTrayItem
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | Battery(QWidget *parent);
24 |
25 | static QIcon getStatusIcon(int charge, bool isCharging);
26 |
27 | protected:
28 | QWidget *getDetailsList() override;
29 |
30 | private Q_SLOTS:
31 | void onBatteryReply(const QDBusMessage &msg);
32 | void upowerPropertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidated);
33 | void changed();
34 |
35 | private:
36 | QString secsToHM(int secs) const;
37 |
38 | private:
39 | Solid::Device device;
40 | bool onBattery = false;
41 | QPointer dialog;
42 | };
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/liquidshell-session.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=XSession
3 | Exec=@CMAKE_INSTALL_FULL_BINDIR@/start_liquidshell
4 | TryExec=@CMAKE_INSTALL_FULL_BINDIR@/start_liquidshell
5 | DesktopNames=KDE
6 | Name=Liquidshell
7 | Name[ar]=صدفة الانسياب
8 | Name[ca]=Liquidshell
9 | Name[ca@valencia]=Liquidshell
10 | Name[cs]=Liquidshell
11 | Name[de]=Liquidshell
12 | Name[el]=Liquidshell
13 | Name[en_GB]=Liquidshell
14 | Name[eo]=Liquidshell
15 | Name[es]=Liquidshell
16 | Name[et]=Liquidshell
17 | Name[eu]=Liquidshell
18 | Name[fi]=Liquidshell
19 | Name[fr]=Liquidshell
20 | Name[gl]=Liquidshell
21 | Name[he]=Liquidshell
22 | Name[ia]=Liquidshell
23 | Name[it]=Liquidshell
24 | Name[ka]=Liquidshell
25 | Name[ko]=Liquidshell
26 | Name[lt]=Liquidshell
27 | Name[lv]=Liquidshell
28 | Name[nl]=Liquidshell
29 | Name[pl]=Liquidshell
30 | Name[pt]=Liquidshell
31 | Name[pt_BR]=Liquidshell
32 | Name[ro]=Liquidshell
33 | Name[ru]=Liquidshell
34 | Name[sa]=द्रवशैलम्
35 | Name[sl]=Liquidshell
36 | Name[sv]=Liquid skal
37 | Name[tg]=Восити рақиқи
38 | Name[tr]=Liquidshell
39 | Name[uk]=Liquidshell
40 | Name[zh_TW]=Liquidshell
41 |
--------------------------------------------------------------------------------
/DiskUsageApplet.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _DiskUsageApplet_H_
10 | #define _DiskUsageApplet_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | class QProgressBar;
18 | class QLabel;
19 |
20 | class DiskUsageApplet : public DesktopApplet
21 | {
22 | Q_OBJECT
23 |
24 | public:
25 | DiskUsageApplet(QWidget *parent, const QString &theId);
26 |
27 | void loadConfig() override;
28 |
29 | public Q_SLOTS:
30 | void configure() override;
31 | void saveConfig() override;
32 |
33 | private Q_SLOTS:
34 | void fill();
35 |
36 | private:
37 | QTimer timer;
38 |
39 | struct SizeInfo
40 | {
41 | QLabel *label;
42 | QProgressBar *progress;
43 | QLabel *sizeLabel;
44 | bool used;
45 | };
46 |
47 | QMap partitionMap;
48 | QPointer dialog;
49 | };
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/PictureFrameApplet.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _PictureFrameApplet_H_
10 | #define _PictureFrameApplet_H_
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | class PictureFrameApplet : public DesktopApplet
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | PictureFrameApplet(QWidget *parent, const QString &theId);
22 |
23 | void loadConfig() override;
24 | QSize sizeHint() const override;
25 |
26 | QString getImagePath() const { return imagePath; }
27 | void setImagePath(const QString &path) { imagePath = path; loadImage(); }
28 |
29 | public Q_SLOTS:
30 | void configure() override;
31 |
32 | protected:
33 | void resizeEvent(QResizeEvent *event) override;
34 | void paintEvent(QPaintEvent *event) override;
35 |
36 | private:
37 | void loadImage();
38 |
39 | private:
40 | QPixmap pixmap;
41 | QString imagePath;
42 | QPointer dialog;
43 | };
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/PagerButton.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _PagerButton_H_
10 | #define _PagerButton_H_
11 |
12 | #include
13 | #include
14 | class DesktopPanel;
15 |
16 | #include
17 |
18 | class PagerButton : public QPushButton
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | PagerButton(int num, DesktopPanel *panel, bool showIcon);
24 |
25 | int getDesktop() const { return desktop; }
26 |
27 | QSize sizeHint() const override;
28 |
29 | protected:
30 | void paintEvent(QPaintEvent *event) override;
31 | void dragEnterEvent(QDragEnterEvent *event) override;
32 | void dragLeaveEvent(QDragLeaveEvent *event) override;
33 | void dropEvent(QDropEvent *event) override;
34 |
35 | private Q_SLOTS:
36 | void createPixmap();
37 | void windowChanged(WId id, NET::Properties props, NET::Properties2 props2);
38 |
39 | private:
40 | int desktop;
41 | DesktopPanel *panel;
42 | bool showIcon;
43 | QPixmap firstPixmap;
44 | QTimer dragDropTimer;
45 | QTimer pixmapTimer;
46 | };
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/SysTray.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _SysTray_H_
10 | #define _SysTray_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | #include
20 | #include
21 | class NotificationServer;
22 |
23 | class SysTray : public QFrame
24 | {
25 | Q_OBJECT
26 |
27 | public:
28 | SysTray(DesktopPanel *parent);
29 |
30 | private Q_SLOTS:
31 | void fill();
32 | void itemRegistered(QString service);
33 | void itemUnregistered(QString service);
34 | void itemInitialized(SysTrayNotifyItem *item);
35 |
36 | private:
37 | void registerWatcher();
38 | void arrangeNotifyItems();
39 | void contextMenuEvent(QContextMenuEvent *event) override;
40 |
41 | private:
42 | QVBoxLayout *vbox, *appsVbox;
43 | QVector appsRows;
44 | QString serviceName;
45 | QMap> items;
46 | NotificationServer *notificationServer = nullptr;
47 | };
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/DesktopApplet.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _DesktopApplet_H_
10 | #define _DesktopApplet_H_
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | class DesktopApplet : public QFrame
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | DesktopApplet(QWidget *parent, const QString &theId, bool addConfigureAction = true);
22 |
23 | virtual void loadConfig();
24 |
25 | bool isConfiguring() const { return buttons->isVisible(); }
26 |
27 | const QString &getId() const { return id; }
28 | int isOnDesktop(int d) const { return (onDesktop == NET::OnAllDesktops) || (onDesktop == d); }
29 |
30 | public Q_SLOTS:
31 | virtual void configure() { }
32 | virtual void saveConfig();
33 |
34 | Q_SIGNALS:
35 | void removeThis(DesktopApplet *);
36 |
37 | protected:
38 | QString id;
39 |
40 | private Q_SLOTS:
41 | void startGeometryChange();
42 | void finishGeometryChange(QAbstractButton *clicked);
43 | void removeThisApplet();
44 |
45 | private:
46 | QDialogButtonBox *buttons = nullptr;
47 | QRect oldRect;
48 | int onDesktop = NET::OnAllDesktops;
49 | };
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/start_liquidshell:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # disable plasmashell and enable liquidshell instead
3 |
4 | if [ ${XDG_CONFIG_HOME} ]
5 | then
6 | configDir=$XDG_CONFIG_HOME;
7 | else
8 | configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
9 | fi
10 |
11 | if [ -f /etc/xdg/autostart/plasmashell.desktop ]
12 | then
13 | plasmaFileName=$configDir/autostart/plasmashell.desktop
14 | else
15 | plasmaFileName=$configDir/autostart/org.kde.plasmashell.desktop
16 | fi
17 |
18 | liquidFileName=$configDir/autostart/org.kde.liquidshell.desktop
19 |
20 | mkdir -p $configDir/autostart
21 |
22 | test -f $liquidFileName
23 | liquidNotExists=$?
24 | if [ $liquidNotExists -eq 1 ]
25 | then
26 | cp @CMAKE_INSTALL_PREFIX@/@XDG_APPS_INSTALL_DIR@/org.kde.liquidshell.desktop $configDir/autostart
27 | else
28 | sed -i -e "s/Hidden=true/Hidden=false/" $liquidFileName
29 | fi
30 |
31 | cat > $plasmaFileName <
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _AppMenu_H_
10 | #define _AppMenu_H_
11 |
12 | #include
13 | #include
14 |
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | //--------------------------------------------------------------------------------
21 |
22 | class AppMenu : public Launcher
23 | {
24 | Q_OBJECT
25 |
26 | public:
27 | AppMenu(DesktopPanel *parent);
28 |
29 | private Q_SLOTS:
30 | void adjustIconSize();
31 | void fill() override;
32 | void showMenu();
33 |
34 | private:
35 | QToolButton *button;
36 | };
37 |
38 | //--------------------------------------------------------------------------------
39 | //--------------------------------------------------------------------------------
40 |
41 | class Menu : public QMenu
42 | {
43 | Q_OBJECT
44 |
45 | public:
46 | Menu(QWidget *parent);
47 | void exec();
48 |
49 | protected:
50 | void hideEvent(QHideEvent *event) override;
51 |
52 | private:
53 | QEventLoop eventLoop;
54 | };
55 |
56 | //--------------------------------------------------------------------------------
57 |
58 | #endif
59 |
--------------------------------------------------------------------------------
/PictureFrameAppletConfigureDialog.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #include
10 | #include
11 |
12 | //--------------------------------------------------------------------------------
13 |
14 | PictureFrameAppletConfigureDialog::PictureFrameAppletConfigureDialog(PictureFrameApplet *parent)
15 | : QDialog(parent), applet(parent)
16 | {
17 | ui.setupUi(this);
18 | ui.textColor->setColor(applet->palette().color(applet->foregroundRole()));
19 | ui.backgroundColor->setColor(applet->palette().color(applet->backgroundRole()));
20 | ui.imagePath->setUrl(QUrl::fromLocalFile(applet->getImagePath()));
21 | }
22 |
23 | //--------------------------------------------------------------------------------
24 |
25 | void PictureFrameAppletConfigureDialog::accept()
26 | {
27 | QPalette pal = applet->palette();
28 | pal.setColor(applet->foregroundRole(), ui.textColor->color());
29 | pal.setColor(applet->backgroundRole(), ui.backgroundColor->color());
30 | applet->setPalette(pal);
31 | applet->setImagePath(ui.imagePath->url().toLocalFile());
32 |
33 | QDialog::accept();
34 | }
35 |
36 | //--------------------------------------------------------------------------------
37 |
--------------------------------------------------------------------------------
/SysTrayNotifyItem.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _SysTrayNotifyItem_H_
10 | #define _SysTrayNotifyItem_H_
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | class OrgKdeStatusNotifierItem;
17 | class QDBusPendingCallWatcher;
18 | class DBusMenuLayoutItem;
19 |
20 | class SysTrayNotifyItem : public QLabel
21 | {
22 | Q_OBJECT
23 |
24 | public:
25 | SysTrayNotifyItem(QWidget *parent, const QString &service, const QString &path);
26 |
27 | Q_SIGNALS:
28 | void initialized(SysTrayNotifyItem *);
29 |
30 | protected:
31 | void wheelEvent(QWheelEvent *event) override;
32 | void mouseReleaseEvent(QMouseEvent *event) override;
33 |
34 | private Q_SLOTS:
35 | void startTimer();
36 | void fetchData();
37 | void fetchDataReply(QDBusPendingCallWatcher *w);
38 | void menuLayoutReply(QDBusPendingCallWatcher *w);
39 |
40 | private:
41 | QPixmap findPixmap(const QString &name, const QString &path);
42 | QPixmap applyOverlay(const QPixmap &pixmap, const QPixmap &overlay);
43 | void fillMenu(QMenu &menu, const DBusMenuLayoutItem &item);
44 |
45 | private:
46 | QTimer fetchTimer;
47 | OrgKdeStatusNotifierItem *dbus;
48 | QString menuPath;
49 | };
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/DiskUsageAppletConfigureDialog.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #include
10 | #include
11 |
12 | //--------------------------------------------------------------------------------
13 |
14 | DiskUsageAppletConfigureDialog::DiskUsageAppletConfigureDialog(DiskUsageApplet *parent)
15 | : QDialog(parent), applet(parent)
16 | {
17 | ui.setupUi(this);
18 | ui.textColor->setColor(applet->palette().color(applet->foregroundRole()));
19 | ui.backgroundColor->setColor(applet->palette().color(applet->backgroundRole()));
20 | ui.barTextColor->setColor(applet->palette().color(QPalette::HighlightedText));
21 | ui.barBackgroundColor->setColor(applet->palette().color(QPalette::Highlight));
22 | }
23 |
24 | //--------------------------------------------------------------------------------
25 |
26 | void DiskUsageAppletConfigureDialog::accept()
27 | {
28 | QPalette pal = applet->palette();
29 | pal.setColor(applet->foregroundRole(), ui.textColor->color());
30 | pal.setColor(applet->backgroundRole(), ui.backgroundColor->color());
31 | pal.setColor(QPalette::HighlightedText, ui.barTextColor->color());
32 | pal.setColor(QPalette::Highlight, ui.barBackgroundColor->color());
33 | applet->setPalette(pal);
34 |
35 | QDialog::accept();
36 | }
37 |
38 | //--------------------------------------------------------------------------------
39 |
--------------------------------------------------------------------------------
/TaskBarButton.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _TaskBarButton_H_
10 | #define _TaskBarButton_H_
11 |
12 | #include
13 | #include
14 | class QLabel;
15 | class KSqueezedTextLabel;
16 |
17 | #include
18 |
19 | class TaskBarButton : public QPushButton
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | TaskBarButton(WId wid);
25 |
26 | void setIconSize(int size);
27 |
28 | QSize sizeHint() const override;
29 |
30 | Q_SIGNALS:
31 | void clicked();
32 |
33 | protected:
34 | void mousePressEvent(QMouseEvent *event) override;
35 | void mouseMoveEvent(QMouseEvent *event) override;
36 | void paintEvent(QPaintEvent *event) override;
37 | void dragEnterEvent(QDragEnterEvent *event) override;
38 | void dragLeaveEvent(QDragLeaveEvent *event) override;
39 | void dropEvent(QDropEvent *event) override;
40 | void moveEvent(QMoveEvent *) override { updateWMGeometry(); }
41 | void resizeEvent(QResizeEvent *) override { updateWMGeometry(); }
42 |
43 | private Q_SLOTS:
44 | void fill();
45 | void setBackground();
46 | void windowChanged(WId id, NET::Properties props, NET::Properties2 props2);
47 |
48 | private:
49 | void updateWMGeometry();
50 |
51 | private:
52 | WId wid;
53 | QLabel *iconLabel;
54 | KSqueezedTextLabel *textLabel;
55 | QTimer dragDropTimer;
56 | QPoint dragStartPos;
57 | };
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/NotificationServer.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _NotificationServer_H_
10 | #define _NotificationServer_H_
11 |
12 | // https://developer.gnome.org/notification-spec/
13 | // https://specifications.freedesktop.org/notification-spec
14 |
15 | #include
16 | class NotificationList;
17 |
18 | class NotificationServer : public SysTrayItem
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | NotificationServer(QWidget *parent);
24 |
25 | void CloseNotification(uint id);
26 |
27 | QStringList GetCapabilities();
28 |
29 | QString GetServerInformation(QString &vendor, QString &version, QString &spec_version);
30 |
31 | uint Notify(const QString &app_name, uint replaces_id, const QString &app_icon,
32 | const QString &summary, const QString &body, const QStringList &actions,
33 | const QVariantMap &hints, int timeout);
34 |
35 | enum CloseReason
36 | {
37 | Expired = 1,
38 | Dismissed = 2,
39 | Closed = 3,
40 | Undefined = 4
41 | };
42 |
43 | void setAvoidPopup(bool avoid);
44 | bool getAvoidPopup() const;
45 |
46 | protected:
47 | QWidget *getDetailsList() override;
48 |
49 | Q_SIGNALS:
50 | void ActionInvoked(uint id, const QString &action_key);
51 | void NotificationClosed(uint id, uint reason);
52 |
53 | private:
54 | QString makeToolTip() const;
55 |
56 | private:
57 | uint notifyId = 1;
58 | NotificationList *notificationList;
59 | };
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/DesktopWidget.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef DESKTOP_WIDGET_H
10 | #define DESKTOP_WIDGET_H
11 |
12 | #include
13 | #include
14 | #include
15 | class DesktopPanel;
16 | class DesktopApplet;
17 | class ConfigureDesktopDialog;
18 |
19 | class DesktopWidget : public QWidget
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | DesktopWidget();
25 |
26 | struct Wallpaper
27 | {
28 | QString fileName, mode;
29 | QColor color;
30 | QVector pixmaps; // per screen
31 | };
32 |
33 | // since on X11 QScreen:available* methods do not deliver the true
34 | // values (according to Qt doc: This is a limitation in X11 window manager specification.)
35 | static QRect availableGeometry();
36 | static QSize availableSize();
37 |
38 | protected:
39 | void paintEvent(QPaintEvent *event) override;
40 |
41 | private Q_SLOTS:
42 | void loadSettings();
43 | void placePanel();
44 | void desktopChanged();
45 | void configureWallpaper();
46 | void configureDisplay();
47 | void addApplet(const QString &type);
48 | void removeApplet(DesktopApplet *applet);
49 |
50 | private:
51 | void saveAppletsList();
52 |
53 | private:
54 | DesktopPanel *panel = nullptr;
55 | ConfigureDesktopDialog *dialog = nullptr;
56 |
57 | QVector wallpapers;
58 | int currentDesktop = -1;
59 |
60 | QVector applets;
61 | static int appletNum;
62 | static DesktopWidget *instance;
63 | };
64 |
65 | #endif
66 |
--------------------------------------------------------------------------------
/DBusTypes.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef DBusTypes_h
10 | #define DBusTypes_h
11 |
12 | // define types used in kf5_org.kde.StatusNotifierItem.xml
13 |
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | typedef QPixmap KDbusImageStruct;
21 | typedef QIcon KDbusImageVector;
22 |
23 | struct KDbusToolTipStruct
24 | {
25 | QString icon;
26 | KDbusImageVector image;
27 | QString title;
28 | QString subTitle;
29 | };
30 |
31 | Q_DECLARE_METATYPE(KDbusToolTipStruct)
32 |
33 | const QDBusArgument &operator>>(const QDBusArgument &argument, KDbusImageStruct &pixmap);
34 | const QDBusArgument &operator>>(const QDBusArgument &argument, KDbusImageVector &icon);
35 | const QDBusArgument &operator>>(const QDBusArgument &argument, KDbusToolTipStruct &tip);
36 | QDBusArgument &operator<<(QDBusArgument &argument, const KDbusImageStruct &);
37 | QDBusArgument &operator<<(QDBusArgument &argument, const KDbusImageVector &);
38 | QDBusArgument &operator<<(QDBusArgument &argument, const KDbusToolTipStruct &);
39 |
40 | //--------------------------------------------------------------------------------
41 |
42 | struct DBusMenuLayoutItem
43 | {
44 | int m_id;
45 | QVariantMap m_properties;
46 | QVector m_children;
47 | };
48 |
49 | Q_DECLARE_METATYPE(DBusMenuLayoutItem)
50 |
51 | const QDBusArgument &operator<<(QDBusArgument &arg, const DBusMenuLayoutItem &item);
52 | const QDBusArgument &operator>>(const QDBusArgument &arg, DBusMenuLayoutItem &item);
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/org.freedesktop.Notifications.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ClockWidget.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _ClockWidget_H_
10 | #define _ClockWidget_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | #include
18 |
19 | class CalendarPopup : public QFrame
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | CalendarPopup(QWidget *parent);
25 |
26 | protected:
27 | void showEvent(QShowEvent *event) override;
28 | void hideEvent(QHideEvent *event) override;
29 |
30 | public Q_SLOTS:
31 | void goToday();
32 |
33 | private Q_SLOTS:
34 | void tick();
35 |
36 | private:
37 | QCalendarWidget *cal;
38 | QTimer timer;
39 | QLabel *timeLabel;
40 | QLabel *dateLabel;
41 | };
42 |
43 | //--------------------------------------------------------------------------------
44 |
45 | class ClockWidget : public QFrame
46 | {
47 | Q_OBJECT
48 | Q_PROPERTY(QString timeFormat MEMBER timeFormat)
49 | Q_PROPERTY(QString dayFormat MEMBER dayFormat)
50 | Q_PROPERTY(QString dateFormat MEMBER dateFormat)
51 |
52 | public:
53 | ClockWidget(DesktopPanel *parent);
54 |
55 | protected:
56 | void mousePressEvent(QMouseEvent *event) override;
57 |
58 | private Q_SLOTS:
59 | void fill();
60 | void tick();
61 |
62 | private:
63 | QTimer *timer;
64 | QLabel *timeLabel, *dayLabel, *dateLabel;
65 | CalendarPopup *calendar;
66 |
67 | QString timeFormat;
68 | QString dayFormat = QStringLiteral("ddd");
69 | QString dateFormat = QStringLiteral("d.MMM yyyy");
70 |
71 | QVector timeZoneIds;
72 | };
73 |
74 | #endif
75 |
--------------------------------------------------------------------------------
/org.kde.liquidshell.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Exec=liquidshell
3 | X-DBUS-StartupType=Unique
4 | Name=Liquid Desktop Workspace
5 | Name[ar]=مساحة عمل سطح مكتب الانسياب
6 | Name[ca]=Espai de treball de l'escriptori Liquid
7 | Name[ca@valencia]=Espai de treball de l'escriptori Liquid
8 | Name[cs]=Pracovní plocha Liquid
9 | Name[de]=Liquid-Arbeitsflächenbereich
10 | Name[el]=Χώρος εργασίας επιφάνειας εργασίας Liquid
11 | Name[en_GB]=Liquid Desktop Workspace
12 | Name[eo]=Liquid-Labortablospaco
13 | Name[es]=Espacio de trabajo de escritorio Liquid
14 | Name[et]=Liquidi töölaua tööruum
15 | Name[eu]=Liquid mahaigaineko langunea
16 | Name[fi]=Liquid Desktop -työtila
17 | Name[fr]=Espace de travail du bureau « Liquid »
18 | Name[gl]=Espazo de traballo de escritorio Liquid
19 | Name[he]=מרחב שולחן עבודה Liquid
20 | Name[ia]=Liquid Desktop Workspace (Spatio de Labor de Scriptorio Liquid)
21 | Name[it]=Spazio di lavoro Liquid Desktop
22 | Name[ka]=თხევადი სამუშაო მაგიდის სივრცე
23 | Name[ko]=Liquid 데스크톱 작업 공간
24 | Name[lt]=Liquid darbalaukio darbo sritis
25 | Name[lv]=„Liquid Desktop“ darbvirsma
26 | Name[nl]=Liquid bureaubladwerkruimte
27 | Name[pl]=Płynna przestrzeń pracy pulpitu
28 | Name[pt]=Área de Trabalho Liquid
29 | Name[pt_BR]=Espaço de trabalho Liquid
30 | Name[ro]=Spațiu de lucru cu birou lichid
31 | Name[ru]=Рабочая среда Liquid
32 | Name[sa]=तरल डेस्कटॉप कार्यक्षेत्र
33 | Name[sk]=Pracovná plocha Liquid
34 | Name[sl]=Delovni prostor tekočega namizja
35 | Name[sv]=Liquid arbetsområde för skrivbordet
36 | Name[tg]=Фазои мизи кории рақиқ
37 | Name[tr]=Liquid Masaüstü Çalışma Alanı
38 | Name[uk]=Робочий простір Ліквід для комп'ютерів
39 | Name[zh_TW]=Liquid 桌面工作空間
40 | Type=Application
41 | X-KDE-StartupNotify=false
42 | OnlyShowIn=KDE;
43 | X-KDE-autostart-phase=0
44 | NoDisplay=true
45 | Hidden=false
46 |
--------------------------------------------------------------------------------
/PkUpdates.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _PkUpdates_H_
10 | #define _PkUpdates_H_
11 |
12 | // software updates via PackageKit
13 |
14 | #include
15 |
16 | #include
17 | #include
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 | class PkUpdateList;
24 |
25 | class PkUpdates : public SysTrayItem
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | PkUpdates(QWidget *parent);
31 |
32 | struct PackageData
33 | {
34 | QString id;
35 | QString summary;
36 | };
37 | typedef QMultiMap PackageList;
38 |
39 | protected:
40 | QWidget *getDetailsList() override;
41 |
42 | private Q_SLOTS:
43 | void checkForUpdatesReached();
44 | void checkForUpdates();
45 | void refreshFinished(PackageKit::Transaction::Exit status, uint runtime);
46 | void package(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary);
47 | void transactionError(PackageKit::Transaction::Error error, const QString &details);
48 | void packageInstalled(const QString &id);
49 | void packageCountToInstallChanged(int num);
50 |
51 | private:
52 | void addItems(QString &tooltip, const QList &list) const;
53 | void createToolTip(bool notify = false);
54 | void setRefreshProgress(int progress);
55 |
56 | private:
57 | PackageList packages;
58 | QTimer updateTimer;
59 | QDateTime nextCheck;
60 | PkUpdateList *updateList = nullptr;
61 | int refreshProgress = 100;
62 | QPixmap currentPixmap;
63 | QPointer notification;
64 | };
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/NetworkList.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _NetworkList_H_
10 | #define _NetworkList_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | class NetworkList : public QFrame
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | NetworkList(QWidget *parent);
24 |
25 | QSize sizeHint() const override;
26 |
27 | Q_SIGNALS:
28 | void changed();
29 | void configureDialogClicked();
30 |
31 | private Q_SLOTS:
32 | void statusUpdate();
33 | void fillConnections();
34 |
35 | private:
36 | QToolButton *network, *wireless;
37 | QVBoxLayout *connectionsVbox;
38 | QHBoxLayout *hbox;
39 | QScrollArea *scroll;
40 | };
41 |
42 | //--------------------------------------------------------------------------------
43 |
44 | #include
45 | #include
46 | #include
47 |
48 | class NetworkButton : public IconButton
49 | {
50 | Q_OBJECT
51 |
52 | public:
53 | NetworkButton(NetworkManager::Connection::Ptr c = NetworkManager::Connection::Ptr(),
54 | NetworkManager::Device::Ptr dev = NetworkManager::Device::Ptr(),
55 | NetworkManager::AccessPoint::Ptr accessPoint = NetworkManager::AccessPoint::Ptr());
56 |
57 | static bool compare(const NetworkButton *left, const NetworkButton *right);
58 |
59 | private Q_SLOTS:
60 | void toggleNetworkStatus(bool on);
61 |
62 | private:
63 | NetworkManager::Connection::Ptr connection;
64 | NetworkManager::Device::Ptr device;
65 | QByteArray rawSsid;
66 | QString ssid;
67 | NetworkManager::AccessPoint::WpaFlags wpaFlags;
68 | };
69 |
70 | #endif
71 |
--------------------------------------------------------------------------------
/KdeConnect.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _KdeConnect_H_
10 | #define _KdeConnect_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | #include
20 |
21 | class QDBusMessage;
22 |
23 | //--------------------------------------------------------------------------------
24 |
25 | class KdeConnectDevice : public QObject
26 | {
27 | Q_OBJECT
28 |
29 | Q_SIGNALS:
30 | void changed();
31 |
32 | public Q_SLOTS:
33 | void updatePlugins();
34 |
35 | public:
36 | void ringPhone();
37 |
38 | QString id;
39 | QString name;
40 | QIcon icon, chargeIcon;
41 | QStringList plugins;
42 | int charge = -1;
43 | bool isCharging = false;
44 | bool warned = false;
45 | QDBusInterface *batteryInterface = nullptr;
46 |
47 | private Q_SLOTS:
48 | void nameChangedSlot(const QString &newName);
49 | void chargeChangedSlot();
50 |
51 | private:
52 | QPointer notif;
53 | };
54 |
55 | //--------------------------------------------------------------------------------
56 |
57 | class KdeConnect : public QObject
58 | {
59 | Q_OBJECT
60 |
61 | public:
62 | KdeConnect();
63 |
64 | struct Device : public QSharedPointer
65 | {
66 | Device() : QSharedPointer(new KdeConnectDevice) {}
67 | };
68 |
69 | Q_SIGNALS:
70 | void deviceAdded(const Device &device);
71 | void deviceRemoved(const QString &devId);
72 |
73 | private Q_SLOTS:
74 | void getDevices();
75 | void gotDevices(const QDBusMessage &msg);
76 | void deviceAddedSlot(const QString &dev);
77 | void deviceRemovedSlot(const QString &dev);
78 | void deviceVisibilityChanged(const QString &dev, bool visible);
79 |
80 | private:
81 | QMap devices;
82 | };
83 |
84 | #endif
85 |
--------------------------------------------------------------------------------
/README-de:
--------------------------------------------------------------------------------
1 | liquidshell ist eine Desktop Shell, welche auf Basis QtWidgets implementiert wurde
2 |
3 | Features:
4 | - Hintergrundbild pro virtueller Arbeitsfläche
5 | - Wetter, Disk-Verbrauch, Bilderrahmen Applets (pro virtueller Arbeitsfläche oder auf allen)
6 | - Verwendet den Widget-Stil, das Farbschema sowie das Icon-Thema aus den Systemeinstellungen
7 | - Kann per css stylesheet weiter angepasst werden
8 | - Verwendet für einige Konfigurationen die std. KDE Dialoge, wie z.B. Bluetooth, Startmenü, virtuelle Desktops
9 | - Ein Panel am unteren Bildschirmrand, welches folgende Komponenten bereitstellt:
10 | Startmenü (erlaubt Drag von Einträgen in ein Konqueror/Dolphin Fenster zum Konfigurieren der QuickLaunch oder AppMenu Einträge)
11 | QuickLaunch (zum Starten von Applikation oder Öffnen von Dokumenten mit einem Klick.
12 | Zeigt Einträge von .desktop Dateien aus einem einstellbaren Ordner)
13 | AppMenu (Ähnlich wie QuickLaunch nur werden Einträge als Menü angezeigt. Standardmäßig wird der Desktop Ordner verwendet)
14 | Pager (zum Umschalten der virtuellen Arbeitsflächen)
15 | Fensterliste (Popup-Menü zeigt alle offenen Fenster aller Arbeitsflächen zum schnellen Wechseln des aktiven Fensters)
16 | TaskBar (zeigt die offenen Fenster der aktiven Arbeitsfläche. Erlaubt ein Drag eines Eintrags auf den Pager
17 | zum schnellen Verschieben auf eine andere Arbeitsfläche)
18 | LockLogout (Abmelden, Bildschirmsperre)
19 | SysLoad (Systemlastanzeige von CPU, Speicher, Auslagerungsspeicher und Netzwerk mit live-Aktualisierung des ToolTips)
20 | SysTray mit integrierter Anzeige von Netzwerkverbindungen, Benachrichtigungen, Benachrichtigung
21 | über neu angesteckte Laufwerke inklusive KDE-Connect verbundener Geräte, Bluetooth, Batterie und
22 | Software-Updates mittels PackageKit. Ebenso Anzeige von Status-Icons anderer Applikationen.
23 | Benachrichtigungen erscheinen als Popup und werden ebenso für einige Minuten historisch abgelegt und können
24 | in einer Liste angesehen werden. Sie zeigen den Zeitstempel und erlauben den Text per Maus zu selektieren.
25 | Uhrenwidget (mit Kalender Popup und Tooltip für einstellbare Städte)
26 |
--------------------------------------------------------------------------------
/WeatherApplet.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _WeatherApplet_H_
10 | #define _WeatherApplet_H_
11 |
12 | #include
13 | #include
14 |
15 | #include
16 | #include
17 | #include
18 |
19 | #include
20 |
21 | // applet using data from http://api.openweathermap.org
22 |
23 | class WeatherApplet : public DesktopApplet
24 | {
25 | Q_OBJECT
26 |
27 | public:
28 | WeatherApplet(QWidget *parent, const QString &theId);
29 |
30 | void loadConfig() override;
31 | QSize sizeHint() const override;
32 |
33 | public Q_SLOTS:
34 | void configure() override;
35 |
36 | protected:
37 | void showEvent(QShowEvent *event) override;
38 |
39 | private Q_SLOTS:
40 | void fetchData();
41 | void gotData(KJob *job);
42 |
43 | private: // methods
44 | void setIcon(QLabel *label, const QString &icon);
45 |
46 | private: // members
47 | static QString apiKey; // see http://openweathermap.org/api
48 | QString cityId, units;
49 | QTimer timer;
50 | QPixmap moon;
51 | QLabel *cityLabel = nullptr;
52 | QLabel *moonLabel = nullptr;
53 | QLabel *tempLabel = nullptr;
54 | QLabel *pressureLabel = nullptr;
55 | QLabel *humidityLabel = nullptr;
56 | QLabel *windSpeedLabel = nullptr;
57 | QLabel *windDirectionLabel = nullptr;
58 |
59 | class ForecastWidget *shortForecast[4] = { nullptr };
60 | class ForecastWidget *forecast[5] = { nullptr };
61 |
62 | QPointer dialog;
63 |
64 | friend WeatherAppletConfigureDialog;
65 | };
66 |
67 | //--------------------------------------------------------------------------------
68 |
69 | class ForecastWidget : public QWidget
70 | {
71 | Q_OBJECT
72 |
73 | public:
74 | ForecastWidget(QWidget *parent, bool showMinMax = true);
75 |
76 | QLabel *min = nullptr;
77 | QLabel *max = nullptr;
78 | QLabel *day = nullptr;
79 | QLabel *icon = nullptr;
80 | };
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/desktop.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | #include
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 |
22 | int main(int argc, char **argv)
23 | {
24 | QCoreApplication::setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles);
25 |
26 | QApplication app(argc, argv);
27 |
28 | KLocalizedString::setApplicationDomain("liquidshell");
29 |
30 | KAboutData aboutData("liquidshell", i18n("Liquidshell"), "1.10",
31 | i18n("A QtWidgets based basic desktop shell"),
32 | KAboutLicense::GPL_V3,
33 | i18n("Copyright 2017 - 2024 Martin Koller"), QString(),
34 | "https://apps.kde.org/de/liquidshell"); // homepage
35 | //"https://www.linux-apps.com/p/1205621"); // homepage
36 |
37 | aboutData.addAuthor("Martin Koller", "", "martin@kollix.at");
38 |
39 | KAboutData::setApplicationData(aboutData);
40 |
41 | QCommandLineParser parser;
42 | aboutData.setupCommandLine(&parser);
43 | parser.process(app);
44 | aboutData.processCommandLine(&parser);
45 |
46 | KCrash::setFlags(KCrash::AutoRestart);
47 | KDBusService programDBusService(KDBusService::Unique | KDBusService::NoExitOnFailure);
48 |
49 | DesktopWidget desktop;
50 | desktop.show();
51 |
52 | QDBusMessage ksplashProgressMessage =
53 | QDBusMessage::createMethodCall(QStringLiteral("org.kde.KSplash"),
54 | QStringLiteral("/KSplash"),
55 | QStringLiteral("org.kde.KSplash"),
56 | QStringLiteral("setStage"));
57 | ksplashProgressMessage.setArguments(QList() << QStringLiteral("desktop"));
58 | QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage);
59 |
60 | return app.exec();
61 | }
62 |
--------------------------------------------------------------------------------
/PopupMenu.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #include
10 |
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | //--------------------------------------------------------------------------------
19 |
20 | void PopupMenu::mousePressEvent(QMouseEvent *event)
21 | {
22 | if ( event->button() == Qt::LeftButton )
23 | dragStartPos = event->pos();
24 |
25 | QMenu::mousePressEvent(event);
26 | }
27 |
28 | //--------------------------------------------------------------------------------
29 |
30 | void PopupMenu::mouseMoveEvent(QMouseEvent *event)
31 | {
32 | if ( (event->buttons() == Qt::LeftButton) && (dragStartPos != QPoint(-1, -1)) &&
33 | (event->pos() - dragStartPos).manhattanLength() > QGuiApplication::styleHints()->startDragDistance() )
34 | {
35 | dragStartPos = QPoint(-1, -1);
36 | QAction *action = actionAt(event->pos());
37 | if ( action && !action->menu() && action->data().isValid() )
38 | {
39 | event->accept();
40 |
41 | QDrag *drag = new QDrag(this);
42 | QMimeData *mimeData = new QMimeData;
43 | Qt::DropActions dropAction;
44 |
45 | if ( action->data().typeId() == QMetaType::QUrl )
46 | {
47 | mimeData->setUrls(QList() << action->data().toUrl());
48 | dropAction = Qt::CopyAction;
49 | }
50 | else if ( action->data().typeId() == QMetaType::Int )
51 | {
52 | mimeData->setData("application/x-winId", QByteArray::number(action->data().toInt()));
53 | dropAction = Qt::MoveAction;
54 | }
55 | else
56 | qDebug() << "illegal data in PopupMenu action"; // should never come here
57 |
58 | drag->setMimeData(mimeData);
59 | drag->setPixmap(action->icon().pixmap(32, 32));
60 | drag->exec(dropAction);
61 | }
62 | }
63 | else
64 | QMenu::mouseMoveEvent(event);
65 | }
66 |
67 | //--------------------------------------------------------------------------------
68 |
--------------------------------------------------------------------------------
/SysTrayItem.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #include
10 | #include
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | #include
18 |
19 | //--------------------------------------------------------------------------------
20 |
21 | SysTrayItem::SysTrayItem(QWidget *parent, const QString &icon)
22 | : QLabel(parent), iconName(icon)
23 | {
24 | setFixedSize(QSize(22, 22));
25 |
26 | if ( !iconName.isEmpty() )
27 | {
28 | setPixmap(QIcon::fromTheme(iconName).pixmap(size()));
29 |
30 | connect(KIconLoader::global(), &KIconLoader::iconLoaderSettingsChanged, this,
31 | [this]() { setPixmap(QIcon::fromTheme(iconName).pixmap(size())); });
32 | }
33 | }
34 |
35 | //--------------------------------------------------------------------------------
36 |
37 | void SysTrayItem::mousePressEvent(QMouseEvent *event)
38 | {
39 | if ( event->button() != Qt::LeftButton )
40 | return;
41 |
42 | toggleDetailsList();
43 | }
44 |
45 | //--------------------------------------------------------------------------------
46 |
47 | void SysTrayItem::showDetailsList()
48 | {
49 | QWidget *detailsList = getDetailsList();
50 |
51 | if ( !detailsList )
52 | return;
53 |
54 | QPoint point = mapToGlobal(pos());
55 | QRect screen = DesktopWidget::availableGeometry();
56 | QSize size = detailsList->windowHandle() ? detailsList->size() : detailsList->sizeHint();
57 | point.setX(std::min(point.x(), screen.x() + screen.width() - size.width()));
58 | point.setY(screen.bottom() - size.height());
59 | detailsList->move(point);
60 | detailsList->show();
61 | detailsList->raise();
62 | }
63 |
64 | //--------------------------------------------------------------------------------
65 |
66 | void SysTrayItem::toggleDetailsList()
67 | {
68 | QWidget *detailsList = getDetailsList();
69 |
70 | if ( !detailsList )
71 | return;
72 |
73 | if ( detailsList->isVisible() )
74 | detailsList->close();
75 | else
76 | showDetailsList();
77 | }
78 |
79 | //--------------------------------------------------------------------------------
80 |
--------------------------------------------------------------------------------
/NotificationList.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _NotificationList_H_
10 | #define _NotificationList_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | class QVBoxLayout;
18 | class QProgressBar;
19 | class NotificationServer;
20 |
21 | class NotifyItem : public QFrame
22 | {
23 | Q_OBJECT
24 |
25 | public:
26 | NotifyItem(QWidget *parent, NotificationServer *server, uint theid, const QString &app,
27 | const QString &summary, const QString &body, const QIcon &icon,
28 | const QStringList &actions, bool isResident);
29 |
30 | void destroySysResources();
31 |
32 | void setTimeout(int milliSecs);
33 |
34 | uint id;
35 | QString appName, summary, body;
36 | QStringList actions;
37 | QLabel *timeLabel, *iconLabel, *textLabel;
38 | QProgressBar *timeoutBar;
39 | bool resident = false; // keep after clicking an action
40 | };
41 |
42 | //--------------------------------------------------------------------------------
43 |
44 | class NotificationList : public QWidget
45 | {
46 | Q_OBJECT
47 |
48 | public:
49 | NotificationList(NotificationServer *parent);
50 | ~NotificationList() override;
51 |
52 | void addItem(uint id, const QString &appName, const QString &summary, const QString &body,
53 | const QIcon &icon, const QStringList &actions, const QVariantMap &hints, int timeout);
54 |
55 | void closeItem(uint id);
56 |
57 | int itemCount() const { return items.count(); }
58 | QVector getItems() const { return items; }
59 |
60 | void setAvoidPopup(bool on);
61 | bool getAvoidPopup() const { return avoidPopup; }
62 |
63 | Q_SIGNALS:
64 | void itemsCountChanged();
65 | void listNowEmpty();
66 |
67 | private Q_SLOTS:
68 | void itemDestroyed(QObject *item);
69 |
70 | private:
71 | void placeItems();
72 |
73 | private:
74 | QScrollArea *scrollArea;
75 | QVBoxLayout *listVbox;
76 | QMap appTimeouts; // appName, timeout (minutes)
77 | QVector items;
78 | NotificationServer *server;
79 | bool avoidPopup = false;
80 | };
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/IconButton.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #include
10 |
11 | #include
12 |
13 | //--------------------------------------------------------------------------------
14 |
15 | IconButton::IconButton(QWidget *parent)
16 | : QToolButton(parent)
17 | {
18 | setAutoRaise(true);
19 | setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
20 |
21 | QHBoxLayout *hbox = new QHBoxLayout(this);
22 |
23 | iconLabel = new QLabel;
24 | iconLabel->setFixedSize(iconSize());
25 | iconLabel->setContextMenuPolicy(Qt::PreventContextMenu);
26 | hbox->addWidget(iconLabel);
27 |
28 | icon2Label = new QLabel;
29 | icon2Label->setFixedSize(iconSize());
30 | icon2Label->setContextMenuPolicy(Qt::PreventContextMenu);
31 | icon2Label->hide(); // until an icon is set
32 | hbox->addWidget(icon2Label);
33 |
34 | textLabel = new QLabel;
35 | hbox->addWidget(textLabel);
36 | }
37 |
38 | //--------------------------------------------------------------------------------
39 |
40 | IconButton::IconButton(QWidget *parent, const QIcon &icon, int theIconSize, const QString &name)
41 | : IconButton(parent)
42 | {
43 | if ( theIconSize != -1 )
44 | setIconSize(QSize(theIconSize, theIconSize));
45 |
46 | iconLabel->setFixedSize(iconSize());
47 | iconLabel->setPixmap(icon.pixmap(iconSize()));
48 |
49 | textLabel->setText(name);
50 | }
51 |
52 | //--------------------------------------------------------------------------------
53 |
54 | void IconButton::setText(const QString &txt)
55 | {
56 | textLabel->setText(txt);
57 | }
58 |
59 | //--------------------------------------------------------------------------------
60 |
61 | void IconButton::setIcon(const QIcon &icon)
62 | {
63 | iconLabel->setPixmap(icon.pixmap(iconSize()));
64 | }
65 |
66 | //--------------------------------------------------------------------------------
67 |
68 | void IconButton::setIcon2(const QIcon &icon)
69 | {
70 | icon2Label->setPixmap(icon.pixmap(iconSize()));
71 | icon2Label->show();
72 | }
73 |
74 | //--------------------------------------------------------------------------------
75 |
76 | QSize IconButton::sizeHint() const
77 | {
78 | return layout()->sizeHint();
79 | }
80 |
81 | //--------------------------------------------------------------------------------
82 |
--------------------------------------------------------------------------------
/SysLoad.hxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller
5 |
6 | SPDX-License-Identifier: GPL-3.0-or-later
7 | */
8 |
9 | #ifndef _SysLoad_H_
10 | #define _SysLoad_H_
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | class SysLoad : public QFrame
19 | {
20 | Q_OBJECT
21 |
22 | Q_PROPERTY(QColor cpuUserColor MEMBER cpuUserColor)
23 | Q_PROPERTY(QColor cpuSystemColor MEMBER cpuSystemColor)
24 | Q_PROPERTY(QColor cpuNiceColor MEMBER cpuNiceColor)
25 | Q_PROPERTY(bool cpuSummaryBar MEMBER cpuSummaryBar)
26 |
27 | Q_PROPERTY(QColor memUsedColor MEMBER memUsedColor)
28 | Q_PROPERTY(QColor memCachedColor MEMBER memCachedColor)
29 | Q_PROPERTY(QColor memSwapColor MEMBER memSwapColor)
30 |
31 | Q_PROPERTY(QColor netReceivedColor MEMBER netReceivedColor)
32 | Q_PROPERTY(QColor netSentColor MEMBER netSentColor)
33 |
34 | public:
35 | SysLoad(QWidget *parent);
36 |
37 | protected:
38 | void paintEvent(QPaintEvent *event) override;
39 | void mousePressEvent(QMouseEvent *event) override;
40 |
41 | private Q_SLOTS:
42 | void fetch();
43 |
44 | private:
45 | struct CpuData
46 | {
47 | int userCPU = 0, niceCPU = 0, systemCPU = 0;
48 | double userPercent = 0, nicePercent = 0, systemPercent = 0;
49 | double MHz = 0;
50 | };
51 |
52 | struct MemoryData
53 | {
54 | double memPercent = 0;
55 | double memCachedPercent = 0;
56 | double swapPercent = 0;
57 | } memData;
58 |
59 | struct NetworkData
60 | {
61 | size_t prevReceived = 0, prevSent = 0;
62 | size_t received = 0, sent = 0;
63 | bool valid = false;
64 | };
65 |
66 | QVector cpus;
67 |
68 | QMap netDevs;
69 | size_t maxScale = 0;
70 | size_t maxBytes = 0;
71 | size_t sumSent = 0, sumReceived = 0;
72 |
73 | QTimer timeoutTimer;
74 | QTimer netLoadTimer;
75 |
76 | QColor cpuUserColor = "#881f1f";
77 | QColor cpuSystemColor = Qt::darkGreen;
78 | QColor cpuNiceColor = Qt::yellow;
79 | bool cpuSummaryBar = false;
80 |
81 | QColor memUsedColor = Qt::blue;
82 | QColor memCachedColor = Qt::darkGreen;
83 | QColor memSwapColor = Qt::cyan;
84 |
85 | QColor netReceivedColor = Qt::green;
86 | QColor netSentColor = Qt::red;
87 | };
88 |
89 | #endif
90 |
--------------------------------------------------------------------------------
/LockLogout.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of liquidshell.
3 |
4 | SPDX-FileCopyrightText: 2017 - 2024 Martin Koller