Open theme switcher on double right click on the desktop
This commit is contained in:
@@ -53,12 +53,22 @@ Item {
|
|||||||
if (!bgSwitchProc.running) bgSwitchProc.running = true
|
if (!bgSwitchProc.running) bgSwitchProc.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openThemeSwitcher() {
|
||||||
|
if (!themeSwitchProc.running) themeSwitchProc.running = true
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: bgSwitchProc
|
id: bgSwitchProc
|
||||||
command: ["bash", "-lc", "background=$(omarchy-theme-bg-switcher); [[ -n $background ]] && omarchy-theme-bg-set \"$background\""]
|
command: ["bash", "-lc", "background=$(omarchy-theme-bg-switcher); [[ -n $background ]] && omarchy-theme-bg-set \"$background\""]
|
||||||
onExited: root.refreshBackground()
|
onExited: root.refreshBackground()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: themeSwitchProc
|
||||||
|
command: ["bash", "-lc", "theme=$(omarchy-theme-switcher); [[ -n $theme ]] && omarchy-theme-set \"$theme\""]
|
||||||
|
onExited: root.refreshBackground()
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: readlinkProc
|
id: readlinkProc
|
||||||
command: ["readlink", "-f", root.currentBackgroundLink]
|
command: ["readlink", "-f", root.currentBackgroundLink]
|
||||||
@@ -251,8 +261,12 @@ Item {
|
|||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
onDoubleClicked: root.openSelector()
|
onDoubleClicked: function(mouse) {
|
||||||
|
if (mouse.button === Qt.RightButton) root.openThemeSwitcher()
|
||||||
|
else root.openSelector()
|
||||||
|
mouse.accepted = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user