Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let network module handle ipv4 and ipv6 simultaneously #3809

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

gustafullberg
Copy link
Contributor

I often switch between networks that use either IPv4 or IPv6.

As the network module supports IPv4 or IPv6 (but not both at the same time) I currently need to add two instances of the network module to my config and explicitly set the family to "ipv6" for one of them.

This PR makes the network module able to handle both IPv4 and IPv6 simultaneously. It is enough to have a single instance of the network module that handle both protocols and the family doesn't have to be specified. This is a bit simpler and probably what most users would expect.

@Alexays Alexays merged commit 78d2ce3 into Alexays:master Dec 7, 2024
@Alexays
Copy link
Owner

Alexays commented Dec 7, 2024

Thanks!

@voiceroy
Copy link

voiceroy commented Feb 24, 2025

I think this might have caused some bug, now I'm only shown ipv6 address by default. Even after me setting family to ipv4, I get the ipv6 address shown to me.
screenshot_19:10:46 24-02-2025

My config:

{
    "layer": "top",
	"position": "bottom",
	
    "modules-left": ["sway/workspaces", "network"],
    "modules-center": ["clock", "idle_inhibitor"],
    "modules-right": ["memory", "disk", "cpu", "temperature", "wireplumber","backlight", "battery", "tray"],

    "network": {
		"interface": "wlan0",
		"interval": 5,
		"family": "ipv4",
		"format-wifi": "NET: {essid} {ipaddr} ({signalStrength}%) D:{bandwidthDownBytes} U:{bandwidthUpBytes}",
		"format-disconnected": "No Network"
	},
	"backlight": {
		"format": "BRIGHT: {percent}%"
	},
    "battery": {
        "format": "BAT:{capacity}%",
		"interval": 60,
		"states": {
			"warning": 20,
			"critical": 10
		}
    },
    "clock": {
		"interval": 1,
		"format": "{:%I:%M:%S %p %a %d-%m-%Y}",
    },
	"cpu": {
		"interval": 10,
		"format": "CPU:{usage}%"
	},
	"disk": {
		"interval": 60,
		"format": "DISK:{used} {total}",
		"path": "/"
	},
	"memory": {
		"interval": 10,
		"format": "RAM:{used:0.1f}G {total:0.1f}G"
	},
	"wireplumber": {
		"format": "VOL:{volume}%",
		"on-click": "pavucontrol",
		"max-volume": 100,
		"scroll-ste": 5.0,
	},
	"temperature": {
		"hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input",
		"format": "TEMP:{temperatureC}°C"
	},
	"idle_inhibitor": {
		"format": "{icon}",
		"format-icons": {
			"activated": "●",
			"deactivated": "○"
		},
		"timeout": 30
	},
	"tray": {
		"icon-size": 16,
		"spacing": 10
	}
}

@NBAB42Bq
Copy link

NBAB42Bq commented Feb 25, 2025

Same problem here after update.

(Arch Linux, Sway)

2 similar comments
@MRSS02
Copy link

MRSS02 commented Mar 4, 2025

Same problem here after update.

(Arch Linux, Sway)

@efraletti
Copy link

Same problem here after update.

(Arch Linux, Sway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants