Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Waybar extension to manage a Wireguard connection using Systemd and Rofi.

License

NotificationsYou must be signed in to change notification settings

Klafyvel/wireguard-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple, stupidwaybar extension for togglingwireguard. It usesrofi for password prompting, but you could use anything you like.

Screenshots

VPN switched offVPN switched off, as seen in Waybar.

Password promptPassword prompt with Rofi.

VPN switched onVPN switched on, as seen in Waybar.

Prerequisites

You need to be able to manage Wireguard using systemd, even though it shouldnot be too difficult to change the script to usewg directly.

If your Wireguard interface iswg0, enable the service using:

sudo systemctlenable wg-quick@wg0.servicesudo systemctl daemon-reload

You also needrofi.

Installation

Clone the repository in~/.config/waybar/wireguard-manager, then add this to~/.config/waybar/config :

"custom/wireguard-manager": {"exec":"exec ~/.config/waybar/wireguard-manager/wireguard-manager.sh -s","format":"{icon}","format-icons": {"connected":"<span color=\"#50fa7b\">VPN: 🔒</span>","disconnected":"<span color=\"#ff5555\">VPN: 🔓</span>",    },"interval":"once","on-click":"~/.config/waybar/wireguard-manager/wireguard-manager.sh -t && pkill -SIGRTMIN+1 waybar","return-type":"json","signal":1,}

SeeWaybar's wiki formore information on how to customize this.

Toggling WireGuard "manually"

If you intend on turning your Wireguard tunnel on and off through other means other than clicking on this waybar module, it can be useful to set the module itself in a different fashion:

"custom/wireguard-manager": {"interval":3,"return-type":"json","format-icons": {"connected":"<span color=\"#50fa7b\">VPN: 🔒</span>","disconnected":"<span color=\"#ff5555\">VPN: 🔓</span>"    },"on-click":"exec ~/.config/waybar/wireguard-manager/wireguard-manager.sh -t","exec":"exec ~/.config/waybar/wireguard-manager/wireguard-manager.sh -s","format":"{icon}"}

This is because the version of the module presented first updates itself only when clicked on, to avoid constant polling of the status of the systemd service for Wireguard. If you do use other means to set your tunnel up or down (such assudo systemctl stop wg-quick@wg0.service), it is recommended to use this other version of the module, as it polls the current status of the systemd service every 3 seconds, updating the status of the module without requiring the user to click on it.

Usage

With the given configuration, the status of the connection will be updated every3 seconds. You can switch on/off the connection to your peer by clicking on theicon in Waybar.

Customization

This module is simple enough for anyone to customize it. You can change the waythe rofi prompt looks by editingrofi.rasi, or you can use any other way toprompt the password. You can also change the way things look in Waybar byediting the sample configuration.

Contributions

Contributions are most welcome, feel free to submit any idea or improvement youcan think of.

See also

If you are a NetworkManager user, maybe you should rather usewireguard-rofi-waybar, which seems to offerway more functionalities!

About

A Waybar extension to manage a Wireguard connection using Systemd and Rofi.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp