diff --git a/home/features/desktop/hyprland/eww/scripts/airplane_mode.sh b/home/features/desktop/hyprland/eww/backup/scripts/airplane_mode.sh similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/airplane_mode.sh rename to home/features/desktop/hyprland/eww/backup/scripts/airplane_mode.sh diff --git a/home/features/desktop/hyprland/eww/scripts/battery b/home/features/desktop/hyprland/eww/backup/scripts/battery similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/battery rename to home/features/desktop/hyprland/eww/backup/scripts/battery diff --git a/home/features/desktop/hyprland/eww/scripts/battery.sh b/home/features/desktop/hyprland/eww/backup/scripts/battery.sh similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/battery.sh rename to home/features/desktop/hyprland/eww/backup/scripts/battery.sh diff --git a/home/features/desktop/hyprland/eww/scripts/brightness.sh b/home/features/desktop/hyprland/eww/backup/scripts/brightness.sh similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/brightness.sh rename to home/features/desktop/hyprland/eww/backup/scripts/brightness.sh diff --git a/home/features/desktop/hyprland/eww/scripts/mem-ad b/home/features/desktop/hyprland/eww/backup/scripts/mem-ad similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/mem-ad rename to home/features/desktop/hyprland/eww/backup/scripts/mem-ad diff --git a/home/features/desktop/hyprland/eww/scripts/memory b/home/features/desktop/hyprland/eww/backup/scripts/memory similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/memory rename to home/features/desktop/hyprland/eww/backup/scripts/memory diff --git a/home/features/desktop/hyprland/eww/scripts/music_info b/home/features/desktop/hyprland/eww/backup/scripts/music_info similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/music_info rename to home/features/desktop/hyprland/eww/backup/scripts/music_info diff --git a/home/features/desktop/hyprland/eww/scripts/pop b/home/features/desktop/hyprland/eww/backup/scripts/pop similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/pop rename to home/features/desktop/hyprland/eww/backup/scripts/pop diff --git a/home/features/desktop/hyprland/eww/scripts/screenshot b/home/features/desktop/hyprland/eww/backup/scripts/screenshot similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/screenshot rename to home/features/desktop/hyprland/eww/backup/scripts/screenshot diff --git a/home/features/desktop/hyprland/eww/scripts/search.sh b/home/features/desktop/hyprland/eww/backup/scripts/search.sh similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/search.sh rename to home/features/desktop/hyprland/eww/backup/scripts/search.sh diff --git a/home/features/desktop/hyprland/eww/scripts/volume.sh b/home/features/desktop/hyprland/eww/backup/scripts/volume.sh similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/volume.sh rename to home/features/desktop/hyprland/eww/backup/scripts/volume.sh diff --git a/home/features/desktop/hyprland/eww/scripts/wifi b/home/features/desktop/hyprland/eww/backup/scripts/wifi similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/wifi rename to home/features/desktop/hyprland/eww/backup/scripts/wifi diff --git a/home/features/desktop/hyprland/eww/scripts/wifi.sh b/home/features/desktop/hyprland/eww/backup/scripts/wifi.sh similarity index 100% rename from home/features/desktop/hyprland/eww/scripts/wifi.sh rename to home/features/desktop/hyprland/eww/backup/scripts/wifi.sh diff --git a/home/features/desktop/hyprland/eww/backup/scripts/workspace b/home/features/desktop/hyprland/eww/backup/scripts/workspace new file mode 100755 index 00000000..f202ef1c --- /dev/null +++ b/home/features/desktop/hyprland/eww/backup/scripts/workspace @@ -0,0 +1,56 @@ +#!/bin/sh +workspaces() { + +ws1="1" +ws2="2" +ws3="3" +ws4="4" +ws5="5" +ws6="6" + +# Unoccupied +un="0" + +# check if Occupied +o1=$(bspc query -D -d .occupied --names | grep "$ws1" ) +o2=$(bspc query -D -d .occupied --names | grep "$ws2" ) +o3=$(bspc query -D -d .occupied --names | grep "$ws3" ) +o4=$(bspc query -D -d .occupied --names | grep "$ws4" ) +o5=$(bspc query -D -d .occupied --names | grep "$ws5" ) +o6=$(bspc query -D -d .occupied --names | grep "$ws6" ) + +# check if Focused +f1=$(bspc query -D -d focused --names | grep "$ws1" ) +f2=$(bspc query -D -d focused --names | grep "$ws2" ) +f3=$(bspc query -D -d focused --names | grep "$ws3" ) +f4=$(bspc query -D -d focused --names | grep "$ws4" ) +f5=$(bspc query -D -d focused --names | grep "$ws5" ) +f6=$(bspc query -D -d focused --names | grep "$ws6" ) + +ic_1="" +ic_2="" +ic_3="" +ic_4="" +ic_5="" +ic_6="" +if [ $f1 ]; then + ic_1="" +elif [ $f2 ]; then + ic_2="" +elif [ $f3 ]; then + ic_3="" +elif [ $f4 ]; then + ic_4="" +elif [ $f5 ]; then + ic_5="" +elif [ $f6 ]; then + ic_6="" +fi + +echo "(box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"false\" (button :onclick \"bspc desktop -f $ws1\" :class \"$un$o1$f1\" \"$ic_1\") (button :onclick \"bspc desktop -f $ws2\" :class \"$un$o2$f2\" \"$ic_2\") (button :onclick \"bspc desktop -f $ws3\" :class \"$un$o3$f3\" \"$ic_3\") (button :onclick \"bspc desktop -f $ws4\" :class \"$un$o4$f4\" \"$ic_4\") (button :onclick \"bspc desktop -f $ws5\" :class \"$un$o5$f5\" \"$ic_5\") (button :onclick \"bspc desktop -f $ws6\" :class \"$un$o6$f6\" \"$ic_6\"))" + +} +workspaces +bspc subscribe desktop node_transfer | while read -r _ ; do +workspaces +done diff --git a/home/features/desktop/hyprland/eww/backup/scripts/workspaces.lua b/home/features/desktop/hyprland/eww/backup/scripts/workspaces.lua new file mode 100755 index 00000000..cb0ec28c --- /dev/null +++ b/home/features/desktop/hyprland/eww/backup/scripts/workspaces.lua @@ -0,0 +1,30 @@ +#!/usr/bin/env lua + +function trim(s) + return (string.gsub(s, "^%s*(.-)%s*$", "%1")) +end + +aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'") +active_workspace = aw:read("*a") +aw:close() + +ew = io.popen("hyprctl workspaces | grep ID | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'") +existing_workspaces = ew:read("*a") +ew:close() + +box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" " + +for i = 1, #existing_workspaces do + local c = existing_workspaces:sub(i,i) + if tonumber(c) == tonumber(active_workspace) then + local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..c.." \" \"\")" + box = box .. btn + elseif c ~= "\n" then + local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..c.."\" \"\")" + box = box .. btn + end +end + +box = box .. ")" + +print(box) diff --git a/home/features/desktop/hyprland/eww/backup/scripts/workspaces.sh b/home/features/desktop/hyprland/eww/backup/scripts/workspaces.sh new file mode 100755 index 00000000..9ff97393 --- /dev/null +++ b/home/features/desktop/hyprland/eww/backup/scripts/workspaces.sh @@ -0,0 +1,9 @@ +#!/bin/sh +workspaces() { +./scripts/workspaces.lua +} +workspaces +tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep --line-buffered "Changed to workspace" | while read -r; do +workspaces +done + diff --git a/home/features/desktop/hyprland/eww/default.nix b/home/features/desktop/hyprland/eww/default.nix index 62410ab2..c1918a69 100644 --- a/home/features/desktop/hyprland/eww/default.nix +++ b/home/features/desktop/hyprland/eww/default.nix @@ -1,59 +1,69 @@ # TODO: Configure XDG_CONFIG_HOME for config directory -{ inputs, lib, config, pkgs, ... }: -let - user = "${config.home.username}"; - homeDirectory = "${config.home.homeDirectory}/.config"; -in { - programs = { - eww = { - enable = true; - package = pkgs.eww; - enableZshIntegration = true; - enableBashIntegration = true; - enableFishIntegration = true; - # configDir = "${XDG_CONFIG_HOME}/eww"; - # configDir = "${homeDirectory}/eww"; - }; + inputs, + lib, + config, + pkgs, + ... +}: + + +{ + imports = [ + ./scripts + ./launch_bar.nix + ]; + + programs = { + eww = { + enable = true; + package = pkgs.eww; + enableZshIntegration = true; + enableBashIntegration = true; + enableFishIntegration = true; + configDir = "${config.home.homeDirectory}/eww"; }; + }; + + home.packages = with pkgs; [ + brightnessctl + ]; + + # configuration + home.file.".config/eww/eww.scss".source = ./eww.scss; + home.file.".config/eww/eww.yuck".source = ./eww.yuck; + home.file.".config/eww/eww_windows.yuck".source = ./eww_windows.yuck; + home.file.".config/eww/eww_widgets.yuck".source = ./eww_widgets.yuck; + home.file.".config/eww/eww_variables.yuck".source = ./eww_variables.yuck; + + # # scripts + # home.file.".config/eww/scripts" = { + # source = ./scripts; + # recursive = true; + # }; + + # home.file.".config/eww/scripts/battery.sh" = { + # source = ./scripts/battery.sh; + # executable = true; + # }; + + # home.file.".config/eww/scripts/wifi.sh" = { + # source = ./scripts/wifi.sh; + # executable = true; + # }; + + # home.file.".config/eww/scripts/brightness.sh" = { + # source = ./scripts/brightness.sh; + # executable = true; + # }; + + # home.file.".config/eww/scripts/workspaces.sh" = { + # source = ./scripts/workspaces.sh; + # executable = true; + # }; - # home.packages = with pkgs; [ - # brightnessctl - # (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) - # ]; - - # configuration - # home.file.".config/eww/eww.scss".source = ./eww.scss; - # home.file.".config/eww/eww.yuck".source = ./eww.yuck; - - # # scripts - # home.file.".config/eww/scripts" = { - # source = ./scripts; - # recursive = true; - # }; - - # home.file.".config/eww/scripts/battery.sh" = { - # source = ./scripts/battery.sh; - # executable = true; - # }; - - # home.file.".config/eww/scripts/wifi.sh" = { - # source = ./scripts/wifi.sh; - # executable = true; - # }; - - # home.file.".config/eww/scripts/brightness.sh" = { - # source = ./scripts/brightness.sh; - # executable = true; - # }; - - # home.file.".config/eww/scripts/workspaces.sh" = { - # source = ./scripts/workspaces.sh; - # executable = true; - # }; - - # home.file.".config/eww/scripts/workspaces.lua" = { - # source = ./scripts/workspaces.lua; - # executable = true; - # }; + # home.file.".config/eww/scripts/workspaces.lua" = { + # source = ./scripts/workspaces.lua; + # executable = true; + # }; } diff --git a/home/features/desktop/hyprland/eww/scripts/airplane_mode.nix b/home/features/desktop/hyprland/eww/scripts/airplane_mode.nix new file mode 100644 index 00000000..1a997b27 --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/airplane_mode.nix @@ -0,0 +1,22 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/airplane_mode.sh" = { + text = '' + #!/bin/sh + status=$(nmcli n) + if [[ "$status" == "enabled" ]]; then + nmcli n off + else + nmcli n on + fi + ''; + executable = true; + }; +} + diff --git a/home/features/desktop/hyprland/eww/scripts/battery1.nix b/home/features/desktop/hyprland/eww/scripts/battery1.nix new file mode 100755 index 00000000..0b07947e --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/battery1.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/battery1.sh" = { + text = '' + #!/usr/bin/env bash + battery() { + BAT=`ls /sys/class/power_supply | grep BAT | head -n 1` + cat /sys/class/power_supply/${BAT}/capacity + } + battery_stat() { + BAT=`ls /sys/class/power_supply | grep BAT | head -n 1` + cat /sys/class/power_supply/${BAT}/status + } + + if [[ "$1" == "--bat" ]]; then + battery + elif [[ "$1" == "--bat-st" ]]; then + battery_stat + fi + ''; + executable = true; + }; +} + diff --git a/home/features/desktop/hyprland/eww/scripts/battery2.nix b/home/features/desktop/hyprland/eww/scripts/battery2.nix new file mode 100755 index 00000000..b11d1cf1 --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/battery2.nix @@ -0,0 +1,52 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/battery2.sh" = { + text = '' + #!/bin/sh + + bat=/sys/class/power_supply/BAT1/ + per="$(cat "$bat/capacity")" + status="$(cat "$bat/status")" + + if [ "$per" -gt "90" ]; then + icon="" + elif [ "$per" -gt "80" ]; then + icon="" + elif [ "$per" -gt "70" ]; then + icon="" + elif [ "$per" -gt "60" ]; then + icon="" + elif [ "$per" -gt "50" ]; then + icon="" + elif [ "$per" -gt "40" ]; then + icon="" + elif [ "$per" -gt "30" ]; then + icon="" + elif [ "$per" -gt "20" ]; then + icon="" + elif [ "$per" -gt "10" ]; then + icon="" + elif [ "$per" -gt "0" ]; then + icon="" + else + icon="" + fi + + + + + if [ -s /sys/class/power_supply/BAT1/capacity ]; then + echo "{\"percent\": \"$per\", \"icon\": \"$icon\", \"charging\": \"$charging\", \"visible\": \"true\", \"status\": \"$status\"}" + else + echo "{\"visible\": \"false\" }" + fi + ''; + executable = true; + }; +} diff --git a/home/features/desktop/hyprland/eww/scripts/brightness.nix b/home/features/desktop/hyprland/eww/scripts/brightness.nix new file mode 100755 index 00000000..754a34bb --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/brightness.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/brightness.sh" = { + text = '' + #!/bin/sh + + if eww windows | grep -q "\*brightness"; then + eww update bright-level="$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%')" + else + eww close volume + eww open brightness + + eww update bright-level="$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%')" + sleep 2 + sleep 1 + eww close brightness + fi + ''; + executable = true; + }; +} + + + diff --git a/home/features/desktop/hyprland/eww/scripts/default.nix b/home/features/desktop/hyprland/eww/scripts/default.nix new file mode 100644 index 00000000..b0d2dcec --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/default.nix @@ -0,0 +1,24 @@ +{ + ... +}: + +{ + imports = [ + ./airplane_mode.nix + ./battery1.nix + ./battery2.nix + ./brightness.nix + ./mem-ad.nix + ./memory.nix + ./music_info.nix + ./pop.nix + ./screenshot.nix + ./search.nix + ./volume.nix + ./wifi1.nix + ./wifi2.nix + ./workspace_code.nix + ./workspace.nix + ./workspaces.nix + ]; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/mem-ad.nix b/home/features/desktop/hyprland/eww/scripts/mem-ad.nix new file mode 100644 index 00000000..5460255a --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/mem-ad.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/mem-ad.sh" = { + text = '' + #!/bin/sh + total="$(free -m | grep Mem: | awk '{ print $2 }')" + used="$(free -m | grep Mem: | awk '{ print $3 }')" + + free=$(expr $total - $used) + + if [ "$1" = "total" ]; then + echo $total + elif [ "$1" = "used" ]; then + echo $used + elif [ "$1" = "free" ]; then + echo $free + fi + ''; + executable = true; + }; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/memory.nix b/home/features/desktop/hyprland/eww/scripts/memory.nix new file mode 100644 index 00000000..d426cc6a --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/memory.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/memory.sh" = { + text = '' + #!/bin/sh + printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') + ''; + executable = true; + }; +} + diff --git a/home/features/desktop/hyprland/eww/scripts/music_info.nix b/home/features/desktop/hyprland/eww/scripts/music_info.nix new file mode 100644 index 00000000..e3717ec5 --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/music_info.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/music_info.sh" = { + text = '' + ''; + executable = true; + }; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/pop.nix b/home/features/desktop/hyprland/eww/scripts/pop.nix new file mode 100644 index 00000000..7d1a337e --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/pop.nix @@ -0,0 +1,106 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/pop.sh" = { + text = '' + #!/usr/bin/env bash + + calendar() { + LOCK_FILE="$HOME/.cache/eww-calendar.lock" + EWW_BIN="$HOME/.local/bin/eww/eww" + + run() { + ${EWW_BIN} -c $HOME/.config/eww open calendar + } + + # Open widgets + if [[ ! -f "$LOCK_FILE" ]]; then + ${EWW_BIN} -c $HOME/.config/eww close system music_win audio_ctl + touch "$LOCK_FILE" + run && echo "ok good!" + else + ${EWW_BIN} -c $HOME/.config/eww close calendar + rm "$LOCK_FILE" && echo "closed" + fi + } + + + system() { + LOCK_FILE_MEM="$HOME/.cache/eww-system.lock" + EWW_BIN="$HOME/.local/bin/eww/eww" + + run() { + ${EWW_BIN} -c $HOME/.config/eww open system + } + + # Open widgets + if [[ ! -f "$LOCK_FILE_MEM" ]]; then + ${EWW_BIN} -c $HOME/.config/eww close calendar music_win audio_ctl + touch "$LOCK_FILE_MEM" + run && echo "ok good!" + else + ${EWW_BIN} -c $HOME/.config/eww close system + rm "$LOCK_FILE_MEM" && echo "closed" + fi + } + + + music() { + LOCK_FILE_SONG="$HOME/.cache/eww-song.lock" + EWW_BIN="$HOME/.local/bin/eww/eww" + + run() { + ${EWW_BIN} -c $HOME/.config/eww open music_win + } + + # Open widgets + if [[ ! -f "$LOCK_FILE_SONG" ]]; then + ${EWW_BIN} -c $HOME/.config/eww close system calendar + touch "$LOCK_FILE_SONG" + run && echo "ok good!" + else + ${EWW_BIN} -c $HOME/.config/eww close music_win + rm "$LOCK_FILE_SONG" && echo "closed" + fi + } + + + + audio() { + LOCK_FILE_AUDIO="$HOME/.cache/eww-audio.lock" + EWW_BIN="$HOME/.local/bin/eww/eww" + + run() { + ${EWW_BIN} -c $HOME/.config/eww open audio_ctl + } + + # Open widgets + if [[ ! -f "$LOCK_FILE_AUDIO" ]]; then + ${EWW_BIN} -c $HOME/.config/eww close system calendar music + touch "$LOCK_FILE_AUDIO" + run && echo "ok good!" + else + ${EWW_BIN} -c $HOME/.config/eww close audio_ctl + rm "$LOCK_FILE_AUDIO" && echo "closed" + fi + } + + + if [ "$1" = "calendar" ]; then + calendar + elif [ "$1" = "system" ]; then + system + elif [ "$1" = "music" ]; then + music + elif [ "$1" = "audio" ]; then + audio + fi + ''; + executable = true; + }; +} diff --git a/home/features/desktop/hyprland/eww/scripts/screenshot.nix b/home/features/desktop/hyprland/eww/scripts/screenshot.nix new file mode 100644 index 00000000..d84b351b --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/screenshot.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/screenshot.sh" = { + text = '' + #!/usr/bin/env bash + + time=`date +%Y-%m-%d-%I-%M-%S` + geometry=`xrandr | head -n1 | cut -d',' -f2 | tr -d '[:blank:],current'` + dir="`xdg-user-dir PICTURES`/Screenshots" + file="Screenshot_${time}_${geometry}.png" + + # notify + notify_user () { + if [[ -e "$dir/$file" ]]; then + dunstify -u low --replace=699 -i /usr/share/archcraft/icons/dunst/picture.png "Saved in $dir" + else + dunstify -u low --replace=699 -i /usr/share/archcraft/icons/dunst/picture.png "Screenshot Deleted." + fi + } + + # take shots + shotnow () { + cd ${dir} && sleep 0.5 && maim -u -f png "$file" && viewnior ${dir}/"$file" + notify_user + } + + shotarea () { + cd ${dir} && maim -u -f png -s -b 2 -c 0.35,0.55,0.85,0.25 -l "$file" && viewnior ${dir}/"$file" + notify_user + } + + if [[ ! -d "$dir" ]]; then + mkdir -p "$dir" + fi + + chosen="$1" + case $chosen in + "SCREEN") + shotnow + ;; + "SELECT") + shotarea + ;; + esac + ''; + executable = true; + }; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/search.nix b/home/features/desktop/hyprland/eww/scripts/search.nix new file mode 100644 index 00000000..9a3a0cf9 --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/search.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/search.sh" = { + text = '' + #!/bin/sh + list=$(ls /usr/bin/ | grep -m 10 -i "$1") + buf="" + for l in $list ; do + buf="$buf (button :class \"item\" :onclick \"$l &\" \"$l\")" + done + echo "(box :orientation \"v\" :spacing 5 :class \"apps\" :halign \"center\" :valign \"center\" $buf)" > ~/.config/eww/scripts/search_items.txt + ''; + executable = true; + }; +} diff --git a/home/features/desktop/hyprland/eww/scripts/volume.nix b/home/features/desktop/hyprland/eww/scripts/volume.nix new file mode 100644 index 00000000..0ee817a1 --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/volume.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/volume.sh" = { + text = '' + #!/bin/sh + + if eww windows | rg -q "\*volume"; then + eww update volume-level=$(pamixer --get-volume) + eww update volume-muted=$(pamixer --get-mute) + eww update volume-hidden=false + else + eww close brightness + eww open volume + eww update volume-level=$(pamixer --get-volume) + eww update volume-muted=$(pamixer --get-mute) + eww update volume-hidden=false + sleep 2 + eww update volume-hidden=true + sleep 1 + eww close volume + fi + ''; + executable = true; + }; +} diff --git a/home/features/desktop/hyprland/eww/scripts/wifi1.nix b/home/features/desktop/hyprland/eww/scripts/wifi1.nix new file mode 100644 index 00000000..8732edde --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/wifi1.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/wifi1.sh" = { + text = '' + #!/usr/bin/env bash + + status=$(nmcli g | grep -oE "disconnected") + essid=$(nmcli c | grep wlp2s0 | awk '{print ($1)}') + + if [ $status ] ; then + icon="󰖩" + text="" + col="#575268" + + else + icon="󰖪" + text="${essid}" + col="#a1bdce" + fi + + if [[ "$1" == "--COL" ]]; then + echo $col + elif [[ "$1" == "--ESSID" ]]; then + echo $text + elif [[ "$1" == "--ICON" ]]; then + echo $icon + fi + ''; + executable = true; + }; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/wifi2.nix b/home/features/desktop/hyprland/eww/scripts/wifi2.nix new file mode 100644 index 00000000..333196e4 --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/wifi2.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/wifi2.sh" = { + text = '' + #!/bin/sh + + if iwctl station wlan0 show | grep -q "connected"; then + icon="" + ssid=Amadeus + status="Connected to ${ssid}" + else + icon="睊" + status="offline" + fi + + echo "{\"icon\": \"${icon}\", \"status\": \"${status}\"}" + + ''; + executable = true; + }; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/workspace.nix b/home/features/desktop/hyprland/eww/scripts/workspace.nix new file mode 100644 index 00000000..5a71101c --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/workspace.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/workspace.sh" = { + text = '' + ''; + executable = true; + }; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/workspace_code.nix b/home/features/desktop/hyprland/eww/scripts/workspace_code.nix new file mode 100644 index 00000000..5d349cfd --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/workspace_code.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/workspace_code.sh" = { + text = '' + ''; + executable = true; + }; +} \ No newline at end of file diff --git a/home/features/desktop/hyprland/eww/scripts/workspaces.nix b/home/features/desktop/hyprland/eww/scripts/workspaces.nix new file mode 100644 index 00000000..056fd437 --- /dev/null +++ b/home/features/desktop/hyprland/eww/scripts/workspaces.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + home.file.".config/eww/scripts/workspaces.sh" = { + text = '' + ''; + executable = true; + }; +} \ No newline at end of file