Share WiFi password with QR Code using Linux CLI
โ a year ago | ๐ 1 min read
We want to display current password and QR code of currently connected WiFi. We want to do this using Linux terminal and eventually bind this to a shortcut key and display it like a popup.The popup will be dismissed on any key press.
nmcli device wifi show-password
This should output the password and QR code to connect for currently connected WiFi.
alacritty --class Notice --title Wifi-info -o "window.dimensions.lines=20" -o "window.dimensions.columns=35" -o "window.position.x=5" -o "window.position.y=20" -e sh -c 'nmcli device wifi show-password && read -n 1'
Main part here is after -e flag where it runs the nmcli
command to show the qr and then waits for a keyboard input before dismissing the window. Before that flags and values set position, window name, window class, and dimension for alacritty terminal.
If you are using a tiling window manager then you may want to set the window rule to floating for given class.
Now, you can bind this to your favorite hot-key.
Share this on