Skip to content
Snippets Groups Projects
Commit 5ce66d88 authored by David Bernet's avatar David Bernet
Browse files

Newnewnew idk

parent 11a66897
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
connect_known_wifi() {
KNOWN_WIFIS=$(nmcli connection show --active | awk 'NR>1 {print $1}')
if [[ -z "$KNOWN_WIFIS" ]]; then
notify-send "No known WiFi networks found"
return
fi
SELECTED=$(echo -e "$KNOWN_WIFIS" | rofi -dmenu -p "Known WiFi:")
if [[ -n "$SELECTED" ]]; then
nmcli connection up "$SELECTED" && notify-send "Connected to $SELECTED" || notify-send "Failed to connect to $SELECTED"
fi
}
# Function to scan for WiFi networks and connect
scan_wifi() {
SCANNED_WIFIS=$(nmcli -f SSID,BARS device wifi list | awk 'NR>1')
if [[ -z "$SCANNED_WIFIS" ]]; then
notify-send "No WiFi networks found"
return
fi
SELECTED=$(echo -e "$SCANNED_WIFIS" | rofi -dmenu -p "Available WiFi:")
if [[ -n "$SELECTED" ]]; then
PASSWORD=$(rofi -dmenu -p "Password for $SELECTED (leave blank if none):")
nmcli device wifi connect "$SELECTED" password "$PASSWORD" && notify-send "Connected to $SELECTED" || notify-send "Failed to connect to $SELECTED"
fi
}
WIFI_STATE=$(nmcli radio wifi)
if [[ "$WIFI_STATE" == "enabled" ]]; then
OPTIONS="Disable WiFi\n"
CURRENT_NETWORK=$(nmcli connection show --active | grep 'wlan0' | awk 'NR {print $1}')
if [[ "$CURRENT_NETWORK" != "" ]]; then
OPTIONS="${OPTIONS}Disconnect $CURRENT_NETWORK\n"
fi
else
OPTIONS="Enable WiFi\n"
fi
OPTIONS="${OPTIONS}Connect to known WiFi\nScan for WiFi\nEdit connections"
CHOICE=$(echo -e $OPTIONS | rofi -dmenu -p "Wifi manager")
case "$CHOICE" in
"Enable WiFi")
nmcli radio wifi on && notify-send "WiFi enabled"
;;
"Disable WiFi")
nmcli radio wifi off && notify-send "WiFi disabled"
;;
"Connect to known WiFi")
connect_known_wifi
;;
"Scan for WiFi")
scan_wifi
;;
"Edit connections")
nm-connection-editor &
;;
"Disconnect $CURRENT_NETWORK")
nmcli connection down id $CURRENT_NETWORK &
;;
*)
notify-send "Invalid choice or canceled"
;;
esac
// -*- mode: jsonc -*-
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 0, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": [
"hyprland/workspaces",
// "wlr/taskbar",
"hyprland/window"
],
"modules-center": [
"clock"
],
"modules-right": [
"pulseaudio",
"network",
"power-profiles-daemon",
"backlight",
"battery",
"battery#bat2",
"tray",
"custom/power"
],
"hyprland/workspaces": {
"on-click": "activate",
"format": "{windows}",
"format-icons": {
"active": "",
"default": "",
"empty": ""
},
"window-rewrite-default": "",
"window-rewrite": {
"title<.*Mullvad.*>": "", // Windows whose titles contain "youtube"
"class<firefox>": "", // Windows whose classes are "firefox"
"class<kitty>": "", // Windows that contain "foot" in either class or title. For optimization reasons, it will only match against a title if at least one other window explicitly matches against a title.
"class<steam>": "",
"code": "󰨞",
"class<nemo>": "",
"class<vlc>": "",
"class<discord>": "",
"title<.*Minecraft.*>": ""
},
"format-window-separator": " "
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"interval": 1,
"format": "{:%H:%M:%S}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"backlight": {
"device": "intel_backlight",
"format": " {percent}%",
"on-scroll-up": "light -A 5",
"on-scroll-down": "light -U 5",
"on-click": "light -S 50"
},
"battery": {
"interval": 20,
"states": {
"good": 85,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}% {time}",
"tooltip-format": "Zeit Verbleibend: {time}",
"tooltip": true,
"format-time": "{H}:{m}",
"format-discharging-warning": " {icon} {capacity}% {time}",
"format-charging": " {icon} {capacity}% {time}",
"format-plugged": " {icon} {capacity}%",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""],
"full-at": 96,
"design-capacity": true,
},
"battery#bat2": {
"bat": "BAT2"
},
"power-profiles-daemon": {
"format": "{icon}",
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
"tooltip": true,
"format-icons": {
"default": "",
"performance": "",
"balanced": "",
"power-saver": ""
}
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": " {ipaddr}/{cidr}",
"tooltip-format": "{gwaddr}",
"format-linked": "{ifname} (No IP)",
"format-disconnected": " Disconnected",
"format-alt": " {ipaddr}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}% {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": " {volume}%",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"on-click-right": "pavucontrol"
}
}
#!/bin/bash
killall waybar
waybar &
#!/bin/bash
if hen
exit 1
else
echo "String not found."
fi
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 14px; }
window#waybar {
background-color: black;
color: white; }
#clock {
color: black;
background-color: white; }
/* you can set a style on hover for any module like this */
#pulseaudio {
background-color: white;
color: black; }
#pulseaudio:hover {
background-color: lightgray; }
#pulseaudio.muted {
background-color: #90b1b1;
color: #2a5c45; }
#network {
background-color: white;
color: black; }
/* Using steps() instead of linear as a timing function to limit cpu usage */
#battery {
background-color: white;
color: black; }
#battery.warning:not(.charging) {
background-color: red;
color: #ffffff; }
#backlight {
color: black;
background-color: white; }
#tray {
background-color: white;
color: black; }
#workspaces button {
opacity: 1;
margin: 0 2px;
color: black;
background-color: lightgray;
border-radius: 0px; }
#workspaces button:hover {
color: black; }
#workspaces button.empty {
background-color: gray; }
#workspaces button.active {
background-color: white; }
#workspaces button.urgent {
background-color: #eb4d4b; }
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#power-profiles-daemon,
#mpd {
padding: 0 10px;
margin: 0 2px; }
#window,
#workspaces {
margin: 0 4px; }
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0; }
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0; }
#power-profiles-daemon {
padding-right: 15px; }
#power-profiles-daemon.performance {
background-color: #f53c3c;
color: #ffffff; }
#power-profiles-daemon.balanced {
background-color: #2980b9;
color: #ffffff; }
#power-profiles-daemon.power-saver {
background-color: #2ecc71;
color: #000000; }
label:focus {
background-color: #000000; }
$background: white;
$foreground: black;
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 14px;
}
window#waybar {
background-color: $foreground;
color: $background;
}
#clock {
color: $foreground;
background-color: $background;
}
/* you can set a style on hover for any module like this */
#pulseaudio {
background-color: $background;
color: $foreground;
&:hover {
background-color: lightgray;
}
&.muted {
background-color: #90b1b1;
color: #2a5c45;
}
}
#network {
background-color: $background;
color: $foreground
}
/* Using steps() instead of linear as a timing function to limit cpu usage */
#battery {
background-color: $background;
color: $foreground;
&.warning:not(.charging) {
background-color: red;
color: #ffffff;
}
}
#backlight {
color: $foreground;
background-color: $background;
}
#tray {
background-color: $background;
color: $foreground;
}
#workspaces {
button {
margin: 0 2px;
color: $foreground;
background-color: lightgray;
border-radius: 0px;
cursor: pointer;
&:hover {
color: $foreground;
}
&.empty {
background-color: gray;
}
&.active {
background-color: $background;
}
&.urgent {
background-color: #eb4d4b;
}
}
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#power-profiles-daemon,
#mpd {
padding: 0 10px;
margin: 0 2px;
}
#window,
#workspaces {
margin: 0 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
#power-profiles-daemon {
padding-right: 15px;
}
#power-profiles-daemon.performance {
background-color: #f53c3c;
color: #ffffff;
}
#power-profiles-daemon.balanced {
background-color: #2980b9;
color: #ffffff;
}
#power-profiles-daemon.power-saver {
background-color: #2ecc71;
color: #000000;
}
label:focus {
background-color: #000000;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment