From a94389ed69d836584593da591acd1300c0d0782c Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 8 Feb 2025 14:04:29 +0100 Subject: [PATCH] user options: add quick toggles order --- .../modules/.configuration/user_options.js | 3 +++ .config/ags/modules/sideright/sideright.js | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.config/ags/modules/.configuration/user_options.js b/.config/ags/modules/.configuration/user_options.js index e56e7628..89baf946 100644 --- a/.config/ags/modules/.configuration/user_options.js +++ b/.config/ags/modules/.configuration/user_options.js @@ -115,6 +115,9 @@ let configOptions = { 'order': ["gemini", "gpt", "waifu", "booru"], } }, + 'quickToggles': { + 'order': ["wifi", "bluetooth", "nightlight", "gamemode", "idleinhibitor", "cloudflarewarp"], + } }, 'search': { 'enableFeatures': { diff --git a/.config/ags/modules/sideright/sideright.js b/.config/ags/modules/sideright/sideright.js index 02b8f287..50258571 100644 --- a/.config/ags/modules/sideright/sideright.js +++ b/.config/ags/modules/sideright/sideright.js @@ -27,6 +27,18 @@ import { MaterialIcon } from '../.commonwidgets/materialicon.js'; import { ExpandingIconTabContainer } from '../.commonwidgets/tabcontainer.js'; import { checkKeybind } from '../.widgetutils/keybind.js'; +const QUICK_TOGGLES = { + 'wifi': ToggleIconWifi(), + 'bluetooth': ToggleIconBluetooth(), + 'rawinput': await ModuleRawInput(), + 'touchpad': await HyprToggleIcon('touchpad_mouse', 'No touchpad while typing', 'input:touchpad:disable_while_typing', {}), + 'nightlight': await ModuleNightLight(), + 'invertcolors': await ModuleInvertColors(), + 'gamemode': await ModuleGameMode(), + 'idleinhibitor': ModuleIdleInhibitor(), + 'cloudflarewarp': await ModuleCloudflareWarp(), +} + const centerWidgets = [ { name: getString('Notifications'), @@ -119,17 +131,7 @@ const timeRow = Box({ const togglesBox = Widget.Box({ hpack: 'center', className: 'sidebar-togglesbox spacing-h-5', - children: [ - ToggleIconWifi(), - ToggleIconBluetooth(), - // await ModuleRawInput(), - // await HyprToggleIcon('touchpad_mouse', 'No touchpad while typing', 'input:touchpad:disable_while_typing', {}), - await ModuleNightLight(), - await ModuleInvertColors(), - await ModuleGameMode(), - ModuleIdleInhibitor(), - await ModuleCloudflareWarp(), - ] + children: userOptions.sidebar.quickToggles.order.map(toggle => QUICK_TOGGLES[toggle]) }) export const sidebarOptionsStack = ExpandingIconTabContainer({