Commit graph

250 commits

Author SHA1 Message Date
Alexander Lohnau
907363c594 Remove Qt module includes 2024-02-16 13:38:23 +01:00
Vlad Zahorodnii
17f0674cc2 Adapt to renamed night light d-bus interface 2024-02-08 17:04:11 +00:00
Devin Lin
fffcd04aeb quicksettings/screenrotation: Fix initial state of quicksetting always being off
Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/298
2024-02-05 16:17:59 +00:00
l10n daemon script
7f1e574816 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"
2024-01-29 01:12:33 +00:00
Florian RICHER
d162f96a63 Find white torch 2024-01-18 19:20:45 +00:00
l10n daemon script
bba776a5fb 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"
2024-01-05 02:08:21 +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
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
Devin Lin
f2836a81d7 quicksettings/screenrotation: Ensure that state is up to date when screens are added 2023-12-17 17:46:40 -08: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
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
l10n daemon script
1a44c570f6 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-11-10 02:17:56 +00:00
Devin Lin
5b429b49d1 quicksettings/screenrotation: Ensure save
Ensures that https://invent.kde.org/plasma/plasma-mobile/-/merge_requests/390 saves the setting
2023-11-05 18:56:50 -08:00
Devin Lin
a0b9c2c569 quicksettings/screenrotation: Fix it by porting to changed API
It appears that the screen rotation DBus API was dropped with https://invent.kde.org/plasma/kscreen/-/merge_requests/237

Port to the new API.

Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/257
2023-11-05 15:09:33 -08:00
David Edmundson
ed37efdca3 Port from deprecated KWorkspace 2023-11-05 21:38:31 +00:00
Yari Polla
4f45654af6 Port mobileshell plugins to ecm_add_qml_module 2023-11-02 11:08:17 +00:00
l10n daemon script
6341f6619c 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-10-22 02:34:49 +00:00
Yari Polla
72657628b6 dataproviders: declare BatteryInfo as singleton 2023-10-21 11:32:41 +02:00
Yari Polla
73e020e448 dataproviders: declare AudioInfo as singleton 2023-10-21 11:32:41 +02:00
Alexander Lohnau
45072177d5 Remove unneeded entries from metadata files 2023-10-17 05:14:04 +00:00
Devin Lin
f9cc52aa9f quicksettings/nightcolor: Remove unnecessary and not working import 2023-09-26 22:42:48 -07:00
l10n daemon script
04dfd341fa 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-09-25 02:08:01 +00:00
Nicolas Fella
a75c95237e Remove import versions from networkmanager imports 2023-09-24 20:47:29 +00:00
Nicolas Fella
2a3f66f199 Remove QML import version 2023-09-19 22:43:53 +02:00
l10n daemon script
f2cedc32b6 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-08-15 02:14:27 +00:00
l10n daemon script
1eee8e5e8f 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-07-28 02:22:33 +00:00
l10n daemon script
c9ff39a26f 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-07-26 02:17:02 +00:00
Alexey Andreyev
127bbdf653 Port away from PlasmaCore and PlasmaExtras to Kirigami
See also:

https://pointieststick.com/2023/06/14/call-to-action-easy-porting-opportunity-in-plasma/
2023-07-25 01:13:52 +00:00
Nicolas Fella
93f1aa0310 Adapt to kded5->kded6 renaming 2023-06-27 22:15:18 +02:00
l10n daemon script
a80d7a1bea 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-06-21 02:20:37 +00:00
l10n daemon script
ead62a26cc 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-06-18 03:45:48 +00:00
l10n daemon script
06f7460c15 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-05-28 02:34:37 +00:00
l10n daemon script
a9bab2af9d 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-05-23 03:30:47 +00:00
l10n daemon script
2f53c54157 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-05-21 02:19:12 +00:00
l10n daemon script
c8bb30dc0b 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-05-09 02:28:58 +00:00
l10n daemon script
9f6345c3f3 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-05-08 02:24:47 +00:00
l10n daemon script
864a773645 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-05-05 02:38:44 +00:00
l10n daemon script
1ab9d8827e 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-04-24 02:56:05 +00:00
l10n daemon script
42bf272681 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-04-19 02:38:31 +00:00
l10n daemon script
f00a1baae9 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-04-13 02:33:38 +00:00
l10n daemon script
38e235b1b0 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-04-11 03:11:36 +00:00
l10n daemon script
c71737436e 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-04-05 02:36:13 +00:00
l10n daemon script
bea89f08c1 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-04-04 02:38:04 +00:00
l10n daemon script
4b911fa0bc 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-04-03 02:25:31 +00:00
l10n daemon script
17a86b7882 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-04-02 02:23:08 +00:00
l10n daemon script
7a67f19acb 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-04-01 02:26:14 +00:00
l10n daemon script
44d6ac35c1 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-03-31 02:33:03 +00:00
Devin Lin
fc5b968534 quicksettings: Add docked/convergence quick setting 2023-03-29 19:41:10 -07:00
l10n daemon script
c2b3e3cfc8 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-03-23 02:52:45 +00:00
Alexander Lohnau
749bb82ace Link to QtQml/QtQuick instead of KDeclarative targets
We actually don'T need any of those classes
2023-03-21 11:30:17 +00:00