Skip to content

Commit 0d1e48a

Browse files
addpkg(x11/liquidshell): 1.10.1
1 parent fe1c0b2 commit 0d1e48a

6 files changed

Lines changed: 305 additions & 0 deletions

File tree

x11-packages/liquidshell/build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
TERMUX_PKG_HOMEPAGE="https://invent.kde.org/system/liquidshell"
2+
TERMUX_PKG_DESCRIPTION="Basic desktop shell using QtWidgets"
3+
TERMUX_PKG_LICENSE="GPL-3.0-or-later"
4+
TERMUX_PKG_MAINTAINER="@termux"
5+
TERMUX_PKG_VERSION="1.10.1"
6+
TERMUX_PKG_SRCURL="https://download.kde.org/stable/liquidshell/liquidshell-${TERMUX_PKG_VERSION}.tar.xz"
7+
TERMUX_PKG_SHA256="4e079293a90c47fc3c862f4aa9472936a4cb8a2c72f16098d234997e86c8364a"
8+
TERMUX_PKG_AUTO_UPDATE=true
9+
TERMUX_PKG_DEPENDS="kf6-karchive, kf6-kcmutils, kf6-kcolorscheme, kf6-kconfig, kf6-kcoreaddons, kf6-kcrash, kf6-kdbusaddons, kf6-ki18n, kf6-kiconthemes, kf6-kio, kf6-kitemviews, kf6-knewstuff, kf6-knotifications, kf6-kservice, kf6-kstatusnotifieritem, kf6-kwidgetsaddons, kf6-kwindowsystem, kf6-kxmlgui, kf6-solid, libc++, qt6-qtbase"
10+
TERMUX_PKG_BUILD_DEPENDS="extra-cmake-modules"
11+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
12+
-DCMAKE_SYSTEM_NAME=Linux
13+
-DKDE_INSTALL_QMLDIR=lib/qt6/qml
14+
-DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins
15+
"
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
--- a/SysLoad.cxx
2+
+++ b/SysLoad.cxx
3+
@@ -19,7 +19,9 @@
4+
5+
#include <KLocalizedString>
6+
7+
+#ifndef __TERMUX__
8+
#include <NetworkManagerQt/Manager>
9+
+#endif
10+
11+
//--------------------------------------------------------------------------------
12+
13+
@@ -45,20 +47,29 @@
14+
timeoutTimer.start();
15+
connect(&timeoutTimer, &QTimer::timeout, this, &SysLoad::fetch);
16+
17+
+#ifndef __TERMUX__
18+
connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionChanged,
19+
[this]() { maxScale = NET_INIT_SCALE; maxBytes = 0; }); // reset since we're changing network (which might be slower)
20+
+#endif
21+
22+
// gradually decrease max network throughput to really be able to see when network traffic occurs
23+
+#ifndef __TERMUX__
24+
netLoadTimer.setInterval(NET_INTERVAL_S * 1000);
25+
netLoadTimer.start();
26+
connect(&netLoadTimer, &QTimer::timeout, this, [this]() { maxBytes = 0; if ( maxScale > NET_INIT_SCALE ) maxScale /= 2; });
27+
+#endif
28+
29+
fetch();
30+
31+
const int cpuBars = cpuSummaryBar ? 1 : cpus.count();
32+
const int cpuBarWidth = (cpuBars <= 4) ? BAR_WIDTH : SMALL_BAR_WIDTH;
33+
+#ifdef __TERMUX__
34+
+ setFixedWidth((cpuBars * cpuBarWidth) + (2 * BAR_WIDTH) +
35+
+ contentsMargins().left() + contentsMargins().right());
36+
+#else
37+
setFixedWidth((cpuBars * cpuBarWidth) + ((2 + 1) * BAR_WIDTH) + // 2 memory bars, 1 net - they shall be more prominent
38+
contentsMargins().left() + contentsMargins().right());
39+
+#endif
40+
}
41+
42+
//--------------------------------------------------------------------------------
43+
@@ -143,6 +154,7 @@
44+
f.close();
45+
}
46+
47+
+#ifndef __TERMUX__
48+
f.setFileName("/proc/net/dev");
49+
sumSent = sumReceived = 0;
50+
if ( f.open(QIODevice::ReadOnly) )
51+
@@ -190,6 +202,7 @@
52+
53+
maxBytes = std::max(maxBytes, (sumReceived + sumSent));
54+
maxScale = std::max(maxBytes, maxScale);
55+
+#endif
56+
57+
update();
58+
59+
@@ -220,11 +233,13 @@
60+
tip += i18n("Swap Free: %1 MB (%2 GB)" , swapFree / 1024, locale().toString(swapFree / 1024.0 / 1024.0, 'f', 2));
61+
62+
tip += "<hr>";
63+
+#ifndef __TERMUX__
64+
tip += i18n("Net send/receive: %1/%2 KB/sec",
65+
locale().toString((sumSent / 1024.0) / (INTERVAL_MS / 1000.0), 'f', 2),
66+
locale().toString((sumReceived / 1024.0) / (INTERVAL_MS / 1000.0), 'f', 2));
67+
tip += "<br>";
68+
tip += i18n("Net max (last %2 secs): %1 KB/sec", locale().toString((maxBytes / 1024.0) / (INTERVAL_MS / 1000.0), 'f', 2), NET_INTERVAL_S);
69+
+#endif
70+
71+
if ( underMouse() )
72+
QToolTip::showText(QCursor::pos(), QLatin1String("<html>") + tip + QLatin1String("</html>"), this, rect());
73+
@@ -291,6 +306,7 @@
74+
painter.fillRect(x, y - h, BAR_WIDTH, h, memSwapColor);
75+
76+
77+
+#ifndef __TERMUX__
78+
// net
79+
x += BAR_WIDTH;
80+
y = contentsRect().y() + contentsRect().height();
81+
@@ -299,6 +315,7 @@
82+
y -= h;
83+
h = contentsRect().height() * (double(sumSent) / maxScale);
84+
painter.fillRect(x, y - h, BAR_WIDTH, h, netSentColor);
85+
+#endif
86+
}
87+
88+
//--------------------------------------------------------------------------------
89+
90+
--- a/SysTray.cxx
91+
+++ b/SysTray.cxx
92+
@@ -9,10 +9,12 @@
93+
#include <SysTray.hxx>
94+
#include <DBusTypes.hxx>
95+
#include <NotificationServer.hxx>
96+
+#ifndef __TERMUX__
97+
#include <Network.hxx>
98+
+#include <Bluetooth.hxx>
99+
+#endif
100+
#include <DeviceNotifier.hxx>
101+
#include <Battery.hxx>
102+
-#include <Bluetooth.hxx>
103+
104+
#ifdef WITH_PACKAGEKIT
105+
#include <PkUpdates.hxx>
106+
@@ -111,10 +113,14 @@
107+
QVector<QWidget *> internalWidgets =
108+
{
109+
notificationServer = new NotificationServer(this),
110+
+#ifndef __TERMUX__
111+
new Network(this),
112+
+#endif
113+
new DeviceNotifier(this),
114+
new Battery(this),
115+
+#ifndef __TERMUX__
116+
new Bluetooth(this),
117+
+#endif
118+
#ifdef WITH_PACKAGEKIT
119+
new PkUpdates(this)
120+
#endif
121+
122+
--- a/WeatherApplet.cxx
123+
+++ b/WeatherApplet.cxx
124+
@@ -24,7 +24,9 @@
125+
#include <KConfig>
126+
#include <KConfigGroup>
127+
#include <KLocalizedString>
128+
+#ifndef __TERMUX__
129+
#include <NetworkManagerQt/Manager>
130+
+#endif
131+
132+
//--------------------------------------------------------------------------------
133+
134+
@@ -96,12 +98,14 @@
135+
hbox->addStretch();
136+
}
137+
138+
+#ifndef __TERMUX__
139+
connect(NetworkManager::notifier(), &NetworkManager::Notifier::connectivityChanged, this,
140+
[this](NetworkManager::Connectivity connectivity)
141+
{
142+
if ( connectivity == NetworkManager::Full )
143+
fetchData();
144+
});
145+
+#endif
146+
}
147+
148+
//--------------------------------------------------------------------------------
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--- a/CMakeLists.txt
2+
+++ b/CMakeLists.txt
3+
@@ -21,7 +21,7 @@
4+
5+
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
6+
WindowSystem WidgetsAddons ConfigWidgets Config KIO IconThemes ItemViews Archive
7+
- Notifications I18n NetworkManagerQt Service Solid BluezQt KCMUtils Crash DBusAddons
8+
+ Notifications I18n Service Solid KCMUtils Crash DBusAddons
9+
NewStuff XmlGui
10+
)
11+
12+
@@ -52,12 +52,9 @@
13+
SysLoad.cxx
14+
NotificationServer.cxx
15+
NotificationList.cxx
16+
- Network.cxx
17+
- NetworkList.cxx
18+
DeviceNotifier.cxx
19+
DeviceList.cxx
20+
Battery.cxx
21+
- Bluetooth.cxx
22+
PopupMenu.cxx
23+
KdeConnect.cxx
24+
25+
@@ -125,10 +122,8 @@
26+
KF6::IconThemes
27+
KF6::Notifications
28+
KF6::I18n
29+
- KF6::NetworkManagerQt
30+
KF6::Service
31+
KF6::Solid
32+
- KF6::BluezQt
33+
KF6::KCMUtils
34+
KF6::Crash
35+
KF6::DBusAddons
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--- a/start_liquidshell
2+
+++ b/start_liquidshell
3+
@@ -8,7 +8,7 @@
4+
configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
5+
fi
6+
7+
-if [ -f /etc/xdg/autostart/plasmashell.desktop ]
8+
+if [ -f @TERMUX_PREFIX@/etc/xdg/autostart/plasmashell.desktop ]
9+
then
10+
plasmaFileName=$configDir/autostart/plasmashell.desktop
11+
else
12+
@@ -33,11 +33,11 @@
13+
Hidden=true
14+
EOF
15+
16+
-if [ -f /usr/bin/startkde ]
17+
+if [ -f @TERMUX_PREFIX@/bin/startkde ]
18+
then
19+
- /usr/bin/startkde
20+
+ @TERMUX_PREFIX@/bin/startkde
21+
else
22+
- /usr/bin/startplasma-x11
23+
+ @TERMUX_PREFIX@/bin/startplasma-x11
24+
fi
25+
26+
rm -f $plasmaFileName
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/Battery.cxx
2+
+++ b/Battery.cxx
3+
@@ -41,7 +41,7 @@
4+
hide();
5+
else
6+
{
7+
- QDBusConnection::systemBus()
8+
+ QDBusConnection::sessionBus()
9+
.connect("org.freedesktop.UPower",
10+
"/org/freedesktop/UPower",
11+
"org.freedesktop.DBus.Properties",
12+
@@ -55,7 +55,7 @@
13+
"org.freedesktop.DBus.Properties",
14+
"Get");
15+
msg << QLatin1String("org.freedesktop.UPower") << QLatin1String("OnBattery");
16+
- QDBusConnection::systemBus().callWithCallback(msg, this, SLOT(onBatteryReply(QDBusMessage)), nullptr);
17+
+ QDBusConnection::sessionBus().callWithCallback(msg, this, SLOT(onBatteryReply(QDBusMessage)), nullptr);
18+
19+
connect(device.as<Solid::Battery>(), &Solid::Battery::chargePercentChanged, this, &Battery::changed);
20+
connect(device.as<Solid::Battery>(), &Solid::Battery::chargeStateChanged, this, &Battery::changed);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
--- a/DesktopWidget.cxx
2+
+++ b/DesktopWidget.cxx
3+
@@ -161,11 +161,46 @@
4+
for (const QString &subdir : QDir(dirName).entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Readable))
5+
{
6+
QDir dir(dirName + '/' + subdir + "/contents/images");
7+
+#ifdef __TERMUX__
8+
+
9+
+QString bestMatch;
10+
+int bestScore = INT_MAX;
11+
+
12+
+for (const QString &fileName : dir.entryList(QDir::Files | QDir::Readable))
13+
+{
14+
+ if (!fileName.contains('x'))
15+
+ continue;
16+
+
17+
+ QStringList parts = fileName.split('x');
18+
+ if (parts.size() < 2)
19+
+ continue;
20+
+
21+
+ bool ok1 = false, ok2 = false;
22+
+ int w = parts[0].toInt(&ok1);
23+
+ int h = parts[1].split('.')[0].toInt(&ok2);
24+
+
25+
+ if (!ok1 || !ok2)
26+
+ continue;
27+
+
28+
+ int score = std::abs(w - width()) + std::abs(h - height());
29+
+
30+
+ if (score < bestScore)
31+
+ {
32+
+ bestScore = score;
33+
+ bestMatch = dir.absoluteFilePath(fileName);
34+
+ }
35+
+}
36+
+
37+
+if (!bestMatch.isEmpty())
38+
+ defaultFiles.append(bestMatch);
39+
+
40+
+#else
41+
for (const QString &fileName : dir.entryList(QDir::Files | QDir::Readable))
42+
{
43+
if ( fileName.startsWith(geometryString) )
44+
defaultFiles.append(dir.absoluteFilePath(fileName));
45+
}
46+
+#endif
47+
}
48+
}
49+
50+
@@ -177,7 +212,11 @@
51+
Wallpaper wallpaper;
52+
53+
wallpaper.color = group.readEntry("color", QColor(Qt::black));
54+
+#ifdef __TERMUX__
55+
+ wallpaper.mode = group.readEntry("wallpaperMode", QString("ScaledKeepRatioExpand"));
56+
+#else
57+
wallpaper.mode = group.readEntry("wallpaperMode", QString());
58+
+#endif
59+
60+
int idx = defaultFiles.count() ? ((i - 1) % defaultFiles.count()) : -1;
61+
wallpaper.fileName = group.readEntry("wallpaper", (idx != -1) ? defaultFiles[idx] : QString());

0 commit comments

Comments
 (0)