diff options
Diffstat (limited to '')
| -rw-r--r-- | config/BarConfig.qml | 2 | ||||
| -rw-r--r-- | config/Config.qml | 86 | ||||
| -rw-r--r-- | config/GeneralConfig.qml | 22 | ||||
| -rw-r--r-- | config/LauncherConfig.qml | 6 | ||||
| -rw-r--r-- | config/LockConfig.qml | 14 | ||||
| -rw-r--r-- | config/ServiceConfig.qml | 1 | ||||
| -rw-r--r-- | config/UserPaths.qml | 1 | ||||
| -rw-r--r-- | config/UtilitiesConfig.qml | 1 |
8 files changed, 8 insertions, 125 deletions
diff --git a/config/BarConfig.qml b/config/BarConfig.qml index 00df1ea..c9c9f1f 100644 --- a/config/BarConfig.qml +++ b/config/BarConfig.qml @@ -85,6 +85,7 @@ JsonObject { property bool showMicrophone: false property bool showKbLayout: false property bool showNetwork: true + property bool showWifi: true property bool showBluetooth: true property bool showBattery: true property bool showLockStatus: true @@ -100,5 +101,6 @@ JsonObject { property int trayMenuWidth: 300 property int batteryWidth: 250 property int networkWidth: 320 + property int kbLayoutWidth: 320 } } diff --git a/config/Config.qml b/config/Config.qml index 7a5c04f..9f66c73 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -21,61 +21,11 @@ Singleton { property alias osd: adapter.osd property alias session: adapter.session property alias winfo: adapter.winfo - property alias lock: adapter.lock property alias utilities: adapter.utilities property alias sidebar: adapter.sidebar property alias services: adapter.services property alias paths: adapter.paths - // Public save function - call this to persist config changes - function save(): void { - saveTimer.restart(); - recentlySaved = true; - recentSaveCooldown.restart(); - } - - property bool recentlySaved: false - - ElapsedTimer { - id: timer - } - - Timer { - id: saveTimer - - interval: 500 - onTriggered: { - timer.restart(); - try { - // Parse current config to preserve structure and comments if possible - let config = {}; - try { - config = JSON.parse(fileView.text()); - } catch (e) { - // If parsing fails, start with empty object - config = {}; - } - - // Update config with current values - config = serializeConfig(); - - // Save to file with pretty printing - fileView.setText(JSON.stringify(config, null, 2)); - } catch (e) { - Toaster.toast(qsTr("Failed to serialize config"), e.message, "settings_alert", Toast.Error); - } - } - } - - Timer { - id: recentSaveCooldown - - interval: 2000 - onTriggered: { - recentlySaved = false; - } - } - // Helper function to serialize the config object function serializeConfig(): var { return { @@ -91,7 +41,6 @@ Singleton { osd: serializeOsd(), session: serializeSession(), winfo: serializeWinfo(), - lock: serializeLock(), utilities: serializeUtilities(), sidebar: serializeSidebar(), services: serializeServices(), @@ -126,17 +75,13 @@ Singleton { function serializeGeneral(): var { return { + logo: general.logo, apps: { terminal: general.apps.terminal, audio: general.apps.audio, playback: general.apps.playback, explorer: general.apps.explorer }, - idle: { - lockBeforeSleep: general.idle.lockBeforeSleep, - inhibitWhenAudio: general.idle.inhibitWhenAudio, - timeouts: general.idle.timeouts - }, battery: { warnLevels: general.battery.warnLevels, criticalLevel: general.battery.criticalLevel @@ -179,6 +124,7 @@ Singleton { showMicrophone: bar.status.showMicrophone, showKbLayout: bar.status.showKbLayout, showNetwork: bar.status.showNetwork, + showWifi: bar.status.showWifi, showBluetooth: bar.status.showBluetooth, showBattery: bar.status.showBattery, showLockStatus: bar.status.showLockStatus @@ -248,9 +194,7 @@ Singleton { dragThreshold: launcher.dragThreshold, vimKeybinds: launcher.vimKeybinds, hiddenApps: launcher.hiddenApps, - useFuzzy: { - apps: launcher.useFuzzy.apps, - }, + useFuzzy: launcher.useFuzzy, sizes: { itemWidth: launcher.sizes.itemWidth, itemHeight: launcher.sizes.itemHeight, @@ -315,19 +259,6 @@ Singleton { }; } - function serializeLock(): var { - return { - recolourLogo: lock.recolourLogo, - enableFprint: lock.enableFprint, - maxFprintTries: lock.maxFprintTries, - sizes: { - heightMult: lock.sizes.heightMult, - ratio: lock.sizes.ratio, - centerWidth: lock.sizes.centerWidth - } - }; - } - function serializeUtilities(): var { return { enabled: utilities.enabled, @@ -374,7 +305,6 @@ Singleton { visualiserBars: services.visualiserBars, audioIncrement: services.audioIncrement, maxVolume: services.maxVolume, - smartScheme: services.smartScheme, defaultPlayer: services.defaultPlayer, playerAliases: services.playerAliases }; @@ -383,7 +313,6 @@ Singleton { function serializePaths(): var { return { wallpaper: paths.wallpaper, - face: paths.face, sessionGif: paths.sessionGif, mediaGif: paths.mediaGif }; @@ -407,13 +336,6 @@ Singleton { onLoaded: { try { JSON.parse(text()); - const elapsed = timer.elapsedMs(); - // Only show toast for external changes (not our own saves) and when elapsed time is meaningful - if (adapter.utilities.toasts.configLoaded && !recentlySaved && elapsed > 0) { - Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(elapsed), "rule_settings"); - } else if (adapter.utilities.toasts.configLoaded && recentlySaved && elapsed > 0) { - Toaster.toast(qsTr("Config saved"), qsTr("Config reloaded in %1ms").arg(elapsed), "rule_settings"); - } } catch (e) { Toaster.toast(qsTr("Failed to load config"), e.message, "settings_alert", Toast.Error); } @@ -422,7 +344,6 @@ Singleton { if (err !== FileViewError.FileNotFound) Toaster.toast(qsTr("Failed to read config file"), FileViewError.toString(err), "settings_alert", Toast.Warning); } - onSaveFailed: err => Toaster.toast(qsTr("Failed to save config"), FileViewError.toString(err), "settings_alert", Toast.Error) JsonAdapter { id: adapter @@ -439,7 +360,6 @@ Singleton { property OsdConfig osd: OsdConfig {} property SessionConfig session: SessionConfig {} property WInfoConfig winfo: WInfoConfig {} - property LockConfig lock: LockConfig {} property UtilitiesConfig utilities: UtilitiesConfig {} property SidebarConfig sidebar: SidebarConfig {} property ServiceConfig services: ServiceConfig {} diff --git a/config/GeneralConfig.qml b/config/GeneralConfig.qml index eecca01..2cf99e3 100644 --- a/config/GeneralConfig.qml +++ b/config/GeneralConfig.qml @@ -1,8 +1,8 @@ import Quickshell.Io JsonObject { + property string logo: "" property Apps apps: Apps {} - property Idle idle: Idle {} property Battery battery: Battery {} component Apps: JsonObject { @@ -12,26 +12,6 @@ JsonObject { property list<string> explorer: ["thunar"] } - component Idle: JsonObject { - property bool lockBeforeSleep: true - property bool inhibitWhenAudio: true - property list<var> timeouts: [ - { - timeout: 180, - idleAction: "lock" - }, - { - timeout: 300, - idleAction: "dpms off", - returnAction: "dpms on" - }, - { - timeout: 600, - idleAction: ["systemctl", "suspend-then-hibernate"] - } - ] - } - component Battery: JsonObject { property list<var> warnLevels: [ { diff --git a/config/LauncherConfig.qml b/config/LauncherConfig.qml index 6ab44d1..72f14cf 100644 --- a/config/LauncherConfig.qml +++ b/config/LauncherConfig.qml @@ -8,13 +8,9 @@ JsonObject { property int dragThreshold: 50 property bool vimKeybinds: false property list<string> hiddenApps: [] - property UseFuzzy useFuzzy: UseFuzzy {} + property bool useFuzzy: false property Sizes sizes: Sizes {} - component UseFuzzy: JsonObject { - property bool apps: false - } - component Sizes: JsonObject { property int itemWidth: 600 property int itemHeight: 57 diff --git a/config/LockConfig.qml b/config/LockConfig.qml deleted file mode 100644 index 2af4e2c..0000000 --- a/config/LockConfig.qml +++ /dev/null @@ -1,14 +0,0 @@ -import Quickshell.Io - -JsonObject { - property bool recolourLogo: false - property bool enableFprint: true - property int maxFprintTries: 3 - property Sizes sizes: Sizes {} - - component Sizes: JsonObject { - property real heightMult: 0.7 - property real ratio: 16 / 9 - property int centerWidth: 600 - } -} diff --git a/config/ServiceConfig.qml b/config/ServiceConfig.qml index d083b7a..0bd9145 100644 --- a/config/ServiceConfig.qml +++ b/config/ServiceConfig.qml @@ -10,7 +10,6 @@ JsonObject { property real audioIncrement: 0.1 property real brightnessIncrement: 0.1 property real maxVolume: 1.0 - property bool smartScheme: true property string defaultPlayer: "Spotify" property list<var> playerAliases: [ { diff --git a/config/UserPaths.qml b/config/UserPaths.qml index 0daa4e1..1ff6697 100644 --- a/config/UserPaths.qml +++ b/config/UserPaths.qml @@ -3,7 +3,6 @@ import Quickshell.Io JsonObject { property string wallpaper: "" - property string face: "" property string sessionGif: "root:/assets/len.gif" property string mediaGif: "root:/assets/bongocat.gif" } diff --git a/config/UtilitiesConfig.qml b/config/UtilitiesConfig.qml index 64eca91..0840886 100644 --- a/config/UtilitiesConfig.qml +++ b/config/UtilitiesConfig.qml @@ -22,6 +22,7 @@ JsonObject { property bool capsLockChanged: true property bool numLockChanged: true property bool kbLayoutChanged: true + property bool kbLimit: true property bool vpnChanged: true property bool nowPlaying: false } |