updated eww files and bash scripts
This commit is contained in:
		
							parent
							
								
									5a419c03f3
								
							
						
					
					
						commit
						cd7e93374e
					
				
					 11 changed files with 119 additions and 60 deletions
				
			
		|  | @ -1,4 +1,4 @@ | |||
| #!/bin/bash | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| # Get the list of connected Bluetooth devices | ||||
| devices=$(bluetoothctl devices Connected | awk '{print $2}') | ||||
|  | @ -9,15 +9,15 @@ i=0 | |||
| for device in $devices; do | ||||
| 
 | ||||
|     # Get the device info using bluetoothctl | ||||
|     info=$(bluetoothctl info $device) | ||||
|     info=$(bluetoothctl info "$device") | ||||
| 
 | ||||
|     # Extract the name and battery percentage from the device info | ||||
|     name[$i]=$(echo "$info" | awk '/Name:/ {for(i=2; i<=NF; i++) printf "%s ", $i;}') | ||||
|     battery[$i]=$(echo "$info" | awk '/Battery Percentage:/ {print $4}' | tr -d '()') | ||||
|     name[i]=$(echo "$info" | awk '/Name:/ {for(i=2; i<=NF; i++) printf "%s ", $i;}') | ||||
|     battery[i]=$(echo "$info" | awk '/Battery Percentage:/ {print $4}' | tr -d '()') | ||||
| 
 | ||||
|      | ||||
| 
 | ||||
|     ((i=i+1)) | ||||
| done | ||||
| 
 | ||||
| echo '{"name":"'${name[0]}'","battery":"'${battery[0]}'"}' | ||||
| echo '{"name":"'"${name[0]}"'","battery":"'"${battery[0]}"'"}' | ||||
|  | @ -1,4 +1,4 @@ | |||
| #!/bin/bash | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| FILE_TO_WATCH="/sys/class/backlight/intel_backlight/brightness"   # Replace with the actual file path | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #!/bin/bash | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| status=$(playerctl status) | ||||
| name=$(playerctl metadata title) | ||||
| 
 | ||||
| echo '{"status":"'$status'","name":"'$name'"}' | ||||
| echo '{"status":"'"$status"'","name":"'"$name"'"}' | ||||
|  | @ -1,6 +1,7 @@ | |||
| #!/bin/bash | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
|      | ||||
| 
 | ||||
|     | ||||
| unset id name horizontal vertical scale activeWorkspace | ||||
| 
 | ||||
| i=0 | ||||
|  | @ -34,6 +35,6 @@ for ((i = 0; i < ${#id[@]}; i++)); do | |||
| 
 | ||||
|     monitorID=$(xrandr --listactivemonitors | grep +"${name[$i]}" | awk '{sub(/.$/,"",$1); print $1}') | ||||
| 
 | ||||
|     eww open bar --id bar"${monitorID}" --arg monitor="${monitorID}" --arg width="${new_width}" --arg height=25 | ||||
|     eww open bar --id bar"${monitorID}" --arg monitor="${monitorID}" --arg width="${new_width}" --arg height=30 | ||||
|     sleep 2 | ||||
| done | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| #!/bin/bash | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| ethernet() { | ||||
| 	name="Wired" | ||||
|  | @ -28,16 +28,16 @@ while true; do | |||
| 
 | ||||
| 	networkInfo=$(nmcli -f NAME,TYPE connection show --active | awk '!/loopback/ && NR > 1') | ||||
| 
 | ||||
| 	if [[ $(awk '/wifi/' <<< $networkInfo) ]]; then | ||||
| 	if [[ $(awk '/wifi/' <<< "$networkInfo") ]]; then | ||||
| 		wifi | ||||
| 	fi | ||||
| 
 | ||||
| 	if [[ $(awk '/ethernet/' <<< $networkInfo) ]]; then | ||||
| 	if [[ $(awk '/ethernet/' <<< "$networkInfo") ]]; then | ||||
| 		ethernet | ||||
| 	fi | ||||
| 
 | ||||
| 
 | ||||
| 	echo '{"name":"'$name'","image":"'$image'"}' | ||||
| 	echo '{"name":"'"$name"'","image":"'"$image"'"}' | ||||
| 
 | ||||
| 	sleep 2 | ||||
| done | ||||
|  |  | |||
|  | @ -1,25 +1,25 @@ | |||
| #!/bin/bash | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| getIcon() { | ||||
|     local desktop="" | ||||
|      | ||||
|     # Search for desktop files by WM class | ||||
|     if [ -n "$1" ]; then | ||||
|         desktop=$(grep -l "StartupWMClass.*$1$" /usr/share/applications/*.desktop) | ||||
|         [ -z "$desktop" ] && desktop=$(grep -Pl "Name\s*=\s*$1$" /usr/share/applications/*.desktop) | ||||
|         [ -z "$desktop" ] && desktop=$(ls /usr/share/applications/${1}.desktop 2>/dev/null) | ||||
|         desktop=$(grep -l "StartupWMClass.*$1$" /run/current-system/sw/share/applications/*.desktop) | ||||
|         [ -z "$desktop" ] && desktop=$(grep -Pl "Name\s*=\s*$1$" /run/current-system/sw/share/applications/*.desktop) | ||||
|         [ -z "$desktop" ] && desktop=$(ls /run/current-system/sw/share/applications/"${1}".desktop 2>/dev/null) | ||||
|     fi | ||||
|      | ||||
|     # If not found by WM class, search by process name | ||||
|     if [ -z "$desktop" ] && [ -n "$2" ]; then | ||||
|         process=$(ps -p ${2} -o comm=) | ||||
|         desktop=$(grep -Pl "$process" /usr/share/applications/*.desktop) | ||||
|         [ -n "$desktop" ] && desktop="$desktop" | ||||
|         process=$(ps -p "${2}" -o comm=) | ||||
|         desktop=$(grep -Pl "$process" /run/current-system/sw/share/applications/*.desktop) | ||||
|         [ -n "$desktop" ] | ||||
|     fi | ||||
|      | ||||
|     # If not found by WM class or process name, search by name or description | ||||
|     if [ -z "$desktop" ] && [ -n "$1" ]; then | ||||
|         desktop=$(grep -Pl "$1" /usr/share/applications/*.desktop) | ||||
|         desktop=$(grep -Pl "$1" /run/current-system/sw/share/applications/*.desktop) | ||||
|     fi | ||||
|      | ||||
|     echo "$desktop" | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| #!/bin/bash | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| generate() { | ||||
|     message=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) | ||||
|  | @ -10,7 +10,7 @@ generate() { | |||
|         muted=0 | ||||
|     fi | ||||
| 
 | ||||
|     echo '{"volume":"'$volume'","muted":"'$muted'"}' | ||||
|     echo '{"volume":"'"$volume"'","muted":"'"$muted"'"}' | ||||
| } | ||||
| 
 | ||||
| generate | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue