diff --git a/desktopenvs/hyprland/eww/eww.scss b/desktopenvs/hyprland/eww/eww.scss new file mode 100644 index 0000000..4a09c40 --- /dev/null +++ b/desktopenvs/hyprland/eww/eww.scss @@ -0,0 +1,70 @@ +* { + all: unset; // Unsets everything so you can style everything from scratch + font-family: Agave Nerd Font Mono, sans-serif; + font-size: 14pt; +} + +// Global Styles +.bar { + + color: #b0b4bc; + padding: 10px; +} + +// Styles on classes (see eww.yuck for more information) + +.sidestuff slider { + all: unset; + color: #ffd5cd; +} + +.metric scale trough highlight { + all: unset; + background: #E40046; + + color: #000000; + border-radius: 10px; + +} + +.metric scale trough { + all: unset; + background-color: #5018dd; + border-radius: 50px; + min-height: 3px; + min-width: 50px; + margin-left: 10px; + margin-right: 20px; +} + +.label-ram { + font-size: large; +} + + + +.music,.metric,.clock,.workspace-button { + border: solid; + border-width: 3px; + background: #1a1a1a; + color: #5018dd; + + padding-top:5px; + margin-top:1px; + + padding-bottom:5px; + margin-bottom:1px; + + padding-left:5px; + margin-left:4px; + + padding-right:5px; + margin-right:4px; + + border-radius: 25px; +} + +.workspace-active { + color: #E40046; + +} diff --git a/desktopenvs/hyprland/eww/eww.yuck b/desktopenvs/hyprland/eww/eww.yuck new file mode 100644 index 0000000..66f1a68 --- /dev/null +++ b/desktopenvs/hyprland/eww/eww.yuck @@ -0,0 +1,88 @@ + +(defwindow bar [monitor] + :monitor monitor + :windowtype "dock" + :geometry (geometry :x "0%" + :y "1%" + :width "99%" + :height "20px" + :anchor "top center") + :exclusive true + (bar :monitor_ monitor)) + + + + +(defwidget bar [monitor_] + (centerbox :orientation "h" + (workspaceWidget :monitor monitor_) + (music) + (sidestuff))) + + + +(defwidget sidestuff [] + (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" + (metric :label "󰓃" + :value volume + :onchange "amixer -D pulse sset Master {}%") + (metric :label "" + :value {EWW_RAM.used_mem_perc} + :onchange "") + (metric :label "" + :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} + :onchange "") + (clock) + )) + +(defwidget music [] + (box :class "music" + :orientation "h" + :space-evenly false + :halign "center" + {music != "" ? "🎵${music}" : ""})) + + +(defwidget metric [label value onchange] + (box :orientation "h" + :class "metric" + :space-evenly false + (box :class "label" label) + (scale :min 0 + :max 101 + :active {onchange != ""} + :value value + :onchange onchange))) + +(deflisten workspaces "hyprland-workspaces _") + +(defwidget workspaceWidget [monitor] + (eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" + (box :class "workspaces" + :space-evenly false + :width 20 + (for i in {workspaces[monitor].workspaces} + (button + :onclick "hyprctl dispatch workspace ${i.id}" + :class "${i.class}" + "${i.name}"))))) + + +(deflisten workspace-old "scripts/workspace") +(defwidget workspaces-old [] +(literal :content workspace-old)) + +(deflisten music :initial "" + "playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true") + +(defpoll volume :interval "1s" + "scripts/getvol") + +(defpoll time :interval "1s" + "date '+%H:%M:%S | %d.%m.%Y'") + +(defwidget clock [] + (box :class "clock" + (label :text time) + ) +) diff --git a/desktopenvs/hyprland/eww/scripts/getvol b/desktopenvs/hyprland/eww/scripts/getvol new file mode 100755 index 0000000..4e4275d --- /dev/null +++ b/desktopenvs/hyprland/eww/scripts/getvol @@ -0,0 +1,12 @@ +#!/bin/sh + +if command -v pamixer &>/dev/null; then + if [ true == $(pamixer --get-mute) ]; then + echo 0 + exit + else + pamixer --get-volume + fi +else + amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}' +fi diff --git a/desktopenvs/hyprland/eww/scripts/workspace b/desktopenvs/hyprland/eww/scripts/workspace new file mode 100755 index 0000000..eccbd90 --- /dev/null +++ b/desktopenvs/hyprland/eww/scripts/workspace @@ -0,0 +1,52 @@ +#! /bin/bash + +#define icons for workspaces 1-9 +ic=(0 1 2 3 4 5 6 7 8 9) + +#initial check for occupied workspaces +for num in $(hyprctl workspaces | grep ID | sed 's/()/(1)/g' | awk 'NR>1{print $1}' RS='(' FS=')'); do + export o"$num"="$num" +done + +#initial check for focused workspace +for num in $(hyprctl monitors | grep active | sed 's/()/(1)/g' | awk 'NR>1{print $1}' RS='(' FS=')'); do + export f"$num"="$num" + export fnum=f"$num" +done + +workspaces() { +if [[ ${1:0:9} == "workspace" ]]; then #set focused workspace + unset -v "$fnum" + num=${1:11} + export f"$num"="$num" + export fnum=f"$num" + +elif [[ ${1:0:15} == "createworkspace" ]]; then #set Occupied workspace + num=${1:17} + export o"$num"="$num" + export f"$num"="$num" + +elif [[ ${1:0:16} == "destroyworkspace" ]]; then #unset unoccupied workspace + num=${1:18} + unset -v o"$num" f"$num" +fi + +#output eww widget +echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \ + (box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"true\" \ + (button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1 && /home/taylor/.config/hypr/default_app\" :class \"0$o1$f1\" \"${ic[1]}\") \ + (button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2 && /home/taylor/.config/hypr/default_app\" :class \"0$o2$f2\" \"${ic[2]}\") \ + (button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3 && /home/taylor/.config/hypr/default_app\" :class \"0$o3$f3\" \"${ic[3]}\") \ + (button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4 && /home/taylor/.config/hypr/default_app\" :class \"0$o4$f4\" \"${ic[4]}\") \ + (button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5 && /home/taylor/.config/hypr/default_app\" :class \"0$o5$f5\" \"${ic[5]}\") \ + (button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6 && /home/taylor/.config/hypr/default_app\" :class \"0$o6$f6\" \"${ic[6]}\") \ + (button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7 && /home/taylor/.config/hypr/default_app\" :class \"0$o7$f7\" \"${ic[7]}\") \ + )\ + )" +} + +workspaces + +socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do +workspaces "$event" +done diff --git a/desktopenvs/hyprland/hypr/ewwstart.sh b/desktopenvs/hyprland/hypr/ewwstart.sh new file mode 100755 index 0000000..7ba7a17 --- /dev/null +++ b/desktopenvs/hyprland/hypr/ewwstart.sh @@ -0,0 +1,3 @@ +/usr/bin/eww daemon +/usr/bin/eww open bar --id primary --arg monitor=1 +/usr/bin/eww open bar --id secondary --arg monitor=0 diff --git a/desktopenvs/hyprland/hypr/hyprland.conf b/desktopenvs/hyprland/hypr/hyprland.conf index 607dcf1..edef80e 100644 --- a/desktopenvs/hyprland/hypr/hyprland.conf +++ b/desktopenvs/hyprland/hypr/hyprland.conf @@ -39,15 +39,6 @@ device { -# ####################################################################################### -# AUTOGENERATED HYPR CONFIG. -# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, -# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. -# ####################################################################################### - -#enable left handed mode if not implemented on hardware side -#left_handed = true - #autogenerated = 0 # remove this line to remove the warning # This is an example Hyprland config file. @@ -105,7 +96,9 @@ $menu = wofi --show=drun # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: -exec-once = waybar +exec-once=bash ~/.config/hypr/ewwstart.sh + +#exec-once = waybar exec-once = dunst # exec-once = nm-applet & exec-once = swww-daemon & swww img /ast/bg.jpg & sleep 1s & swww restore @@ -222,7 +215,9 @@ bind = $mainMod, H, movecurrentworkspacetomonitor bind = $mainMod, D, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, L, exec, hyprctl dispatch exit 1 -bind = $mainMod, A, exec, killall waybar ; waybar +#bind = $mainMod, A, exec, killall waybar ; waybar +bind = $mainMod, A, exec, eww reload + # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l @@ -376,6 +371,7 @@ windowrule = float, title:Gunfire Reborn windowrulev2 = minsize 60 70, title:.+btop.+ +windowrulev2 = stayfocused, class:.+dmenu.+ windowrulev2 = move 50% 10%, class:com.nextcloud.desktopclient.nextcloud windowrulev2 = float, class:com.nextcloud.desktopclient.nextcloud @@ -384,7 +380,6 @@ windowrulev2 = stayfocused, class:com.nextcloud.desktopclient.nextcloud #exec-once = nextcloud exec-once=bash swww img ~/Pictures/background.jpg && swww restore -exec-once=bash waybar #exec-once=bash dunst #exec-once=bash nm-applet --indicator #exec-once=waybar diff --git a/hyprland-eww-wofi-installer.sh b/hyprland-eww-wofi-installer.sh new file mode 100644 index 0000000..f8ac635 --- /dev/null +++ b/hyprland-eww-wofi-installer.sh @@ -0,0 +1,83 @@ + +#install components +echo "Installing required Packages" +sudo pacman -S base base-devel btop btrfs-progs curl dolphin dunst fastfetch firefox flatpak gcc git gnu-netcat greetd-tuigreet grim grub gst-plugin-pipewire htop hyfetch hyprland imagemagick iwd jq kitty ldns libpulse linux linux-firmware micro nano networkmanager nmap openssh nerd-fonts otf-font-awesome pipewire pipewire-alsa pipewire-jack pipewire-pulse polkit-kde-agent qt5-wayland qt6-wayland slurp smartmontools swww ttf-jetbrains-mono unzip vim waybar wget wireless_tools wireplumber wireshark-qt wofi wpa_supplicant xdg-desktop-portal-hyprland xdg-utils xf86-video-amdgpu xf86-video-ati xf86-video-nouveau xf86-video-vmware xorg-server xorg-xinit yazi zip zram-generator zsh + +#aur/yay setup +echo "Installing yay" +cd ~ +mkdir install-tmp +cd install-tmp +git clone https://aur.archlinux.org/yay.git +cd yay +makepkg -si +yay --version +cd ~/install-tmp + +#networkmanager setup +echo "enabling NetworkManager" +sudo systemctl enable NetworkManager.service + +#AUR list +echo "Installing AUR packages" +yay -S hyprland-workspaces + +#eww compilation +echo "compiling EWW" +cd ~/install-tmp +git clone https://github.com/elkowar/eww +cd eww +cargo build --release --no-default-features --features=wayland +cd target/release +chmod +x ./eww +sudo cp ./eww /usr/bin + +#desktop env dotfiles +echo "Installing Desktop enviroment configs" +ln -s ~/Dotfiles/desktopenvs/hyprland/eww/ ~/.config/eww +ln -s ~/Dotfiles/desktopenvs/hyprland/kitty/ ~/.config/kitty +ln -s ~/Dotfiles/desktopenvs/hyprland/hypr/ ~/.config/hypr +ln -s ~/Dotfiles/desktopenvs/hyprland/wofi/ ~/.config/wofi +ln -s ~/Dotfiles/desktopenvs/hyprland/dunst/ ~/.config/dunst + + +#zsh setup +echo "Setting up zsh" +chsh -s /usr/bin/zsh +#homectl update --shell=/usr/bin/zsh + +#starship setup +echo "Installing Starship" +curl -sS https://starship.rs/install.sh | sh + +#ohmyzsh setup +echo "Installing oh my zsh" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + +#ohmyzsh plugins +echo "Installing oh my zsh plugins" +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting +git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + +#greetd setup +echo "Installing greetd" +sudo cp -f ~/Dotfiles/desktopenvs/hyprland/greetd-tuigreet/config.toml /etc/greetd/config.toml +sudo systemctl enable greetd.service + + +#cli dotfiles +echo "Installing bash and zsh setting files" +rm ~/.bashrc +rm ~/.zshrc +ln -s ~/Dotfiles/.bashrc ~/.bashrc +ln -s ~/Dotfiles/.zshrc ~/.zshrc + +ln -s ~/Dotfiles/starship.toml ~/.config/starship.toml +ln -s ~/Dotfiles/micro/ ~/.config/micro +ln -s ~/Dotfiles/yazi/ ~/.config/yazi +ln -s ~/Dotfiles/spotify-tui/config.yml ~/.config/spotify-tui/config.yml + +#final reboot +echo "Press any key to reboot" +read +systemctl reboot