Switch from NM to netctl

I did that in the good old days, and I switched to NM because I didn't know then the wifi-menu interface. But, for a sneaky bug I don't understand, all my wireless interfaces became "Unavailable" on all my computers. No matter if I uninstall, reset anything related to NM. So, back to netctl with a nice script to automate connections
master
Quentin Duchemin 2024-05-01 10:29:37 +02:00
parent 730948ff31
commit b1e3ea44f8
4 changed files with 29 additions and 8 deletions

View File

@ -15,6 +15,7 @@ catppuccin-gtk-theme-macchiato
chafa chafa
chromium chromium
cups cups
dhcpcd
docker docker
dosfstools dosfstools
dkms dkms
@ -33,6 +34,7 @@ hplip
htop htop
i3-wm i3-wm
i3lock-color i3lock-color
ifplugd
imagemagick imagemagick
jq jq
kwayland5 kwayland5
@ -49,10 +51,8 @@ mlocate
nmap nmap
nemo nemo
neofetch neofetch
netctl
neovim neovim
network-manager-applet
networkmanager
nm-connection-editor
noto-fonts-emoji noto-fonts-emoji
numlockx numlockx
obsidian obsidian
@ -99,6 +99,7 @@ vim
vlc vlc
vscodium-bin vscodium-bin
wget wget
wpa_supplicant
xautolock xautolock
xclip xclip
xdg-user-dirs xdg-user-dirs

View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
echo -e "* Auto-create wired profil and autoconnect service for netctl..."
for i in `ip -br l | awk '$1 !~ "lo|vir|wl" { print $1}'`; do
echo -e "~ ${i}..."
cat <<- EOF | sudo tee /etc/netctl/${i}
Interface=${i}
Connection=ethernet
IP=dhcp
EOF
sudo systemctl enable --now netctl-ifplugd@${i}
# In case some old config stays....
sudo systemctl restart netctl-ifplugd@${i}
done
echo -e "* Autoconnect to wireless profiles..."
for i in `ip -br l | awk '$1 ~ "wl" { print $1}'`; do
sudo systemctl enable --now netctl-auto@${i}
done
# https://man.archlinux.org/man/netctl.special.7
echo -e "* Ensure connections are back when PC is resumed..."
sudo systemctl enable netctl-sleep

View File

@ -6,7 +6,7 @@ top_center = player-mpris
;top_center = xwindow ;top_center = xwindow
top_right = system-usb-udev backlight pulseaudio date top_right = system-usb-udev backlight pulseaudio date
bottom_left = i3 bottom_left = i3
bottom_center = updates-arch-combined wireless-network bottom_center = updates-arch-combined wired-network wireless-network
bottom_right = temperature cpu memory filesystem-custom bottom_right = temperature cpu memory filesystem-custom
[module/memory] [module/memory]

View File

@ -94,15 +94,13 @@ function init_system() {
# https://man.archlinux.org/man/rofi-dmenu.5 # https://man.archlinux.org/man/rofi-dmenu.5
echo -e "* Symlink dmenu → rofi..." echo -e "* Symlink dmenu → rofi..."
sudo ln -sf /usr/bin/rofi /usr/bin/dmenu sudo ln -sf /usr/bin/rofi /usr/bin/dmenu
echo -e "* Enabling required systemd units..." echo -e "* Enabling common systemd units..."
sudo systemctl enable --now NetworkManager
sudo systemctl enable --now systemd-timesyncd sudo systemctl enable --now systemd-timesyncd
sudo systemctl enable --now cups sudo systemctl enable --now cups
sudo systemctl enable --now bluetooth sudo systemctl enable --now bluetooth
sudo systemctl enable --now bluetooth-autoconnect sudo systemctl enable --now bluetooth-autoconnect
sudo systemctl enable --now updatedb.timer sudo systemctl enable --now updatedb.timer
# iwd will be used as a backend for NetworkManager ./.config/init_netctl.sh
sudo systemctl disable wpa_supplicant
echo -e "* Ensure hardware clock is up to date..." echo -e "* Ensure hardware clock is up to date..."
sudo hwclock --systohc sudo hwclock --systohc
# So that "Open in Terminal" works inc Nemo # So that "Open in Terminal" works inc Nemo