mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
31 lines
1.0 KiB
QML
31 lines
1.0 KiB
QML
import qs
|
|
import qs.services
|
|
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import qs.modules.common.functions
|
|
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Bluetooth
|
|
import Quickshell.Io
|
|
import Quickshell.Hyprland
|
|
|
|
QuickToggleButton {
|
|
id: root
|
|
visible: BluetoothStatus.available
|
|
toggled: BluetoothStatus.enabled
|
|
buttonIcon: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
|
|
onClicked: {
|
|
Bluetooth.defaultAdapter.enabled = !Bluetooth.defaultAdapter?.enabled
|
|
}
|
|
altAction: () => {
|
|
Quickshell.execDetached(["bash", "-c", `${Config.options.apps.bluetooth}`])
|
|
GlobalStates.sidebarRightOpen = false
|
|
}
|
|
StyledToolTip {
|
|
text: Translation.tr("%1 | Right-click to configure").arg(
|
|
(BluetoothStatus.firstActiveDevice?.name ?? Translation.tr("Bluetooth"))
|
|
+ (BluetoothStatus.activeDeviceCount > 1 ? ` +${BluetoothStatus.activeDeviceCount - 1}` : "")
|
|
)
|
|
}
|
|
}
|