mirror of
https://github.com/celesrenata/end-4-flakes.git
synced 2026-06-06 10:49:26 -05:00
35 lines
1018 B
QML
35 lines
1018 B
QML
import qs.services
|
|
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import qs.modules.common.functions
|
|
import "../"
|
|
import qs
|
|
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
import Quickshell.Hyprland
|
|
|
|
QuickToggleButton {
|
|
toggled: Network.networkName.length > 0 && Network.networkName != "lo"
|
|
buttonIcon: Network.materialSymbol
|
|
onClicked: {
|
|
toggleNetwork.running = true
|
|
}
|
|
altAction: () => {
|
|
Quickshell.execDetached(["bash", "-c", `${Network.ethernet ? Config.options.apps.networkEthernet : Config.options.apps.network}`])
|
|
GlobalStates.sidebarRightOpen = false
|
|
}
|
|
Process {
|
|
id: toggleNetwork
|
|
command: ["bash", "-c", "nmcli radio wifi | grep -q enabled && nmcli radio wifi off || nmcli radio wifi on"]
|
|
onRunningChanged: {
|
|
if(!running) {
|
|
Network.update()
|
|
}
|
|
}
|
|
}
|
|
StyledToolTip {
|
|
content: Translation.tr("%1 | Right-click to configure").arg(Network.networkName)
|
|
}
|
|
}
|