rofi instead of wofi
This commit is contained in:
parent
d41699b79e
commit
6e52442f74
2 changed files with 6 additions and 8 deletions
|
@ -11,5 +11,5 @@ keybinds=$(grep -oP '(?<=bind=).*' $config_file)
|
||||||
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
|
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
|
||||||
|
|
||||||
# Pipe the keybinds into wofi for selection
|
# Pipe the keybinds into wofi for selection
|
||||||
echo "$keybinds" | GTK_THEME="${GTK_THEME_NAME}" wofi --dmenu --prompt "Keybinds" --lines 10 --width 500 --location "center"
|
echo "$keybinds" | GTK_THEME="${GTK_THEME_NAME}" rofi -dmenu -prompt "Keybinds"
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,6 @@ notify-send -a "🔍 Wireless" "Scanning for networks" -t 3000
|
||||||
# Define the GTK theme as a variable for easy changes
|
# Define the GTK theme as a variable for easy changes
|
||||||
GTK_THEME_NAME="Nightfox-Dark"
|
GTK_THEME_NAME="Nightfox-Dark"
|
||||||
|
|
||||||
# Set the X offset to 1500 (for top-right positioning)
|
|
||||||
OFFSET_X=1500
|
|
||||||
OFFSET_Y=20 # Small top margin
|
|
||||||
|
|
||||||
# Function to convert signal strength to bars
|
# Function to convert signal strength to bars
|
||||||
convert_signal_to_bars() {
|
convert_signal_to_bars() {
|
||||||
|
@ -58,7 +55,8 @@ get_connected_network() {
|
||||||
|
|
||||||
# Function to show network information (IP, gateway, etc.)
|
# Function to show network information (IP, gateway, etc.)
|
||||||
get_network_info() {
|
get_network_info() {
|
||||||
ip_address=$(nmcli -g IP4.ADDRESS dev show | grep -v '^$')
|
wifi_interface=$(nmcli -t -f DEVICE,TYPE device | grep ':wifi' | grep -v '^p2p' | cut -d: -f1)
|
||||||
|
ip_address=$(nmcli -g IP4.ADDRESS dev show "$wifi_interface" | grep -v '^$')
|
||||||
gateway=$(nmcli -g IP4.GATEWAY dev show | grep -v '^$')
|
gateway=$(nmcli -g IP4.GATEWAY dev show | grep -v '^$')
|
||||||
dns=$(nmcli -g IP4.DNS dev show | grep -v '^$')
|
dns=$(nmcli -g IP4.DNS dev show | grep -v '^$')
|
||||||
|
|
||||||
|
@ -93,7 +91,7 @@ connect_to_network() {
|
||||||
menu_list="Refresh\nGo back\n$network_list"
|
menu_list="Refresh\nGo back\n$network_list"
|
||||||
|
|
||||||
# Use the GTK_THEME variable for wofi and set position with 1500px X offset
|
# Use the GTK_THEME variable for wofi and set position with 1500px X offset
|
||||||
chosen_network=$(echo -e "$menu_list" | GTK_THEME="$GTK_THEME_NAME" wofi --dmenu --prompt "Select Wi-Fi network:" -x "$OFFSET_X")
|
chosen_network=$(echo -e "$menu_list" | GTK_THEME="$GTK_THEME_NAME" rofi -dmenu -p "Select Wi-Fi network:")
|
||||||
|
|
||||||
# Handle special options
|
# Handle special options
|
||||||
case "$chosen_network" in
|
case "$chosen_network" in
|
||||||
|
@ -135,7 +133,7 @@ connect_to_network() {
|
||||||
|
|
||||||
# If secured, prompt for a password
|
# If secured, prompt for a password
|
||||||
if [[ "$security_check" != "--" ]]; then
|
if [[ "$security_check" != "--" ]]; then
|
||||||
password=$(GTK_THEME="$GTK_THEME_NAME" wofi --dmenu --password --prompt "Enter Password" --lines 1 --width 300 -x "$OFFSET_X")
|
password=$(echo "" | GTK_THEME="$GTK_THEME_NAME" rofi -dmenu -theme themes/rofi-wifi.rasi -lines 0 -password)
|
||||||
if [ -n "$password" ]; then
|
if [ -n "$password" ]; then
|
||||||
nmcli dev wifi connect "$chosen_network" password "$password"
|
nmcli dev wifi connect "$chosen_network" password "$password"
|
||||||
else
|
else
|
||||||
|
@ -160,7 +158,7 @@ main_menu() {
|
||||||
menu="Wireless Connections\nConnected to: $connected_network\n$network_info\nForget Network"
|
menu="Wireless Connections\nConnected to: $connected_network\n$network_info\nForget Network"
|
||||||
|
|
||||||
# Use the GTK_THEME variable for wofi and set position with 1500px X offset
|
# Use the GTK_THEME variable for wofi and set position with 1500px X offset
|
||||||
chosen=$(echo -e "$menu" | GTK_THEME="$GTK_THEME_NAME" wofi --dmenu --prompt "Main Menu:" -x "$OFFSET_X")
|
chosen=$(echo -e "$menu" | GTK_THEME="$GTK_THEME_NAME" rofi -dmenu -p "Main Menu:" )
|
||||||
|
|
||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
"Wireless Connections")
|
"Wireless Connections")
|
Loading…
Reference in a new issue