forked from Shinonome/dots-hyprland
bar: component loader
This commit is contained in:
@@ -50,7 +50,7 @@ Singleton {
|
|||||||
interval: root.readWriteDelay
|
interval: root.readWriteDelay
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
configFileView.reload()
|
configFileView.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Singleton {
|
|||||||
interval: root.readWriteDelay
|
interval: root.readWriteDelay
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
configFileView.writeAdapter()
|
configFileView.writeAdapter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,12 +92,16 @@ Singleton {
|
|||||||
property string tool: "functions" // search, functions, or none
|
property string tool: "functions" // search, functions, or none
|
||||||
property list<var> extraModels: [
|
property list<var> extraModels: [
|
||||||
{
|
{
|
||||||
"api_format": "openai", // Most of the time you want "openai". Use "gemini" for Google's models
|
"api_format": "openai" // Most of the time you want "openai". Use "gemini" for Google's models
|
||||||
|
,
|
||||||
"description": "This is a custom model. Edit the config to add more! | Anyway, this is DeepSeek R1 Distill LLaMA 70B",
|
"description": "This is a custom model. Edit the config to add more! | Anyway, this is DeepSeek R1 Distill LLaMA 70B",
|
||||||
"endpoint": "https://openrouter.ai/api/v1/chat/completions",
|
"endpoint": "https://openrouter.ai/api/v1/chat/completions",
|
||||||
"homepage": "https://openrouter.ai/deepseek/deepseek-r1-distill-llama-70b:free", // Not mandatory
|
"homepage": "https://openrouter.ai/deepseek/deepseek-r1-distill-llama-70b:free" // Not mandatory
|
||||||
"icon": "spark-symbolic", // Not mandatory
|
,
|
||||||
"key_get_link": "https://openrouter.ai/settings/keys", // Not mandatory
|
"icon": "spark-symbolic" // Not mandatory
|
||||||
|
,
|
||||||
|
"key_get_link": "https://openrouter.ai/settings/keys" // Not mandatory
|
||||||
|
,
|
||||||
"key_id": "openrouter",
|
"key_id": "openrouter",
|
||||||
"model": "deepseek/deepseek-r1-distill-llama-70b:free",
|
"model": "deepseek/deepseek-r1-distill-llama-70b:free",
|
||||||
"name": "Custom: DS R1 Dstl. LLaMA 70B",
|
"name": "Custom: DS R1 Dstl. LLaMA 70B",
|
||||||
@@ -240,9 +244,15 @@ Singleton {
|
|||||||
property bool floatStyleShadow: true // Show shadow behind bar when cornerStyle == 1 (Float)
|
property bool floatStyleShadow: true // Show shadow behind bar when cornerStyle == 1 (Float)
|
||||||
property bool borderless: false // true for no grouping of items
|
property bool borderless: false // true for no grouping of items
|
||||||
property string topLeftIcon: "spark" // Options: "distro" or any icon name in ~/.config/quickshell/ii/assets/icons
|
property string topLeftIcon: "spark" // Options: "distro" or any icon name in ~/.config/quickshell/ii/assets/icons
|
||||||
|
property list<string> screenList: [] // List of names, like "eDP-1", find out with 'hyprctl monitors' command
|
||||||
property bool showBackground: true
|
property bool showBackground: true
|
||||||
property bool verbose: true
|
property bool verbose: true
|
||||||
property bool vertical: false
|
property bool vertical: false
|
||||||
|
property JsonObject indicators: JsonObject {
|
||||||
|
property JsonObject notifications: JsonObject {
|
||||||
|
property bool showUnreadCount: false
|
||||||
|
}
|
||||||
|
}
|
||||||
property JsonObject resources: JsonObject {
|
property JsonObject resources: JsonObject {
|
||||||
property bool alwaysShowSwap: true
|
property bool alwaysShowSwap: true
|
||||||
property bool alwaysShowCpu: true
|
property bool alwaysShowCpu: true
|
||||||
@@ -250,7 +260,9 @@ Singleton {
|
|||||||
property int swapWarningThreshold: 85
|
property int swapWarningThreshold: 85
|
||||||
property int cpuWarningThreshold: 90
|
property int cpuWarningThreshold: 90
|
||||||
}
|
}
|
||||||
property list<string> screenList: [] // List of names, like "eDP-1", find out with 'hyprctl monitors' command
|
property JsonObject tooltips: JsonObject {
|
||||||
|
property bool clickToShow: false
|
||||||
|
}
|
||||||
property JsonObject utilButtons: JsonObject {
|
property JsonObject utilButtons: JsonObject {
|
||||||
property bool showScreenSnip: true
|
property bool showScreenSnip: true
|
||||||
property bool showColorPicker: false
|
property bool showColorPicker: false
|
||||||
@@ -260,6 +272,13 @@ Singleton {
|
|||||||
property bool showPerformanceProfileToggle: false
|
property bool showPerformanceProfileToggle: false
|
||||||
property bool showScreenRecord: false
|
property bool showScreenRecord: false
|
||||||
}
|
}
|
||||||
|
property JsonObject weather: JsonObject {
|
||||||
|
property bool enable: false
|
||||||
|
property bool enableGPS: true // gps based location
|
||||||
|
property string city: "" // When 'enableGPS' is false
|
||||||
|
property bool useUSCS: false // Instead of metric (SI) units
|
||||||
|
property int fetchInterval: 10 // minutes
|
||||||
|
}
|
||||||
property JsonObject workspaces: JsonObject {
|
property JsonObject workspaces: JsonObject {
|
||||||
property bool monochromeIcons: true
|
property bool monochromeIcons: true
|
||||||
property int shown: 10
|
property int shown: 10
|
||||||
@@ -269,21 +288,6 @@ Singleton {
|
|||||||
property list<string> numberMap: ["1", "2"] // Characters to show instead of numbers on workspace indicator
|
property list<string> numberMap: ["1", "2"] // Characters to show instead of numbers on workspace indicator
|
||||||
property bool useNerdFont: false
|
property bool useNerdFont: false
|
||||||
}
|
}
|
||||||
property JsonObject weather: JsonObject {
|
|
||||||
property bool enable: false
|
|
||||||
property bool enableGPS: true // gps based location
|
|
||||||
property string city: "" // When 'enableGPS' is false
|
|
||||||
property bool useUSCS: false // Instead of metric (SI) units
|
|
||||||
property int fetchInterval: 10 // minutes
|
|
||||||
}
|
|
||||||
property JsonObject indicators: JsonObject {
|
|
||||||
property JsonObject notifications: JsonObject {
|
|
||||||
property bool showUnreadCount: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
property JsonObject tooltips: JsonObject {
|
|
||||||
property bool clickToShow: false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject battery: JsonObject {
|
property JsonObject battery: JsonObject {
|
||||||
@@ -343,7 +347,8 @@ Singleton {
|
|||||||
property int mouseScrollFactor: 120
|
property int mouseScrollFactor: 120
|
||||||
property int touchpadScrollFactor: 450
|
property int touchpadScrollFactor: 450
|
||||||
}
|
}
|
||||||
property JsonObject deadPixelWorkaround: JsonObject { // Hyprland leaves out 1 pixel on the right for interactions
|
property JsonObject deadPixelWorkaround: JsonObject {
|
||||||
|
// Hyprland leaves out 1 pixel on the right for interactions
|
||||||
property bool enable: false
|
property bool enable: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -358,7 +363,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject launcher: JsonObject {
|
property JsonObject launcher: JsonObject {
|
||||||
property list<string> pinnedApps: [ "org.kde.dolphin", "kitty", "cmake-gui"]
|
property list<string> pinnedApps: ["org.kde.dolphin", "kitty", "cmake-gui"]
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject light: JsonObject {
|
property JsonObject light: JsonObject {
|
||||||
@@ -463,7 +468,7 @@ Singleton {
|
|||||||
property bool monochromeIcons: true
|
property bool monochromeIcons: true
|
||||||
property bool showItemId: false
|
property bool showItemId: false
|
||||||
property bool invertPinnedItems: true // Makes the below a whitelist for the tray and blacklist for the pinned area
|
property bool invertPinnedItems: true // Makes the below a whitelist for the tray and blacklist for the pinned area
|
||||||
property list<var> pinnedItems: [ "Fcitx" ]
|
property list<var> pinnedItems: ["Fcitx"]
|
||||||
property bool filterPassive: true
|
property bool filterPassive: true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,12 +532,30 @@ Singleton {
|
|||||||
property JsonObject android: JsonObject {
|
property JsonObject android: JsonObject {
|
||||||
property int columns: 5
|
property int columns: 5
|
||||||
property list<var> toggles: [
|
property list<var> toggles: [
|
||||||
{ "size": 2, "type": "network" },
|
{
|
||||||
{ "size": 2, "type": "bluetooth" },
|
"size": 2,
|
||||||
{ "size": 1, "type": "idleInhibitor" },
|
"type": "network"
|
||||||
{ "size": 1, "type": "mic" },
|
},
|
||||||
{ "size": 2, "type": "audio" },
|
{
|
||||||
{ "size": 2, "type": "nightLight" }
|
"size": 2,
|
||||||
|
"type": "bluetooth"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size": 1,
|
||||||
|
"type": "idleInhibitor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size": 1,
|
||||||
|
"type": "mic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size": 2,
|
||||||
|
"type": "audio"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size": 2,
|
||||||
|
"type": "nightLight"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -546,7 +569,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject screenRecord: JsonObject {
|
property JsonObject screenRecord: JsonObject {
|
||||||
property string savePath: Directories.videos.replace("file://","") // strip "file://"
|
property string savePath: Directories.videos.replace("file://", "") // strip "file://"
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject screenSnip: JsonObject {
|
property JsonObject screenSnip: JsonObject {
|
||||||
@@ -580,11 +603,11 @@ Singleton {
|
|||||||
property int adviseUpdateThreshold: 75 // packages
|
property int adviseUpdateThreshold: 75 // packages
|
||||||
property int stronglyAdviseUpdateThreshold: 200 // packages
|
property int stronglyAdviseUpdateThreshold: 200 // packages
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject wallpaperSelector: JsonObject {
|
property JsonObject wallpaperSelector: JsonObject {
|
||||||
property bool useSystemFileDialog: false
|
property bool useSystemFileDialog: false
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject windows: JsonObject {
|
property JsonObject windows: JsonObject {
|
||||||
property bool showTitlebar: true // Client-side decoration for shell apps
|
property bool showTitlebar: true // Client-side decoration for shell apps
|
||||||
property bool centerTitle: true
|
property bool centerTitle: true
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ Singleton {
|
|||||||
// Cleanup on init
|
// Cleanup on init
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Quickshell.execDetached(["mkdir", "-p", `${shellConfig}`])
|
Quickshell.execDetached(["mkdir", "-p", `${shellConfig}`])
|
||||||
|
Quickshell.execDetached(["mkdir", "-p", `${userComponents}`])
|
||||||
Quickshell.execDetached(["mkdir", "-p", `${favicons}`])
|
Quickshell.execDetached(["mkdir", "-p", `${favicons}`])
|
||||||
Quickshell.execDetached(["bash", "-c", `rm -rf '${coverArt}'; mkdir -p '${coverArt}'`])
|
Quickshell.execDetached(["bash", "-c", `rm -rf '${coverArt}'; mkdir -p '${coverArt}'`])
|
||||||
Quickshell.execDetached(["bash", "-c", `rm -rf '${booruPreviews}'; mkdir -p '${booruPreviews}'`])
|
Quickshell.execDetached(["bash", "-c", `rm -rf '${booruPreviews}'; mkdir -p '${booruPreviews}'`])
|
||||||
|
|||||||
@@ -7,5 +7,6 @@ JsonObject {
|
|||||||
property list<var> leftWidgets: []
|
property list<var> leftWidgets: []
|
||||||
property list<var> centerWidgets: []
|
property list<var> centerWidgets: []
|
||||||
property list<var> rightWidgets: []
|
property list<var> rightWidgets: []
|
||||||
|
property bool m3ExpressiveGrouping: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import QtQuick
|
||||||
|
import qs.modules.common as C
|
||||||
|
|
||||||
|
// This is to enable future fancy styles for rectangles. Some ideas:
|
||||||
|
// - normal rounded rect
|
||||||
|
// - osk.sh
|
||||||
|
// - 3d
|
||||||
|
// i hope i actually get to this and not shrimply forget
|
||||||
|
Rectangle {
|
||||||
|
enum ContentLayer { Background, Pane, Group, Subgroup, Control }
|
||||||
|
property var contentLayer: StyledRectangle.ContentLayer.Pane // To appropriately add effects like shadows/3d-ization
|
||||||
|
|
||||||
|
color: switch(contentLayer) {
|
||||||
|
case StyledRectangle.ContentLayer.Background: C.Appearance.colors.colLayer0;
|
||||||
|
case StyledRectangle.ContentLayer.Pane: C.Appearance.colors.colLayer1;
|
||||||
|
case StyledRectangle.ContentLayer.Group: C.Appearance.colors.colLayer2;
|
||||||
|
case StyledRectangle.ContentLayer.Subgroup: C.Appearance.colors.colLayer3;
|
||||||
|
case StyledRectangle.ContentLayer.Control: C.Appearance.colors.colLayer4;
|
||||||
|
default: C.Appearance.colors.colLayer1;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import QtQuick
|
||||||
|
import qs.modules.common as C
|
||||||
|
|
||||||
|
FallbackLoader {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property string componentName
|
||||||
|
property string context // Path for the builtin component
|
||||||
|
|
||||||
|
readonly property string componentNameWithExt: componentName.endsWith(".qml") ? componentName : `${componentName}.qml`
|
||||||
|
|
||||||
|
source: `${C.Directories.userComponents}/${componentNameWithExt}`
|
||||||
|
fallbacks: [
|
||||||
|
...(context ? [ `${context}/${componentNameWithExt}` ] : []),
|
||||||
|
componentNameWithExt
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -16,11 +16,8 @@ Item {
|
|||||||
Side {
|
Side {
|
||||||
id: centerSide
|
id: centerSide
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
HBarUserFallbackComponentRepeater {
|
||||||
FallbackLoader {
|
componentNames: [["Workspaces"]]
|
||||||
asynchronous: true
|
|
||||||
source: "/home/end/.config/quickshell/ii/modules/ii/bar/WrongModuleName"
|
|
||||||
fallbacks: ["/home/end/.config/quickshell/ii/modules/ii/bar/Workspaces.qml"]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import qs.modules.common as C
|
||||||
|
import qs.modules.common.widgets as W
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property bool startSide: false
|
||||||
|
property bool endSide: false
|
||||||
|
|
||||||
|
property alias color: bg.color
|
||||||
|
property real margins: 4
|
||||||
|
property real padding: 4
|
||||||
|
default property alias data: layout.data
|
||||||
|
|
||||||
|
readonly property bool vertical: C.Config.options.bar.vertical
|
||||||
|
readonly property bool m3eRadius: C.Config.options.hefty.bar.m3ExpressiveGrouping
|
||||||
|
readonly property real barUndirectionalWidth: C.Config.options.bar.vertical ? C.Appearance.sizes.baseVerticalBarWidth : C.Appearance.sizes.baseBarHeight
|
||||||
|
|
||||||
|
implicitWidth: vertical ? barUndirectionalWidth : layout.implicitWidth + (padding + margins) * 2
|
||||||
|
implicitHeight: vertical ? layout.implicitHeight + (padding + margins) * 2 : barUndirectionalWidth
|
||||||
|
|
||||||
|
W.StyledRectangle {
|
||||||
|
id: bg
|
||||||
|
anchors.centerIn: parent
|
||||||
|
contentLayer: W.StyledRectangle.ContentLayer.Pane
|
||||||
|
|
||||||
|
width: (root.vertical ? root.barUndirectionalWidth : root.width) - root.margins * 2
|
||||||
|
height: (root.vertical ? root.height : root.barUndirectionalWidth) - root.margins * 2
|
||||||
|
|
||||||
|
property real fullRadius: Math.min(width, height) / 2
|
||||||
|
function getRadius(atSide) {
|
||||||
|
if (root.m3eRadius) {
|
||||||
|
if (atSide) return fullRadius;
|
||||||
|
else return C.Appearance.rounding.unsharpenmore;
|
||||||
|
} else {
|
||||||
|
return 12;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
property real startRadius: getRadius(root.startSide)
|
||||||
|
property real endRadius: getRadius(root.endSide)
|
||||||
|
topLeftRadius: startRadius
|
||||||
|
topRightRadius: root.vertical ? startRadius : endRadius
|
||||||
|
bottomLeftRadius: root.vertical ? endRadius : startRadius
|
||||||
|
bottomRightRadius: endRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
GridLayout {
|
||||||
|
id: layout
|
||||||
|
columns: C.Config.options.bar.vertical ? 1 : -1
|
||||||
|
anchors.centerIn: parent
|
||||||
|
property real spacing: 0
|
||||||
|
columnSpacing: spacing
|
||||||
|
rowSpacing: spacing
|
||||||
|
}
|
||||||
|
}
|
||||||
+61
@@ -0,0 +1,61 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import qs.modules.common as C
|
||||||
|
import qs.modules.common.widgets as W
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property list<var> componentNames
|
||||||
|
property string context: Quickshell.shellPath("modules/hefty/topLayer/bar/widgets")
|
||||||
|
|
||||||
|
model: {
|
||||||
|
const m = componentNames.map(item => {
|
||||||
|
if (item instanceof Array)
|
||||||
|
return ({"type": "container", "value": item});
|
||||||
|
else
|
||||||
|
return ({"type": "component", "value": item});
|
||||||
|
});
|
||||||
|
for (var i = 0;i < m.length; i++) {
|
||||||
|
const item = m[i];
|
||||||
|
if (item.type === "container") {
|
||||||
|
item.startSide = (i === 0) || (m[i - 1].type !== "container");
|
||||||
|
item.endSide = (i + 1 >= m.length) || (m[i + 1].type !== "container");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// print(JSON.stringify(m, null, 2));
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
delegate: DelegateChooser {
|
||||||
|
role: "type"
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
roleValue: "component"
|
||||||
|
delegate: W.UserFallbackLoader {
|
||||||
|
required property var modelData
|
||||||
|
componentName: modelData.value
|
||||||
|
context: root.context
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
roleValue: "container"
|
||||||
|
delegate: HBarGroupContainer {
|
||||||
|
id: group
|
||||||
|
required property var modelData
|
||||||
|
startSide: modelData.startSide
|
||||||
|
endSide: modelData.endSide
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: group.modelData.value
|
||||||
|
delegate: W.UserFallbackLoader {
|
||||||
|
required property var modelData
|
||||||
|
componentName: modelData
|
||||||
|
context: root.context
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import qs.modules.ii.bar as IIBar
|
||||||
|
import qs.modules.common as C
|
||||||
|
|
||||||
|
IIBar.Workspaces {
|
||||||
|
id: root
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
implicitWidth: root.vertical ? C.Appearance.sizes.verticalBarWidth : (root.workspaceButtonWidth * root.workspacesShown - 2)
|
||||||
|
implicitHeight: root.vertical ? (root.workspaceButtonWidth * root.workspacesShown - 2) : C.Appearance.sizes.barHeight
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user