From 1c982ba63e5f1d8173a77fc1dfae512a0e16643b Mon Sep 17 00:00:00 2001 From: Sankalp Tharu <98226895+S4NKALP@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:26:23 +0545 Subject: [PATCH] Delete Wifi directory --- Wifi/colors | 186 ----------------------------------------------- Wifi/dmenu.rasi | 79 -------------------- Wifi/passwd.rasi | 81 --------------------- Wifi/prompt.rasi | 72 ------------------ Wifi/style.rasi | 13 ---- Wifi/wifi | 129 -------------------------------- 6 files changed, 560 deletions(-) delete mode 100644 Wifi/colors delete mode 100644 Wifi/dmenu.rasi delete mode 100644 Wifi/passwd.rasi delete mode 100644 Wifi/prompt.rasi delete mode 100644 Wifi/style.rasi delete mode 100644 Wifi/wifi diff --git a/Wifi/colors b/Wifi/colors deleted file mode 100644 index 70a1d68..0000000 --- a/Wifi/colors +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh - -uifont="FiraCode Nerd Font 13" - -help() { - cat <<- EOF -Run these script to change theme for rofi. -These script works along with my rofi configs. -run, - colors [options] - to change colors. -options: - nordblue - nordpink - nordblue - nordgreen - nordpurple - catppuccinred - catppuccinblue - catppuccingreen - catppuccinmavue - onedarkblue - onedarkpink - onedarkgreen - onedarkyellow - onedarkpurple - tokyoblue - tokyogreen - tokyopurple -EOF -} - -nordblue() { -bg="#2E3440" -fg="#88C0D0" -bgAlt="#3B4252" -button="#3B4252" -} - -nordgreen() { -bg="#2E3440" -fg="#A3BE8C" -bgAlt="#3B4252" -button="#3B4252" -} - -nordorange() { -bg="#2E3440" -fg="#D08770" -bgAlt="#3B4252" -button="#3B4252" -} - -nordpink() { -bg="#2E3440" -fg="#BF616A" -bgAlt="#3B4252" -button="#3B4252" -} - -nordpurple() { -bg="#2E3440" -fg="#B48EAD" -bgAlt="#3B4252" -button="#3B4252" -} - -catppuccinblue() { -bg="#161320" -fg="#96CDFB" -bgAlt="#1E1E2E" -button="#1E1E2E" -} - -catppuccingreen() { -bg="#161320" -fg="#ABE9B3" -bgAlt="#1E1E2E" -button="#1E1E2E" -} - -catppuccinmavue() { -bg="#161320" -fg="#DDB6F2" -bgAlt="#1E1E2E" -button="#1E1E2E" -} - -catppuccinred() { -bg="#161320" -fg="#F28FAD" -bgAlt="#1E1E2E" -button="#1E1E2E" -} - -onedarkblue() { -bg="#1E222A" -bgAlt="#252931" -fg="#61AFEF" -button="#252931" -} - -onedarkgreen() { -bg="#1E222A" -bgAlt="#252931" -fg="#7EC7A2" -button="#252931" -} - -onedarkpink() { -bg="#1E222A" -bgAlt="#252931" -fg="#D46489" -button="#252931" -} - -onedarkpurple() { -bg="#1E222A" -bgAlt="#252931" -fg="#C678DD" -button="#252931" -} - -onedarkyellow() { -bg="#1E222A" -bgAlt="#252931" -fg="#EBCB8B" -button="#252931" -} - -tokyoblue() { -bg="#1A1B26" -fg="#7DCFFF" -bgAlt="#24283B" -button="#414868" -} - -tokyogreen() { -bg="#1A1B26" -fg="#1ABC9C" -bgAlt="#24283B" -button="#414868" -} - -tokyopurple() { -bg="#1A1B26" -fg="#BB9AF7" -bgAlt="#24283B" -button="#414868" -} - - -case "$1" in - "") -echo " -* { -bg: #1E222A; -bgAlt: #252931; -fg: #61AFEF; -button: @bgAlt; -background-color: @bg; -text-color: @fg; -} -configuration { - font: \""$uifont"\"; -} -" > style.rasi -help - ;; - *) -$1 -echo " -* { -bg: $bg; -bgAlt: $bgAlt; -fg: $fg; -button: $button; -background-color: @bg; -text-color: @fg; -} -configuration { - font: \""$uifont"\"; -} -" > style.rasi - ;; -esac diff --git a/Wifi/dmenu.rasi b/Wifi/dmenu.rasi deleted file mode 100644 index 328c86d..0000000 --- a/Wifi/dmenu.rasi +++ /dev/null @@ -1,79 +0,0 @@ - -configuration { - sort: true; - sorting-method: "normal"; - disable-history: false; - scroll-method: 0; - window-thumbnail: true; -} - -@theme "/dev/null" - -* { - bg: #0C0F09; - fg: #05E289; - bgAlt: #1B1E25; - button: #05E289; - background-color: @bg; - text-color: @fg; -} -@import "../Wifi/style.rasi" - -mainbox { children: [ inputbar, listview ]; } - -window { - transparency: "real"; - width: 600px; - border: 15px 15px 15px 15px; - border-radius: 12px; - border-color: @bg; - height: 500px; -} - -inputbar { - children: [ prompt, entry ]; - expand: false; - padding: 10px 10px 10px 10px; -} - -prompt { - enabled: true; - padding: 10px; - border-radius: 15px; -} - -entry { - background-color: @bgAlt; - placeholder: "Search"; - expand: true; - padding: 10px; - border-radius: 15px; -} - -listview { - columns: 2; - cycle: true; - dynamic: true; - layout: vertical; - scrollbar: false; -} - -element { - orientation: vertical; - margin: 4px 4px 4px 4px; - border-radius: 10px; - background-color: @bgAlt; -} - -element-text { - expand: true; - margin: 12px 15px 12px 15px; - background-color: inherit; - text-color: inherit; -} - -element selected { - background-color: @fg; - text-color: @bgAlt; - border-radius: 10px; -} diff --git a/Wifi/passwd.rasi b/Wifi/passwd.rasi deleted file mode 100644 index b2cae8f..0000000 --- a/Wifi/passwd.rasi +++ /dev/null @@ -1,81 +0,0 @@ -configuration { - font: "AlegreyaSans Bold 16"; - sort: true; - sorting-method: "normal"; - disable-history: false; - scroll-method: 0; - window-thumbnail: true; -} - -@theme "/dev/null" - -* { - bg: #0C0F09; - fg: #05E289; - bgAlt: #1B1E25; - button: #05E289; - background-color: @bg; - text-color: @fg; -} - -@import "../Wifi/style.rasi" - -mainbox { children: [ inputbar, listview ]; } - -window { - transparency: "real"; - width: 400px; - border: 15px 15px 15px 15px; - border-radius: 15px; - height: 200px; - border-color: @bg; -} - -inputbar { - children: [ prompt, entry ]; - expand: false; - padding: 10px 10px 10px 10px; -} - -prompt { - enabled: true; - background-color: @bg; - padding: 10px; - border-radius: 15px; -} - -entry { - background-color: @bgAlt; - placeholder: "Password"; - expand: true; - padding: 10px; - border-radius: 15px; -} - -listview { - columns: 2; - cycle: true; - dynamic: true; - layout: vertical; - scrollbar: false; -} - -element { - orientation: vertical; - margin: 5px 10px 5px 10px; - border-radius: 10px; - background-color: @bgAlt; -} - -element-text { - expand: true; - margin: 10px 15px 10px 15px; - background-color: inherit; - text-color: inherit; -} - -element selected { - background-color: @fg; - text-color: @bgAlt; - border-radius: 10px; -} diff --git a/Wifi/prompt.rasi b/Wifi/prompt.rasi deleted file mode 100644 index 5dfee72..0000000 --- a/Wifi/prompt.rasi +++ /dev/null @@ -1,72 +0,0 @@ -configuration { - sort: true; - sorting-method: "normal"; - disable-history: false; - scroll-method: 0; - window-thumbnail: true; -} - -@theme "/dev/null" - -* { - bg: #0C0F09; - fg: #05E289; - bgAlt: #1B1E25; - button: #05E289; - background-color: @bg; - text-color: @fg; -} - -@import "../Wifi/style.rasi" - -mainbox { children: [ inputbar, listview ]; } - -window { - transparency: "real"; - width: 600px; - border: 15px 15px 15px 15px; - border-radius: 15px; - height: 500px; - border-color: @bg; -} - -inputbar { - children: [ prompt ]; - expand: false; - padding: 10px 10px 10px 10px; -} - -prompt { - enabled: true; - background-color: @bg; - padding: 10px; - border-radius: 15px; -} - -listview { - columns: 2; - cycle: true; - dynamic: true; - layout: vertical; - scrollbar: false; -} - -element { - orientation: vertical; - margin: 3px 5px 3px 5px; - border-radius: 10px; - background-color: @bgAlt; -} - -element-text { - expand: true; - margin: 10px 15px 10px 15px; - background-color: inherit; - text-color: inherit; -} - -element selected { - background-color: @fg; - text-color: @bgAlt; - border-radius: 10px; -} diff --git a/Wifi/style.rasi b/Wifi/style.rasi deleted file mode 100644 index ec6cbc3..0000000 --- a/Wifi/style.rasi +++ /dev/null @@ -1,13 +0,0 @@ - -* { -bg: #1E222A; -bgAlt: #252931; -fg: #61AFEF; -button: #252931; -background-color: @bg; -text-color: @fg; -} - -configuration { - font: "FiraCode Nerd Font 13"; -} diff --git a/Wifi/wifi b/Wifi/wifi deleted file mode 100644 index 4594ceb..0000000 --- a/Wifi/wifi +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh - -# ┬ ┬┬┌─┐┬ -# ││││├┤ │ -# └┴┘┴└ ┴ - -# Author Niraj -# Github niraj998 - -# ┬─┐┌─┐┌─┐┬ ┌─┐┌─┐┌┐┌┌─┐┬┌─┐┌─┐ -# ├┬┘│ │├┤ │ │ │ ││││├┤ ││ ┬└─┐ -# ┴└─└─┘└ ┴ └─┘└─┘┘└┘└ ┴└─┘└─┘ - -# rofi config without entry so to make select from available options only -rofiprompt=~/.config/rofi/Wifi/prompt.rasi -# normal rofi menu -rofidmenu=~/.config/rofi/Wifi/dmenu.rasi -# rofi config for password -rofipass=~/.config/rofi/Wifi/passwd.rasi - -# ┌─┐┌┬┐┌─┐┌┬┐┬ ┬┌─┐ -# └─┐ │ ├─┤ │ │ │└─┐ -# └─┘ ┴ ┴ ┴ ┴ └─┘└─┘ - -# Power Status -flag=$(cat /sys/class/net/wl*/flags) - -if [ "$flag" = "0x1003" ]; then - power="On" -else - power="Off" -fi - -# Connection Status -state=$(cat /sys/class/net/wl*/operstate) - -if [ "$state" = "up" ]; then - status=$(nmcli | grep "^wlp" | sed 's/\ connected\ to/Connected to/' | cut -d ':' -f2) -else - status="Disconnected" -fi - -# ┌─┐┌─┐┬ ┬┌─┐┬─┐ -# ├─┘│ ││││├┤ ├┬┘ -# ┴ └─┘└┴┘└─┘┴└─ - -powertoggle=$( [ "$flag" = "0x1003" ] && echo "Power Off" || echo "Power On" ) - -powerswitch() { -if [ "$powertoggle" = "Power Off" ]; then - nmcli radio wifi off -elif [ "$powertoggle" = "Power On" ]; then - nmcli radio wifi on -fi -} - -# ┌─┐┌─┐┌┐┌┌┐┌┌─┐┌─┐┌┬┐ -# │ │ │││││││├┤ │ │ -# └─┘└─┘┘└┘┘└┘└─┘└─┘ ┴ - -connections() { -list=$(nmcli --fields "SECURITY,SSID" device wifi list | tail -n +2 | sed "s/ */ /g" | sed -E "s/WPA*.?//g" | sed "s/^--//g" | sed "s/ //g") -networks=$(printf "$list" | rofi -config $rofiprompt -dmenu -i -hover-select -p "Select Wifi Network -$status") -wifi=$( echo "$networks" | sed "s/ //g" | sed "s/ //g" | xargs) -[ -z "$networks" ] && exit -nopass="No Password" -pass=$(printf "$nopass\nCancel" | rofi -config $rofipass -dmenu -i -hover-select -password -p "Wifi Password") - -if [ "$pass" = "" ]; then - exit -elif [ "$pass" = "$nopass" ]; then - nmcli dev wifi con "$wifi" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit -elif [ "$pass" = "Cancel" ]; then - exit -else - nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit -fi - -printf "exit" | rofi -config $rofiprompt -dmenu -i -p -only-match "Failed to Connect $wifi" && exit -} - - -# ┌┬┐┌─┐┌┐┌┬ ┬┌─┐┬ -# │││├─┤││││ │├─┤│ -# ┴ ┴┴ ┴┘└┘└─┘┴ ┴┴─┘ - -manual() { - -wifi=$(rofi -config $rofidmenu -dmenu -i -p "Enter Wifi Name") - -[ -z "$wifi" ] && exit -nopass="Run Without Password" -pass=$(printf "$nopass\nCancel" | rofi -config $rofipass -dmenu -i -password -p "Wifi Password") - -if [ "$pass" = "" ]; then - exit -elif [ "$pass" = "$nopass" ]; then - nmcli dev wifi con "$wifi" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit -elif [ "$pass" = "Cancel" ]; then - exit -else - nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit -fi - -printf "exit" | rofi -config $rofiprompt -dmenu -only-match -i -p "Failed to Connect $wifi" && exit -} - -# ┌─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐ -# │ │├─┘ │ ││ ││││└─┐ -# └─┘┴ ┴ ┴└─┘┘└┘└─┘ - -options="$powertoggle\nConnections\nConnect Manually" - -rofiwifi=$(printf "$options" | rofi -config $rofiprompt -dmenu -i -hover-select -p "Wifi -Powered: $power -Status: $status") - -case $rofiwifi in - $powertoggle) - powerswitch - ;; - Connections) - notify-send "Scanning" - connections - ;; - "Connect Manually") - manual -esac 2>/dev/null