provide basic descriptions for services

This commit is contained in:
end-4
2025-05-26 10:46:07 +02:00
parent f765fdf531
commit ede03f61bf
21 changed files with 85 additions and 14 deletions
@@ -1,6 +1,9 @@
import "root:/modules/common"
import QtQuick;
/**
* Represents a message in an AI conversation. (Kind of) follows the OpenAI API message structure.
*/
QtObject {
property string role
property string content
@@ -4,6 +4,9 @@ import "root:/modules/common/functions/fuzzysort.js" as Fuzzy
import Quickshell
import Quickshell.Io
/**
* Eases searching for applications by name.
*/
Singleton {
id: root
+3
View File
@@ -4,6 +4,9 @@ import Quickshell.Services.Pipewire
pragma Singleton
pragma ComponentBehavior: Bound
/**
* A nice wrapper for default Pipewire audio sink and source.
*/
Singleton {
id: root
@@ -5,6 +5,9 @@ import Quickshell;
import Quickshell.Io;
import QtQuick;
/**
* Basic polled Bluetooth state.
*/
Singleton {
id: root
+3
View File
@@ -7,6 +7,9 @@ import Quickshell.Io;
import Qt.labs.platform
import QtQuick;
/**
* A service for interacting with various booru APIs.
*/
Singleton {
id: root
property Component booruResponseDataComponent: BooruResponseData {}
@@ -1,6 +1,9 @@
import "root:/modules/common"
import QtQuick;
/**
* A booru response.
*/
QtObject {
property string provider
property var tags
+4 -1
View File
@@ -1,7 +1,7 @@
pragma Singleton
pragma ComponentBehavior: Bound
// From https://github.com/caelestia-dots/shell/ (`quickshell` branch)
// From https://github.com/caelestia-dots/shell/ (`quickshell` branch) with modifications.
// It does not have a license, but the author has given permission.
import Quickshell
@@ -9,6 +9,9 @@ import Quickshell.Io
import Quickshell.Hyprland
import QtQuick
/**
* For managing brightness of monitors. Supports both brightnessctl and ddcutil.
*/
Singleton {
id: root
@@ -10,6 +10,11 @@ import Quickshell.Io
import Quickshell.Hyprland
import Qt.labs.platform
/**
* Loads and manages the shell configuration file.
* The config file is by default at XDG_CONFIG_HOME/illogical-impulse/config.json.
* Automatically reloaded when the file changes, but does not provide a way to save changes.
*/
Singleton {
id: root
property string fileDir: `${XdgDirectories.config}/illogical-impulse`
+3
View File
@@ -5,6 +5,9 @@ import Quickshell.Io
pragma Singleton
pragma ComponentBehavior: Bound
/**
* A nice wrapper for date and time strings.
*/
Singleton {
property string time: Qt.formatDateTime(clock.date, "hh:mm")
property string date: Qt.formatDateTime(clock.date, "dddd, dd/MM")
@@ -7,6 +7,9 @@ import Quickshell.Io
import Quickshell.Wayland
import Quickshell.Hyprland
/**
* Provides access to some Hyprland data not available in Quickshell.Hyprland.
*/
Singleton {
id: root
property var windowList: []
@@ -9,8 +9,15 @@ import Quickshell.Io
import Quickshell.Wayland
import Quickshell.Hyprland
/**
* A service that provides access to Hyprland keybinds.
* Uses the `get_keybinds.py` script to parse comments in config files in a certain format and convert to JSON.
*/
Singleton {
id: root
property string keybindParserPath: FileUtils.trimFileProtocol(`${XdgDirectories.config}/quickshell/scripts/hyprland/get_keybinds.py`)
property string defaultKeybindConfigPath: FileUtils.trimFileProtocol(`${XdgDirectories.config}/hypr/hyprland/keybinds.conf`)
property string userKeybindConfigPath: FileUtils.trimFileProtocol(`${XdgDirectories.config}/hypr/custom/keybinds.conf`)
property var defaultKeybinds: {"children": []}
property var userKeybinds: {"children": []}
property var keybinds: ({
@@ -34,8 +41,7 @@ Singleton {
Process {
id: getDefaultKeybinds
running: true
command: [FileUtils.trimFileProtocol(`${XdgDirectories.config}/quickshell/scripts/hyprland/get_keybinds.py`),
"--path", FileUtils.trimFileProtocol(`${XdgDirectories.config}/hypr/hyprland/keybinds.conf`),]
command: [root.keybindParserPath, "--path", root.defaultKeybindConfigPath,]
stdout: SplitParser {
onRead: data => {
@@ -51,8 +57,7 @@ Singleton {
Process {
id: getUserKeybinds
running: true
command: [FileUtils.trimFileProtocol(`${XdgDirectories.config}/quickshell/scripts/hyprland/get_keybinds.py`),
"--path", FileUtils.trimFileProtocol(`${XdgDirectories.config}/hypr/custom/keybinds.conf`),]
command: [root.keybindParserPath, "--path", root.userKeybindConfigPath]
stdout: SplitParser {
onRead: data => {
@@ -8,14 +8,15 @@ import Quickshell.Io;
import Qt.labs.platform
import QtQuick;
/**
* For storing sensitive data in the keyring.
* Use this for small data only, since it stores a JSON of the contents directly and doesn't use a database.
*/
Singleton {
id: root
property bool loaded: false
property var keyringData: ({})
// onKeyringDataChanged: {
// console.log("[KeyringStorage] Keyring data changed:", JSON.stringify(root.keyringData));
// }
property var properties: {
"application": "illogical-impulse",
@@ -11,12 +11,12 @@ import Quickshell.Hyprland
import Qt.labs.platform
/**
* Renders LaTeX snippets with MicroTeX.
* For every request:
* 1. Hash it
* 2. Check if the hash is already processed
* 3. If not, render it with MicroTeX and mark as processed
*/
* Renders LaTeX snippets with MicroTeX.
* For every request:
* 1. Hash it
* 2. Check if the hash is already processed
* 3. If not, render it with MicroTeX and mark as processed
*/
Singleton {
id: root
@@ -6,6 +6,10 @@ import QtQuick
import Quickshell
import Quickshell.Io
/**
* Automatically reloads generated material colors.
* It is necessary to run reapplyTheme() on startup because Singletons are lazily loaded.
*/
Singleton {
id: root
property string filePath: `${XdgDirectories.state}/user/generated/colors.json`
@@ -1,12 +1,18 @@
pragma Singleton
pragma ComponentBehavior: Bound
// From https://git.outfoxxed.me/outfoxxed/nixnew
// It does not have a license, but the author is okay with redistribution.
import QtQml.Models
import QtQuick
import Quickshell
import Quickshell.Io
import Quickshell.Services.Mpris
/**
* A service that provides easy access to the active Mpris player.
*/
Singleton {
id: root;
property MprisPlayer trackedPlayer: null;
+3
View File
@@ -6,6 +6,9 @@ import Quickshell.Io;
import Quickshell.Services.Pipewire;
import QtQuick;
/**
* Simple polled network state service.
*/
Singleton {
id: root
@@ -9,6 +9,12 @@ import Quickshell.Io
import Quickshell.Services.Notifications
import Qt.labs.platform
/**
* Provides extra features not in Quickshell.Services.Notifications:
* - Persistent storage
* - Popup notifications, with timeout
* - Notification groups by app
*/
Singleton {
id: root
component Notif: QtObject {
@@ -9,6 +9,10 @@ import Quickshell.Io
import Quickshell.Hyprland
import Qt.labs.platform
/**
* Manages persistent states across sessions.
* Run loadStates() once at startup to load the states, then use setState() and getState() to modify and access them.
*/
Singleton {
id: root
property string fileDir: XdgDirectories.state
@@ -6,6 +6,9 @@ import QtQuick
import Quickshell
import Quickshell.Io
/**
* Simple polled resource usage service with RAM, Swap, and CPU usage.
*/
Singleton {
property double memoryTotal: 1
property double memoryFree: 1
@@ -5,6 +5,9 @@ import QtQuick
import Quickshell
import Quickshell.Io
/**
* Provides some system info: distro, username.
*/
Singleton {
property string distroName: "Unknown"
property string distroId: "unknown"
+4
View File
@@ -7,6 +7,10 @@ import Quickshell.Io;
import Qt.labs.platform
import QtQuick;
/**
* Simple to-do list manager.
* Each item is an object with "content" and "done" properties.
*/
Singleton {
id: root
property var filePath: `${XdgDirectories.state}/user/todo.json`