mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
use more hyprland dispatch exec instead of a process for simple stuff
This commit is contained in:
parent
9b0d769598
commit
ab9b17a188
6 changed files with 17 additions and 48 deletions
|
|
@ -4,6 +4,7 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Rectangle {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
|
@ -12,18 +13,6 @@ Rectangle {
|
|||
color: Appearance.colors.colLayer1
|
||||
radius: Appearance.rounding.small
|
||||
|
||||
Process {
|
||||
id: screenSnip
|
||||
|
||||
command: ["grimblast", "copy", "area"]
|
||||
}
|
||||
|
||||
Process {
|
||||
id: pickColor
|
||||
|
||||
command: ["hyprpicker", "-a"]
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
|
||||
|
|
@ -32,7 +21,7 @@ Rectangle {
|
|||
|
||||
SmallCircleButton {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: screenSnip.running = true
|
||||
onClicked: Hyprland.dispatch("exec grimblast copy area")
|
||||
|
||||
MaterialSymbol {
|
||||
anchors.centerIn: parent
|
||||
|
|
@ -45,7 +34,7 @@ Rectangle {
|
|||
|
||||
SmallCircleButton {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: pickColor.running = true
|
||||
onClicked: Hyprland.dispatch("exec hyprpicker -a")
|
||||
|
||||
MaterialSymbol {
|
||||
anchors.centerIn: parent
|
||||
|
|
|
|||
|
|
@ -24,11 +24,6 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
clip: !popup
|
||||
|
||||
Process {
|
||||
id: copyNotificationBody
|
||||
command: ["bash", "-c", `wl-copy "${notificationObject.body}"`]
|
||||
}
|
||||
|
||||
implicitHeight: ready ? notificationColumnLayout.implicitHeight + notificationListSpacing : 0
|
||||
Behavior on implicitHeight {
|
||||
enabled: enableAnimation
|
||||
|
|
@ -125,7 +120,7 @@ Item {
|
|||
}
|
||||
onPressAndHold: (mouse) => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
copyNotificationBody.running = true
|
||||
Hyprland.dispatch(`exec wl-copy '${notificationObject.body}'`)
|
||||
notificationSummaryText.text = `${notificationObject.summary} (copied)`
|
||||
}
|
||||
}
|
||||
|
|
@ -531,7 +526,7 @@ Item {
|
|||
(contentItem.implicitWidth + leftPadding + rightPadding)
|
||||
|
||||
onClicked: {
|
||||
copyNotificationBody.running = true
|
||||
Hyprland.dispatch(`exec wl-copy '${notificationObject.body}'`)
|
||||
copyIcon.text = "inventory"
|
||||
copyIconTimer.stop()
|
||||
copyIconTimer.start()
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Item { // Wrapper
|
||||
id: root
|
||||
|
|
@ -85,16 +86,6 @@ Item { // Wrapper
|
|||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: copyText
|
||||
property list<string> baseCommand: ["wl-copy"]
|
||||
function copyTextToClipboard(text) {
|
||||
copyText.running = false
|
||||
copyText.command = baseCommand.concat(text)
|
||||
copyText.running = true
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: webSearch
|
||||
property list<string> baseCommand: ["xdg-open"]
|
||||
|
|
@ -338,7 +329,7 @@ Item { // Wrapper
|
|||
fontType: "monospace",
|
||||
materialSymbol: 'calculate',
|
||||
execute: () => {
|
||||
copyText.copyTextToClipboard(root.mathResult);
|
||||
Hyprland.dispatch(`exec wl-copy '${root.mathResult}'`)
|
||||
}
|
||||
});
|
||||
// Run command
|
||||
|
|
|
|||
|
|
@ -1,29 +1,25 @@
|
|||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "../"
|
||||
import Quickshell.Io
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
|
||||
QuickToggleButton {
|
||||
property bool enabled: false
|
||||
buttonIcon: "gamepad"
|
||||
toggled: enabled
|
||||
|
||||
onClicked: {
|
||||
enabled = !enabled
|
||||
if (enabled) {
|
||||
gameModeOn.running = true
|
||||
// gameModeOn.running = true
|
||||
Hyprland.dispatch(`exec hyprctl --batch "keyword animations:enabled 0; keyword decoration:shadow:enabled 0; keyword decoration:blur:enabled 0; keyword general:gaps_in 0; keyword general:gaps_out 0; keyword general:border_size 1; keyword decoration:rounding 0; keyword general:allow_tearing 1"`)
|
||||
} else {
|
||||
gameModeOff.running = true
|
||||
Hyprland.dispatch("exec hyprctl reload")
|
||||
}
|
||||
}
|
||||
Process {
|
||||
id: gameModeOn
|
||||
command: ['bash', '-c', `hyprctl --batch "keyword animations:enabled 0; keyword decoration:shadow:enabled 0; keyword decoration:blur:enabled 0; keyword general:gaps_in 0; keyword general:gaps_out 0; keyword general:border_size 1; keyword decoration:rounding 0; keyword general:allow_tearing 1"`]
|
||||
}
|
||||
Process {
|
||||
id: gameModeOff
|
||||
command: ['bash', '-c', `hyprctl reload`]
|
||||
}
|
||||
|
||||
StyledToolTip {
|
||||
content: qsTr("Game mode")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
|
@ -88,5 +89,4 @@ Singleton {
|
|||
root.increment = -1
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ Singleton {
|
|||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
root.networkName = data
|
||||
// console.log("Network: " + data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,7 +45,6 @@ Singleton {
|
|||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
root.networkStrength = parseInt(data);
|
||||
// console.log("Network Strength: " + data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue