Commit graph

2772 commits

Author SHA1 Message Date
Devin Lin
77e59801d0 wallpaperimageplugin: Add plugin to allow for wallpaper editing in the shell 2024-01-02 03:32:15 +00:00
l10n daemon script
2b1b2d6a02 GIT_SILENT Sync po/docbooks with svn 2024-01-02 02:11:19 +00:00
Luis Büchi
cb2f857a4c increase size of grid items in halcyon homescreen 2024-01-01 23:17:08 +00:00
Florian RICHER
c43c5ce8c3 CMakeLists.txt : Add find_package(Libudev REQUIRED) 2024-01-01 13:51:58 +00:00
l10n daemon script
4ce31f44ec GIT_SILENT Sync po/docbooks with svn 2024-01-01 02:16:31 +00:00
Florian RICHER
5c6a97caa5 Flashlight : Use udev instead of hardcoded pinephone device file
# Goal of this patch

Use udev to change or detect flash device instead of hardcoded pinephone device file.
Inspired by phosh flash manager because it works in many devices. https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/src/torch-manager.c?ref_type=heads#L168-198

# Remaining work

- [x] Minimal project for testing
- [x] Try to build for pmOS to test in my device (OP6)
- [x] Need udev rules to work (Require write permission in brightness)

# Stabilization

- [x] read permission removed in max_brightness to check if no crash
> "Failed to read max_brightness from udev device" in log
- [x] read permission removed in brightness to check if no crash
> "Failed to read brightness from udev device" in log
- [x] "Break" match in my side to check if no crash occured when no device found
> "No flashlight found" in log

# Minimal project

It run in my device perfectly, it find device, get current value and max value and toggle flashlight. It require **root** permissions to write in device file.

```cpp
#include <iostream>
#include <cstring>
#include <libudev.h>

#define TORCH_SUBSYSTEM "leds"

int main() {
    struct udev* udev = udev_new();
    struct udev_enumerate* enumerate = udev_enumerate_new(udev);

    // Use to find all devices in subsystem "leds"
    // And use match sysname to filter only flash or torch
    // Example:
    //  - /sys/devices/platform/soc@0/c440000.spmi/spmi-0/0-03/c440000.spmi:pmic@3:led-controller@d300/leds/white:flash On OP6
    //  - /sys/devices/platform/soc@0/c440000.spmi/spmi-0/0-03/c440000.spmi:pmic@3:led-controller@d300/leds/yellow:flash On OP6
    //  - /sys/devices/platform/led-controller/leds/white:flash/brightness On pinephone
    udev_enumerate_add_match_subsystem(enumerate, TORCH_SUBSYSTEM);
    udev_enumerate_add_match_sysname(enumerate, "*:torch");
    udev_enumerate_add_match_sysname(enumerate, "*:flash");
    udev_enumerate_scan_devices(enumerate);

    struct udev_list_entry *devices = udev_enumerate_get_list_entry(enumerate);
    struct udev_list_entry *entry = udev_list_entry_get_next(devices);

    if (entry == nullptr) {
        std::cout << "No flashlight found" << std::endl;
        return 1;
    }

    const char *path = udev_list_entry_get_name(entry);
    struct udev_device *torch = udev_device_new_from_syspath(udev, path);

    const char *max_brightness = udev_device_get_sysattr_value(torch, "max_brightness");

    const char *brightness = udev_device_get_sysattr_value(torch, "brightness");

    bool enabled = std::strcmp(brightness, "0") != 0;
    udev_device_set_sysattr_value(torch, "brightness", const_cast<char*>(enabled ? "0" : max_brightness));

    udev_device_unref(torch);
    udev_enumerate_unref(enumerate);
    udev_unref(udev);
    return 0;
}
```

Build with `g++ torch.cpp -ludev -o torch`
Run with `sudo ./torch`

# Important info

- **udev** dependencies added
- destructor for flashlightutil added to unref udev_device

# Require udev rules

Files `/etc/udev/rules.d/99-flashlight.rules`
```bash
# Allow everyone to set brightness of flashlight (Required for plasma-mobile flashlightplugin)
SUBSYSTEMS=="leds", KERNEL=="*:flash|*:torch", RUN+="/bin/chmod 666 %S%p/brightness"
```

