Skip to content

Conversation

@Abscissa24
Copy link
Contributor

@Abscissa24 Abscissa24 commented Sep 17, 2025

Summary

Added an easier way to change DNS on the fly

NOTE: Idk why set-dns.py is not running after:
image

Before

Screenshot_2025-09-17_10 08 52

After

image

Changes

Added set-dns.py script that:

  • Reads dashboard.customDNS from the user settings.
  • Detects the active network connection using nmcli.
  • Prompts for Wi-Fi password if missing, ensuring the connection can be updated.
  • Sets the custom DNS and disables automatic DNS resolution.
  • Reactivates the connection to apply changes immediately.
  • Prints the updated DNS configuration for verification.

Notes

  • I tried adding a button to apply the settings by executing the script. It did not work. Idk why.
  • I also tried adding a switch to toggle the script when switched on. also didnt work.

Usage

  1. Open Settings > Privacy
  2. Enter the DNS Address
  3. Run: python /usr/share/sleex/scripts/set-dns.py

Demo

  • This is me changing the DNS as a demonstration
example.mp4

property string userDesc: "Today is a good day to have a good day!"
property bool enableWeather: false
property string weatherLocation: "" // :)
property string customDNS: "" // :)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these comments plz

id: weatherSwitch
text: "Enabled"
checked: Config.options.dashboard.enableWeather
onClicked: checked = !checked;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't remove that. This makes the whole switch+label clickable, instead of just the switch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks AI generated, is it the case ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

I made set-dns.sh

But I didn't know how to execute it from the .qml file

So I shoved the set-dns.sh in AI and converted it to set-dns.py

Then used the similar format from /usr/share/sleex/modules/dashboard/quickToggles/IdleInhibitor.qml

but idk why it still isn't working

Copy link
Member

@LeVraiArdox LeVraiArdox Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it doesn't works ? In that case open the PR as draft and request a review when it's working

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script itself works
Just how to toggle from within settings is the issue
I'll draft now

@Abscissa24 Abscissa24 marked this pull request as draft September 19, 2025 11:11
@rudywasfound
Copy link
Member

no activity?

@Abscissa24
Copy link
Contributor Author

Writing exams> no activity?

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.

3 participants