Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions x11-packages/liquidshell/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TERMUX_PKG_HOMEPAGE="https://invent.kde.org/system/liquidshell"
TERMUX_PKG_DESCRIPTION="Basic desktop shell using QtWidgets"
TERMUX_PKG_LICENSE="GPL-3.0-or-later"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.10.1"
TERMUX_PKG_SRCURL="https://download.kde.org/stable/liquidshell/liquidshell-${TERMUX_PKG_VERSION}.tar.xz"
TERMUX_PKG_SHA256="4e079293a90c47fc3c862f4aa9472936a4cb8a2c72f16098d234997e86c8364a"
TERMUX_PKG_AUTO_UPDATE=true
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"
TERMUX_PKG_BUILD_DEPENDS="extra-cmake-modules"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DCMAKE_SYSTEM_NAME=Linux
-DKDE_INSTALL_QMLDIR=lib/qt6/qml
-DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins
"
148 changes: 148 additions & 0 deletions x11-packages/liquidshell/disable-network-and-bluetooth.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
--- a/SysLoad.cxx
+++ b/SysLoad.cxx
@@ -19,7 +19,9 @@

#include <KLocalizedString>

+#ifndef __TERMUX__
#include <NetworkManagerQt/Manager>
+#endif

//--------------------------------------------------------------------------------

@@ -45,20 +47,29 @@
timeoutTimer.start();
connect(&timeoutTimer, &QTimer::timeout, this, &SysLoad::fetch);

+#ifndef __TERMUX__
connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionChanged,
[this]() { maxScale = NET_INIT_SCALE; maxBytes = 0; }); // reset since we're changing network (which might be slower)
+#endif

// gradually decrease max network throughput to really be able to see when network traffic occurs
+#ifndef __TERMUX__
netLoadTimer.setInterval(NET_INTERVAL_S * 1000);
netLoadTimer.start();
connect(&netLoadTimer, &QTimer::timeout, this, [this]() { maxBytes = 0; if ( maxScale > NET_INIT_SCALE ) maxScale /= 2; });
+#endif

fetch();

const int cpuBars = cpuSummaryBar ? 1 : cpus.count();
const int cpuBarWidth = (cpuBars <= 4) ? BAR_WIDTH : SMALL_BAR_WIDTH;
+#ifdef __TERMUX__
+ setFixedWidth((cpuBars * cpuBarWidth) + (2 * BAR_WIDTH) +
+ contentsMargins().left() + contentsMargins().right());
+#else
setFixedWidth((cpuBars * cpuBarWidth) + ((2 + 1) * BAR_WIDTH) + // 2 memory bars, 1 net - they shall be more prominent
contentsMargins().left() + contentsMargins().right());
+#endif
}

//--------------------------------------------------------------------------------
@@ -143,6 +154,7 @@
f.close();
}

+#ifndef __TERMUX__
f.setFileName("/proc/net/dev");
sumSent = sumReceived = 0;
if ( f.open(QIODevice::ReadOnly) )
@@ -190,6 +202,7 @@

maxBytes = std::max(maxBytes, (sumReceived + sumSent));
maxScale = std::max(maxBytes, maxScale);
+#endif

update();

@@ -220,11 +233,13 @@
tip += i18n("Swap Free: %1 MB (%2 GB)" , swapFree / 1024, locale().toString(swapFree / 1024.0 / 1024.0, 'f', 2));

tip += "<hr>";
+#ifndef __TERMUX__
tip += i18n("Net send/receive: %1/%2 KB/sec",
locale().toString((sumSent / 1024.0) / (INTERVAL_MS / 1000.0), 'f', 2),
locale().toString((sumReceived / 1024.0) / (INTERVAL_MS / 1000.0), 'f', 2));
tip += "<br>";
tip += i18n("Net max (last %2 secs): %1 KB/sec", locale().toString((maxBytes / 1024.0) / (INTERVAL_MS / 1000.0), 'f', 2), NET_INTERVAL_S);
+#endif

if ( underMouse() )
QToolTip::showText(QCursor::pos(), QLatin1String("<html>") + tip + QLatin1String("</html>"), this, rect());
@@ -291,6 +306,7 @@
painter.fillRect(x, y - h, BAR_WIDTH, h, memSwapColor);


+#ifndef __TERMUX__
// net
x += BAR_WIDTH;
y = contentsRect().y() + contentsRect().height();
@@ -299,6 +315,7 @@
y -= h;
h = contentsRect().height() * (double(sumSent) / maxScale);
painter.fillRect(x, y - h, BAR_WIDTH, h, netSentColor);
+#endif
}

//--------------------------------------------------------------------------------

--- a/SysTray.cxx
+++ b/SysTray.cxx
@@ -9,10 +9,12 @@
#include <SysTray.hxx>
#include <DBusTypes.hxx>
#include <NotificationServer.hxx>
+#ifndef __TERMUX__
#include <Network.hxx>
+#include <Bluetooth.hxx>
+#endif
#include <DeviceNotifier.hxx>
#include <Battery.hxx>
-#include <Bluetooth.hxx>

#ifdef WITH_PACKAGEKIT
#include <PkUpdates.hxx>
@@ -111,10 +113,14 @@
QVector<QWidget *> internalWidgets =
{
notificationServer = new NotificationServer(this),
+#ifndef __TERMUX__
new Network(this),
+#endif
new DeviceNotifier(this),
new Battery(this),
+#ifndef __TERMUX__
new Bluetooth(this),
+#endif
#ifdef WITH_PACKAGEKIT
new PkUpdates(this)
#endif

--- a/WeatherApplet.cxx
+++ b/WeatherApplet.cxx
@@ -24,7 +24,9 @@
#include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
+#ifndef __TERMUX__
#include <NetworkManagerQt/Manager>
+#endif

//--------------------------------------------------------------------------------

@@ -96,12 +98,14 @@
hbox->addStretch();
}

+#ifndef __TERMUX__
connect(NetworkManager::notifier(), &NetworkManager::Notifier::connectivityChanged, this,
[this](NetworkManager::Connectivity connectivity)
{
if ( connectivity == NetworkManager::Full )
fetchData();
});
+#endif
}

//--------------------------------------------------------------------------------
35 changes: 35 additions & 0 deletions x11-packages/liquidshell/remove-networkmanagerqt-bluezqt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@

find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
WindowSystem WidgetsAddons ConfigWidgets Config KIO IconThemes ItemViews Archive
- Notifications I18n NetworkManagerQt Service Solid BluezQt KCMUtils Crash DBusAddons
+ Notifications I18n Service Solid KCMUtils Crash DBusAddons
NewStuff XmlGui
)

@@ -52,12 +52,9 @@
SysLoad.cxx
NotificationServer.cxx
NotificationList.cxx
- Network.cxx
- NetworkList.cxx
DeviceNotifier.cxx
DeviceList.cxx
Battery.cxx
- Bluetooth.cxx
PopupMenu.cxx
KdeConnect.cxx

@@ -125,10 +122,8 @@
KF6::IconThemes
KF6::Notifications
KF6::I18n
- KF6::NetworkManagerQt
KF6::Service
KF6::Solid
- KF6::BluezQt
KF6::KCMUtils
KF6::Crash
KF6::DBusAddons
26 changes: 26 additions & 0 deletions x11-packages/liquidshell/use-prefix-paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- a/start_liquidshell
+++ b/start_liquidshell
@@ -8,7 +8,7 @@
configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
fi

-if [ -f /etc/xdg/autostart/plasmashell.desktop ]
+if [ -f @TERMUX_PREFIX@/etc/xdg/autostart/plasmashell.desktop ]
then
plasmaFileName=$configDir/autostart/plasmashell.desktop
else
@@ -33,11 +33,11 @@
Hidden=true
EOF

-if [ -f /usr/bin/startkde ]
+if [ -f @TERMUX_PREFIX@/bin/startkde ]
then
- /usr/bin/startkde
+ @TERMUX_PREFIX@/bin/startkde
else
- /usr/bin/startplasma-x11
+ @TERMUX_PREFIX@/bin/startplasma-x11
fi

rm -f $plasmaFileName
20 changes: 20 additions & 0 deletions x11-packages/liquidshell/use-session-bus.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/Battery.cxx
+++ b/Battery.cxx
@@ -41,7 +41,7 @@
hide();
else
{
- QDBusConnection::systemBus()
+ QDBusConnection::sessionBus()
.connect("org.freedesktop.UPower",
"/org/freedesktop/UPower",
"org.freedesktop.DBus.Properties",
@@ -55,7 +55,7 @@
"org.freedesktop.DBus.Properties",
"Get");
msg << QLatin1String("org.freedesktop.UPower") << QLatin1String("OnBattery");
- QDBusConnection::systemBus().callWithCallback(msg, this, SLOT(onBatteryReply(QDBusMessage)), nullptr);
+ QDBusConnection::sessionBus().callWithCallback(msg, this, SLOT(onBatteryReply(QDBusMessage)), nullptr);

connect(device.as<Solid::Battery>(), &Solid::Battery::chargePercentChanged, this, &Battery::changed);
connect(device.as<Solid::Battery>(), &Solid::Battery::chargeStateChanged, this, &Battery::changed);
Loading