mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
108 lines
4.1 KiB
QML
108 lines
4.1 KiB
QML
import "root:/modules/common"
|
|
import "root:/modules/common/widgets"
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
import Quickshell.Hyprland
|
|
import Quickshell.Services.Pipewire
|
|
|
|
Item {
|
|
id: root
|
|
property bool borderless: Config.options.bar.borderless
|
|
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
|
implicitHeight: rowLayout.implicitHeight
|
|
|
|
RowLayout {
|
|
id: rowLayout
|
|
|
|
spacing: 4
|
|
anchors.centerIn: parent
|
|
|
|
Loader {
|
|
active: Config.options.bar.utilButtons.showScreenSnip
|
|
visible: Config.options.bar.utilButtons.showScreenSnip
|
|
sourceComponent: CircleUtilButton {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent")
|
|
MaterialSymbol {
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
fill: 1
|
|
text: "screenshot_region"
|
|
iconSize: Appearance.font.pixelSize.large
|
|
color: Appearance.colors.colOnLayer2
|
|
}
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
active: Config.options.bar.utilButtons.showColorPicker
|
|
visible: Config.options.bar.utilButtons.showColorPicker
|
|
sourceComponent: CircleUtilButton {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
onClicked: Hyprland.dispatch("exec hyprpicker -a")
|
|
MaterialSymbol {
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
fill: 1
|
|
text: "colorize"
|
|
iconSize: Appearance.font.pixelSize.large
|
|
color: Appearance.colors.colOnLayer2
|
|
}
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
active: Config.options.bar.utilButtons.showKeyboardToggle
|
|
visible: Config.options.bar.utilButtons.showKeyboardToggle
|
|
sourceComponent: CircleUtilButton {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
onClicked: Hyprland.dispatch("global quickshell:oskToggle")
|
|
MaterialSymbol {
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
fill: 0
|
|
text: "keyboard"
|
|
iconSize: Appearance.font.pixelSize.large
|
|
color: Appearance.colors.colOnLayer2
|
|
}
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
active: Config.options.bar.utilButtons.showMicToggle
|
|
visible: Config.options.bar.utilButtons.showMicToggle
|
|
sourceComponent: CircleUtilButton {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle")
|
|
MaterialSymbol {
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
fill: 0
|
|
text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic"
|
|
iconSize: Appearance.font.pixelSize.large
|
|
color: Appearance.colors.colOnLayer2
|
|
}
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
active: Config.options.bar.utilButtons.showDarkModeToggle
|
|
visible: Config.options.bar.utilButtons.showDarkModeToggle
|
|
sourceComponent: CircleUtilButton {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
onClicked: event => {
|
|
if (Appearance.m3colors.darkmode) {
|
|
Hyprland.dispatch(`exec ${Directories.wallpaperSwitchScriptPath} --mode light --noswitch`);
|
|
} else {
|
|
Hyprland.dispatch(`exec ${Directories.wallpaperSwitchScriptPath} --mode dark --noswitch`);
|
|
}
|
|
}
|
|
MaterialSymbol {
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
fill: 0
|
|
text: Appearance.m3colors.darkmode ? "light_mode" : "dark_mode"
|
|
iconSize: Appearance.font.pixelSize.large
|
|
color: Appearance.colors.colOnLayer2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|