mirror of
https://github.com/celesrenata/end-4-flakes.git
synced 2026-06-06 10:49:26 -05:00
143 lines
5.7 KiB
QML
143 lines
5.7 KiB
QML
import qs
|
|
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import Quickshell.Services.Pipewire
|
|
import Quickshell.Services.UPower
|
|
|
|
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: Quickshell.execDetached(["qs", "-p", Quickshell.shellPath("screenshot.qml")])
|
|
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: Quickshell.execDetached(["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: GlobalStates.oskOpen = !GlobalStates.oskOpen
|
|
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: Quickshell.execDetached(["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
|
|
}
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
active: Config.options.bar.utilButtons.showPerformanceProfileToggle
|
|
visible: Config.options.bar.utilButtons.showPerformanceProfileToggle
|
|
sourceComponent: CircleUtilButton {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
onClicked: event => {
|
|
if (PowerProfiles.hasPerformanceProfile) {
|
|
switch(PowerProfiles.profile) {
|
|
case PowerProfile.PowerSaver: PowerProfiles.profile = PowerProfile.Balanced
|
|
break;
|
|
case PowerProfile.Balanced: PowerProfiles.profile = PowerProfile.Performance
|
|
break;
|
|
case PowerProfile.Performance: PowerProfiles.profile = PowerProfile.PowerSaver
|
|
break;
|
|
}
|
|
} else {
|
|
PowerProfiles.profile = PowerProfiles.profile == PowerProfile.Balanced ? PowerProfile.PowerSaver : PowerProfile.Balanced
|
|
}
|
|
}
|
|
MaterialSymbol {
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
fill: 0
|
|
text: switch(PowerProfiles.profile) {
|
|
case PowerProfile.PowerSaver: return "battery_saver"
|
|
case PowerProfile.Balanced: return "dynamic_form"
|
|
case PowerProfile.Performance: return "speed"
|
|
}
|
|
iconSize: Appearance.font.pixelSize.large
|
|
color: Appearance.colors.colOnLayer2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|