pmOS : See to add depends `eudev` and makedepends `eudev-dev`
2023-12-31 17:11:28 +00:00
l10n daemon script
f970aa7acf GIT_SILENT Sync po/docbooks with svn 2023-12-31 02:51:15 +00:00
Jonah Brüchert
d919403366 kcms: time: Avoid calling waitForFinished 2023-12-30 17:53:34 +00:00
l10n daemon script
48dd3ce33e GIT_SILENT Sync po/docbooks with svn 2023-12-30 02:23:00 +00:00
Devin Lin
0b45b5ed69 envmanager: Explicitly enable kdecoration plugin
Upgrading on pmOS from Plasma 5, where we used to ship custom configs seems to have kwin get stuck having the kdecoration plugin disabled. Manually enable it.
2023-12-29 15:44:26 -05:00
Devin Lin
f4aec3f0fc shell: Fix WallpaperSelector 2023-12-29 12:13:52 -05:00
Devin Lin
1cf51ae694 shell: Fix containment and wallpaper switching from being broken
Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/290
2023-12-28 15:55:23 -05:00
Devin Lin
bc18b29ce3 kwin/mobiletaskswitcher: Ensure that touch borders are registered 2023-12-28 15:24:35 -05:00
l10n daemon script
fc2b70170f GIT_SILENT Sync po/docbooks with svn 2023-12-28 02:18:11 +00:00
Nicolas Fella
42a0af5d7b Remove unnecessary id declaration from plugin metadata 2023-12-28 02:04:08 +01:00
Devin Lin
6b067b4a97 kcms/wifi: Don't show available card if there are no connections 2023-12-27 18:19:04 -05:00
Devin Lin
a41d567743 initialstart/wifi: Update to card based design 2023-12-27 18:17:16 -05:00
Devin Lin
975443045b kcms/wifi: Only show saved networks section when there is an entry 2023-12-27 17:40:09 -05:00
Devin Lin
fc10a6fe10 kcms/wifi: Add checked icon to connected Wi-Fi network 2023-12-27 14:45:50 -05:00
l10n daemon script
2a2e1da757 GIT_SILENT Sync po/docbooks with svn 2023-12-27 02:14:33 +00:00
l10n daemon script
438b5402a0 GIT_SILENT Sync po/docbooks with svn 2023-12-26 02:13:14 +00:00
Mr. Athozus
0615412ae2
Add hotspot in quicksettings list 2023-12-25 12:52:50 +01:00
l10n daemon script
02bccda542 GIT_SILENT Sync po/docbooks with svn 2023-12-24 02:56:13 +00:00
l10n daemon script
f0529cc88a GIT_SILENT Sync po/docbooks with svn 2023-12-23 02:36:25 +00:00
l10n daemon script
400d1ccfb2 GIT_SILENT Sync po/docbooks with svn 2023-12-22 02:29:00 +00:00
l10n daemon script
4d29b0f0ac SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-12-22 02:13:13 +00:00
l10n daemon script
d82d6667ea GIT_SILENT Sync po/docbooks with svn 2023-12-21 02:55:59 +00:00
Jonathan Esk-Riddell
bfcf93557d Update version number for 5.91.90
GIT_SILENT
2023-12-20 18:57:01 +00:00
Jonathan Esk-Riddell
87196815c3 Update version number for 5.91.0
GIT_SILENT
2023-12-20 12:05:07 +00:00
l10n daemon script
fe5f6a9ddd GIT_SILENT Sync po/docbooks with svn 2023-12-20 02:12:27 +00:00
l10n daemon script
01bb48d7f0 GIT_SILENT Sync po/docbooks with svn 2023-12-19 02:15:04 +00:00
l10n daemon script
e766b903e5 GIT_SILENT Sync po/docbooks with svn 2023-12-18 02:54:18 +00:00
Devin Lin
f2836a81d7 quicksettings/screenrotation: Ensure that state is up to date when screens are added 2023-12-17 17:46:40 -08:00
Devin Lin
2329e0a15d kcms/time: Overhaul UI
The old UI was very confusing to use, I changed it so that:
- Dialogs are used for the time and date picker, with user confirmation for changes
- Tumblers are not used for the time picker, use the time picker component from kclock
- Removed seconds selector (since it was always wrong)
- Fixed the time zone selector (it didn't work before)
- Properly support 24 hour time in the time picker

Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/286
2023-12-16 20:56:51 -08:00
Devin Lin
bcc553325c kcms/hotspot: Change UX to use a dialog rather than direct textfields
Otherwise it's not obvious to the user whether the changes were saved.
2023-12-16 18:42:52 -08:00
Devin Lin
8d564014b5 kcms: Don't add button row 2023-12-16 18:31:06 -08:00
l10n daemon script
4a71a634f5 GIT_SILENT Sync po/docbooks with svn 2023-12-17 02:13:49 +00:00
l10n daemon script
dbe069edfa SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-12-17 02:07:26 +00:00
Devin Lin
17024dfdd4 kcms/wifi: Port to MobileForm
Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/279
2023-12-16 14:33:02 -08:00
Devin Lin
c35e4a94d9 kcms/cellularnetworks: Don't prompt for password when unnecessary
scanDevices() is actually unnecessary here, and causes the polkit prompt to pop up as soon as the kcm is opened.

See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blob/main/data/org.freedesktop.ModemManager1.conf.polkit
2023-12-16 04:44:56 +00:00
Devin Lin
09b3964906 kcms/cellularnetwork: Improve APN selection and available networks 2023-12-16 04:43:55 +00:00
l10n daemon script
a816ec5495 GIT_SILENT Sync po/docbooks with svn 2023-12-16 02:17:50 +00:00
Laurent Montel
b69efbe601 Qt5 code as apps is qt6 only. 2023-12-15 21:41:40 +01:00
Devin Lin
c700e0a4b9 homescreens/folio: Add title to import file dialog 2023-12-14 23:04:25 -08:00
Devin Lin
1c2ec93843 kcms/cellularnetwork: Fix error condition 2023-12-14 22:01:00 -08:00
Devin Lin
30262da8a5 kcms/cellularnetwork: Port to qcoro to make it async
Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/284
2023-12-14 21:15:39 -08:00
l10n daemon script
71eb05e624 GIT_SILENT Sync po/docbooks with svn 2023-12-14 02:13:28 +00:00
l10n daemon script
1ab04d0f34 GIT_SILENT Sync po/docbooks with svn 2023-12-12 02:16:55 +00:00
l10n daemon script
303fbf4029 GIT_SILENT Sync po/docbooks with svn 2023-12-10 02:54:13 +00:00
Devin Lin
9ee734689c quicksetting/record: Disable for now
The quick setting causes the shell to crash https://invent.kde.org/plasma/plasma-mobile/-/issues/210
2023-12-08 19:17:07 -08:00