Compare commits
4
Commits
v0.2.0
...
5962fc8354
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5962fc8354 | ||
|
|
1adcb9841c | ||
|
|
0e0f8555ed | ||
|
|
1d63e67554 |
@@ -40,10 +40,6 @@ JsonObject {
|
||||
id: "tray",
|
||||
enabled: true
|
||||
},
|
||||
{
|
||||
id: "network",
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
id: "clock",
|
||||
enabled: true
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Networking
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property list<NetworkDevice> netDevice: Networking.devices.values
|
||||
readonly property string networkName: getNetworkName()
|
||||
readonly property list<string> nicNames: networkInterfaceCardNames()
|
||||
|
||||
// Useless will prob remove
|
||||
function getConnectedDevices() {
|
||||
let connectedDevices = [];
|
||||
|
||||
for (var i = 0; i < netDevice.length; i++) {
|
||||
if (netDevice[i].connected === true) {
|
||||
connectedDevices.push(netDevice[i].name);
|
||||
}
|
||||
}
|
||||
return connectedDevices;
|
||||
}
|
||||
|
||||
// SHOULD retrieve network names of connected devices
|
||||
// Currently only gives connected nic name
|
||||
function getNetworkName() {
|
||||
const devices = netDevice.filter(device => device.connected === true);
|
||||
for (var i = 0; i < devices.length; i++) {
|
||||
return devices[i].name;
|
||||
}
|
||||
return "Failed network name";
|
||||
}
|
||||
|
||||
// Searches wired/wireless devices and sets them in a list
|
||||
function networkInterfaceCardNames() {
|
||||
let nicList = [];
|
||||
|
||||
for (let i = 0; i < netDevice.length; ++i) {
|
||||
nicList.push(netDevice[i].name);
|
||||
}
|
||||
|
||||
return nicList;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import qs.Config
|
||||
import qs.Helpers
|
||||
import qs.Modules.SysTray
|
||||
import qs.Modules.SysTray.Widgets
|
||||
import qs.Modules.Network
|
||||
import qs.Modules.Updates
|
||||
|
||||
RowLayout {
|
||||
@@ -185,15 +184,6 @@ RowLayout {
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "network"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: NetworkWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "media"
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import qs.Config
|
||||
import qs.Helpers
|
||||
import qs.Modules.SysTray
|
||||
import qs.Modules.SysTray.Widgets
|
||||
import qs.Modules.Network
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
@@ -6,7 +6,6 @@ import QtQuick
|
||||
import qs.Config
|
||||
import qs.Components
|
||||
import qs.Modules.WSOverview
|
||||
import qs.Modules.Network
|
||||
import qs.Modules.SysTray.Popouts
|
||||
import qs.Modules.Updates
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Networking
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Config
|
||||
import qs.Modules
|
||||
import qs.Helpers as Helpers
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property var wrapper
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
|
||||
spacing: 8
|
||||
|
||||
Repeater {
|
||||
model: Helpers.Network.devices
|
||||
|
||||
CustomRadioButton {
|
||||
id: network
|
||||
|
||||
required property NetworkDevice modelData
|
||||
|
||||
checked: Helpers.Network.activeDevice?.name === modelData.name
|
||||
text: modelData.description
|
||||
visible: modelData.name !== "lo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Modules
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.top: parent.top
|
||||
implicitWidth: layout.implicitWidth
|
||||
|
||||
RowLayout {
|
||||
id: layout
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.top: parent.top
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: "android_wifi_4_bar"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Components
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
CustomClippingRect {
|
||||
id: root
|
||||
|
||||
required property var wrapper
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
implicitHeight: 500 + 5 * 2
|
||||
implicitWidth: 500 + 8 * 2
|
||||
radius: (20 - Appearance.padding.small) * Appearance.rounding.scale
|
||||
|
||||
Item {
|
||||
id: networkPopContent
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Appearance.padding.small
|
||||
|
||||
CustomText {
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.top: parent.top
|
||||
font.pointSize: Appearance.font.size.large
|
||||
text: qsTr("Network")
|
||||
}
|
||||
|
||||
CustomText {
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
font.pointSize: Appearance.font.size.large
|
||||
text: Network.networkName
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
id: buttonScan
|
||||
|
||||
onClicked: {
|
||||
console.log("Network devices: " + Network.netDevice);
|
||||
console.log("Network interface names: " + Network.nicNames);
|
||||
console.log("Connected devices: " + Network.networkName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,11 @@ RowLayout {
|
||||
id: "audio",
|
||||
item: child
|
||||
};
|
||||
if (child.objectName === "networkWidget" && Config.barConfig.popouts.network)
|
||||
return {
|
||||
id: "network",
|
||||
item: child
|
||||
};
|
||||
if (child.objectName === "upowerWidget" && Config.barConfig.popouts.upower)
|
||||
return {
|
||||
id: "upower",
|
||||
@@ -137,6 +142,10 @@ RowLayout {
|
||||
objectName: "audioWidget"
|
||||
}
|
||||
|
||||
NetworkWidget {
|
||||
objectName: "networkWidget"
|
||||
}
|
||||
|
||||
UPowerWidget {
|
||||
height: parent.height
|
||||
objectName: "upowerWidget"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.Pipewire
|
||||
import qs.Daemons
|
||||
import qs.Modules
|
||||
import qs.Config
|
||||
import qs.Components
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
// property color barColor: DynamicColors.palette.m3primary
|
||||
property color textColor: DynamicColors.palette.m3onSurface
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
animate: true
|
||||
color: root.textColor // Network.connected ? root.textColor : DynamicColors.palette.m3error
|
||||
fill: 1
|
||||
font.pointSize: Appearance.font.size.larger
|
||||
text: "android_wifi_4_bar"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user