forked from Shinonome/dots-hyprland
init waffles
This commit is contained in:
@@ -28,12 +28,18 @@ import qs.modules.ii.overlay
|
||||
import qs.modules.ii.verticalBar
|
||||
import qs.modules.ii.wallpaperSelector
|
||||
|
||||
import qs.modules.waffle.bar
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
import qs.services
|
||||
|
||||
ShellRoot {
|
||||
id: root
|
||||
|
||||
// Force initialization of some singletons
|
||||
Component.onCompleted: {
|
||||
MaterialThemeLoader.reapplyTheme()
|
||||
@@ -67,11 +73,40 @@ ShellRoot {
|
||||
PanelLoader { identifier: "iiSidebarRight"; component: SidebarRight {} }
|
||||
PanelLoader { identifier: "iiVerticalBar"; extraCondition: Config.options.bar.vertical; component: VerticalBar {} }
|
||||
PanelLoader { identifier: "iiWallpaperSelector"; component: WallpaperSelector {} }
|
||||
PanelLoader { identifier: "wBar"; component: WaffleBar {} }
|
||||
|
||||
component PanelLoader: LazyLoader {
|
||||
required property string identifier
|
||||
property bool extraCondition: true
|
||||
active: Config.ready && Config.options.enabledPanels.includes(identifier) && extraCondition
|
||||
}
|
||||
|
||||
// Panel families
|
||||
property list<string> families: ["ii", "waffle"]
|
||||
property var panelFamilies: ({
|
||||
"ii": ["iiBar", "iiBackground", "iiCheatsheet", "iiDock", "iiLock", "iiMediaControls", "iiNotificationPopup", "iiOnScreenDisplay", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiReloadPopup", "iiScreenCorners", "iiSessionScreen", "iiSidebarLeft", "iiSidebarRight", "iiVerticalBar", "iiWallpaperSelector"],
|
||||
"waffle": ["wBar", "iiBackground", "iiCheatsheet", "iiDock", "iiLock", "iiMediaControls", "iiNotificationPopup", "iiOnScreenDisplay", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiReloadPopup", "iiScreenCorners", "iiSessionScreen", "iiSidebarLeft", "iiSidebarRight", "iiWallpaperSelector"],
|
||||
})
|
||||
function cyclePanelFamily() {
|
||||
const currentIndex = families.indexOf(Config.options.panelFamily)
|
||||
const nextIndex = (currentIndex + 1) % families.length
|
||||
Config.options.panelFamily = families[nextIndex]
|
||||
Config.options.enabledPanels = panelFamilies[Config.options.panelFamily]
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "panelFamily"
|
||||
|
||||
function cycle(): void {
|
||||
root.cyclePanelFamily()
|
||||
}
|
||||
}
|
||||
|
||||
GlobalShortcut {
|
||||
name: "panelFamilyCycle"
|
||||
description: "Cycles panel family"
|
||||
|
||||
onPressed: root.cyclePanelFamily()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user