mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-04 06:10:40 -04:00
updates
This commit is contained in:
parent
1f8cb3c145
commit
610604e80f
253 changed files with 27055 additions and 44 deletions
61
.config/ags/old/modules/quicksettings/widgets/Network.js
Normal file
61
.config/ags/old/modules/quicksettings/widgets/Network.js
Normal file
|
@ -0,0 +1,61 @@
|
|||
import { Menu, ArrowToggleButton } from "../ToggleButton.js"
|
||||
import icons from "../../../lib/icons.js"
|
||||
import { dependencies, sh } from "../../../lib/utils.js"
|
||||
import options from "../../../options.js"
|
||||
const { wifi } = await Service.import("network")
|
||||
|
||||
export const NetworkToggle = () => ArrowToggleButton({
|
||||
name: "network",
|
||||
icon: wifi.bind("icon_name"),
|
||||
label: wifi.bind("ssid").as(ssid => ssid || "Not Connected"),
|
||||
connection: [wifi, () => wifi.enabled],
|
||||
deactivate: () => wifi.enabled = false,
|
||||
activate: () => {
|
||||
wifi.enabled = true
|
||||
wifi.scan()
|
||||
},
|
||||
})
|
||||
|
||||
export const WifiSelection = () => Menu({
|
||||
name: "network",
|
||||
icon: wifi.bind("icon_name"),
|
||||
title: "Wifi Selection",
|
||||
content: [
|
||||
Widget.Box({
|
||||
vertical: true,
|
||||
setup: self => self.hook(wifi, () => self.children =
|
||||
wifi.access_points.map(ap => Widget.Button({
|
||||
on_clicked: () => {
|
||||
if (dependencies("nmcli"))
|
||||
Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`)
|
||||
},
|
||||
child: Widget.Box({
|
||||
children: [
|
||||
Widget.Icon(ap.iconName),
|
||||
Widget.Label(ap.ssid || ""),
|
||||
Widget.Icon({
|
||||
icon: icons.ui.tick,
|
||||
hexpand: true,
|
||||
hpack: "end",
|
||||
setup: self => Utils.idle(() => {
|
||||
if (!self.is_destroyed)
|
||||
self.visible = ap.active
|
||||
}),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
})),
|
||||
),
|
||||
}),
|
||||
Widget.Separator(),
|
||||
Widget.Button({
|
||||
on_clicked: () => sh(options.quicksettings.networkSettings),
|
||||
child: Widget.Box({
|
||||
children: [
|
||||
Widget.Icon(icons.ui.settings),
|
||||
Widget.Label("Network"),
|
||||
],
|
||||
}),
|
||||
}),
|
||||
],
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue