From 6e9a67c3b314d7c706013a88f14656871934e009 Mon Sep 17 00:00:00 2001 From: The_miro Date: Thu, 7 Nov 2024 22:28:19 +0100 Subject: [PATCH] added waybar, theme for wofi, swww --- .bashrc | 6 + .zshrc | 2 + desktopenvs/hyprland/hypr/hyprland.conf | 5 +- desktopenvs/hyprland/waybar/config | 216 ++++++++++++++++++ desktopenvs/hyprland/waybar/config.jsonc | 0 .../hyprland/waybar/scripts/amixer-toggle.sh | 11 + .../hyprland/waybar/scripts/brightness.sh | 3 + .../hyprland/waybar/scripts/colorpicker.sh | 60 +++++ .../hyprland/waybar/scripts/myUpdates.sh | 24 ++ .../hyprland/waybar/scripts/myupdate.sh | 22 ++ .../hyprland/waybar/scripts/powerdraw.sh | 10 + desktopenvs/hyprland/waybar/style.css | 58 +++++ desktopenvs/hyprland/wofi/config | 3 + desktopenvs/hyprland/wofi/style.css | 57 +++++ 14 files changed, 475 insertions(+), 2 deletions(-) create mode 100644 desktopenvs/hyprland/waybar/config delete mode 100644 desktopenvs/hyprland/waybar/config.jsonc create mode 100755 desktopenvs/hyprland/waybar/scripts/amixer-toggle.sh create mode 100644 desktopenvs/hyprland/waybar/scripts/brightness.sh create mode 100755 desktopenvs/hyprland/waybar/scripts/colorpicker.sh create mode 100755 desktopenvs/hyprland/waybar/scripts/myUpdates.sh create mode 100755 desktopenvs/hyprland/waybar/scripts/myupdate.sh create mode 100755 desktopenvs/hyprland/waybar/scripts/powerdraw.sh create mode 100644 desktopenvs/hyprland/waybar/style.css create mode 100644 desktopenvs/hyprland/wofi/config create mode 100644 desktopenvs/hyprland/wofi/style.css diff --git a/.bashrc b/.bashrc index f16bfb6..bdbc902 100644 --- a/.bashrc +++ b/.bashrc @@ -17,4 +17,10 @@ alias ..="cd .." alias m="micro" alias sm="sudo micro" +alias gita="git add ." +alias gitc="git commit -m" +alias gitp="git push" + +alias icat="kitten icat" + eval "$(starship init bash)" diff --git a/.zshrc b/.zshrc index 712b6c4..11f883e 100644 --- a/.zshrc +++ b/.zshrc @@ -122,4 +122,6 @@ alias gita="git add ." alias gitc="git commit -m" alias gitp="git push" +alias icat="kitten icat" + eval "$(starship init zsh)" diff --git a/desktopenvs/hyprland/hypr/hyprland.conf b/desktopenvs/hyprland/hypr/hyprland.conf index 25a5c67..c7a83f1 100644 --- a/desktopenvs/hyprland/hypr/hyprland.conf +++ b/desktopenvs/hyprland/hypr/hyprland.conf @@ -350,7 +350,8 @@ windowrule = float, title:Gunfire Reborn #exec-once = nextcloud -#exec-once=bash swww img /ast/bg.jpg ; swww restore -#exec-once=bash waybar +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/desktopenvs/hyprland/waybar/config b/desktopenvs/hyprland/waybar/config new file mode 100644 index 0000000..86087d5 --- /dev/null +++ b/desktopenvs/hyprland/waybar/config @@ -0,0 +1,216 @@ + { + "layer": "top", "position": "top", + "modules-left": ["clock", "disk", "memory", "cpu", "temperature" ], + "modules-center": [ "hyprland/workspaces", "hyprland/window"], + "modules-right": ["tray", "pulseaudio", "network", "battery" ], + "reload_style_on_change":true, + + "custom/logo": { + "format": "", + "tooltip": false + }, + + "hyprland/workspaces": { + "format": "{icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "6": "", + "active": "", + "default": "" + }, + "persistent-workspaces": { + "*": [ 2, 3, 4, 5, 6 ] + } +}, + +"idle_inhibitor":{ + "format": "{icon} ", + "format-icons": { + "activated":"󰈈", + "deactivated":"󰈉" + } +}, + +"custom/weather": { + "format": "{}", + "return-type": "json", + "exec": "~/.config/waybar/scripts/weather.sh", + "interval": 10, + "on-click": "firefox https://wttr.in" +}, + +"custom/clipboard":{ + "format":"", + "on-click": "cliphist list | rofi -dmenu | cliphist decode | wl-copy", + "interval":86400 +}, + + +"clock": { + "format": "{:%H:%M:%S }", + "interval":1, + "tooltip-format": "\n{:%Y %B}\n{calendar}", + "calendar-weeks-pos": "right", + "today-format": "{}", + "format-calendar": "{}", + "format-calendar-weeks": "W{:%V}", + "format-calendar-weekdays": "{}" + }, + + "bluetooth": { + "format-on": "", + "format-off": "", + "format-disabled": "󰂲", + "format-connected": "󰂴", + "format-connected-battery": "{device_battery_percentage}% 󰂴", + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%", + "on-click": "rofi-bluetooth", + }, + +"network": { + "format-wifi": " ", + "format-ethernet":" ", + "format-disconnected": "", + "tooltip-format": "{ipaddr}", + "tooltip-format-wifi": "{essid} ({signalStrength}%)  | {ipaddr}", + "tooltip-format-ethernet": "{ifname} 🖧 | {ipaddr}", + "on-click": "networkmanager_dmenu" + }, + +"battery": { + "interval":1, + "states": { + "good": 95, + "warning": 30, + "critical": 20 + }, + "format": "{capacity}% {icon} ", + "format-charging": "{capacity}% 󰂄 ", + "format-plugged": "{capacity}% 󰂄 ", + "format-alt": "{time} {icon}", + "format-icons": [ + "󰁻", + "󰁼", + "󰁾", + "󰂀", + "󰂂", + "󰁹" + ], + }, +"backlight": { + "device": "intel_backlight", + "format": "{icon}", + "format-icons": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ], + "on-scroll-down": "light -A 10", + "on-scroll-up": "light -U 10", + "smooth-scrolling-threshold": 1 + }, + + "disk": { + "interval": 30, + "format": " {percentage_used}%", + "path": "/" + }, + + "custom/colorpicker": { + "format": "{}", + "return-type": "json", + "interval": "once", + "exec": "~/.config/waybar/scripts/colorpicker.sh -j", + "on-click": "sleep 1 && ~/.config/waybar/scripts/colorpicker.sh", + "signal": 1 + }, + + "cpu": { + "interval": 1, + "format": " {usage}%", + "min-length": 6, + "max-length": 6, + "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], + }, + +"memory": { + "format": " {percentage}%" +}, + + "hyprland/window": { + "format": "( {class} )", + "rewrite": { + "(.*) - Mozilla Firefox": "🌎 $1", + "(.*) - zsh": "> [$1]" + } +}, + +"temperature": { + "format": " {temperatureC}°C", + "format-critical": " {temperatureC}°C", + "interval": 1, + "critical-threshold": 80, + "on-click": "foot btop", + }, + +"pulseaudio": { + "format": "{volume}% {icon}", + "format-bluetooth":"󰂰", + "format-muted": "", + "format-icons": { + "headphones": "", + "bluetooth": "󰥰", + "handsfree": "", + "headset": "󱡬", + "phone": "", + "portable": "", + "car": "", + "default": ["󰕿","󰖀","󰕾"] + }, + "justify": "center", + "on-click": "amixer sset Master toggle", + "on-click-right": "pavucontrol", + "tooltip-format": "{icon} {volume}%" +}, + +"jack": { + "format": "{} 󱎔", + "format-xrun": "{xruns} xruns", + "format-disconnected": "DSP off", + "realtime": true +}, + +"tray": { + "icon-size": 14, + "spacing": 10 +}, + +"upower": { + "show-icon": false, + "hide-if-empty": true, + "tooltip": true, + "tooltip-spacing": 20 +}, + + "custom/powerDraw": { + "format": "{}", + "interval": 1, + "exec": "~/.config/waybar/scripts/powerdraw.sh", + "return-type": "json" + } + +} diff --git a/desktopenvs/hyprland/waybar/config.jsonc b/desktopenvs/hyprland/waybar/config.jsonc deleted file mode 100644 index e69de29..0000000 diff --git a/desktopenvs/hyprland/waybar/scripts/amixer-toggle.sh b/desktopenvs/hyprland/waybar/scripts/amixer-toggle.sh new file mode 100755 index 0000000..ca45bba --- /dev/null +++ b/desktopenvs/hyprland/waybar/scripts/amixer-toggle.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Check the current state of the speaker +state=$(amixer -D pulse sget Master | awk '/\[on\]/{print "unmute"; exit} /\[off\]/{print "mute"; exit}') + +# Toggle the state of the speaker +# +if [ "$state" = "[on] "]; then + amixer +# amixer -D pulse sset Master "$state" > /dev/null + diff --git a/desktopenvs/hyprland/waybar/scripts/brightness.sh b/desktopenvs/hyprland/waybar/scripts/brightness.sh new file mode 100644 index 0000000..7a693aa --- /dev/null +++ b/desktopenvs/hyprland/waybar/scripts/brightness.sh @@ -0,0 +1,3 @@ +#!/bin/bash + + diff --git a/desktopenvs/hyprland/waybar/scripts/colorpicker.sh b/desktopenvs/hyprland/waybar/scripts/colorpicker.sh new file mode 100755 index 0000000..3047757 --- /dev/null +++ b/desktopenvs/hyprland/waybar/scripts/colorpicker.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +check() { + command -v "$1" 1>/dev/null +} + +notify() { + check notify-send && { + notify-send -a "Color Picker" "$@" + return + } + echo "$@" +} + +loc="$HOME/.cache/colorpicker" +[ -d "$loc" ] || mkdir -p "$loc" +[ -f "$loc/colors" ] || touch "$loc/colors" + +limit=10 + +[[ $# -eq 1 && $1 = "-l" ]] && { + cat "$loc/colors" + exit +} + +[[ $# -eq 1 && $1 = "-j" ]] && { + text="$(head -n 1 "$loc/colors")" + + mapfile -t allcolors < <(tail -n +2 "$loc/colors") + # allcolors=($(tail -n +2 "$loc/colors")) + tooltip=" COLORS\n\n" + + tooltip+="-> $text \n" + for i in "${allcolors[@]}"; do + tooltip+=" $i \n" + done + + cat <", "tooltip":"$tooltip"} +EOF + + exit +} + +check hyprpicker || { + notify "hyprpicker is not installed" + exit +} +killall -q hyprpicker +color=$(hyprpicker) + +check wl-copy && { + echo "$color" | sed -z 's/\n//g' | wl-copy +} + +prevColors=$(head -n $((limit - 1)) "$loc/colors") +echo "$color" >"$loc/colors" +echo "$prevColors" >>"$loc/colors" +sed -i '/^$/d' "$loc/colors" +pkill -RTMIN+1 waybar diff --git a/desktopenvs/hyprland/waybar/scripts/myUpdates.sh b/desktopenvs/hyprland/waybar/scripts/myUpdates.sh new file mode 100755 index 0000000..5011866 --- /dev/null +++ b/desktopenvs/hyprland/waybar/scripts/myUpdates.sh @@ -0,0 +1,24 @@ +#!/bin/bash +format() { + if [ "$1" -eq 0 ]; then + echo '-' + else + echo "$1" + fi +} + +if ! updates_arch="$(checkupdates | wc -l)"; then + updates_arch=0 +fi + +if ! updates_aur="$(yay -Qum 2>/dev/null | wc -l)"; then + updates_aur=0 +fi + +updates="$((updates_arch + updates_aur))" + +if [ "$updates" -gt 0 ]; then + echo " ($(format $updates_arch)/$(format $updates_aur))" +else + echo +fia diff --git a/desktopenvs/hyprland/waybar/scripts/myupdate.sh b/desktopenvs/hyprland/waybar/scripts/myupdate.sh new file mode 100755 index 0000000..99e5e72 --- /dev/null +++ b/desktopenvs/hyprland/waybar/scripts/myupdate.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +pkgmgr="pacman" +hash paru 2>/dev/null && pkgmgr="paru" +hash yay 2>/dev/null && pkgmgr="yay" + +IFS=$'\n'$'\r' + +updatesli=($($pkgmgr -Qu)) +text=${#updatesli[@]} +icon="" +[ $text -eq 0 ] && icon="" || icon="📦" + +for i in ${updatesli[@]} +do + tooltip+="$i\n" +done + +cat << EOF +{ "text":"$icon", "tooltip":"UPDATES: $text"} +EOF + diff --git a/desktopenvs/hyprland/waybar/scripts/powerdraw.sh b/desktopenvs/hyprland/waybar/scripts/powerdraw.sh new file mode 100755 index 0000000..8d367b7 --- /dev/null +++ b/desktopenvs/hyprland/waybar/scripts/powerdraw.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f /sys/class/power_supply/BAT*/power_now ]; then + powerDraw="󰠰 $(($(cat /sys/class/power_supply/BAT*/power_now)/1000000))w" +fi + + +cat << EOF +{ "text":"$powerDraw", "tooltip":"power Draw $powerDraw"} +EOF diff --git a/desktopenvs/hyprland/waybar/style.css b/desktopenvs/hyprland/waybar/style.css new file mode 100644 index 0000000..8a73e2e --- /dev/null +++ b/desktopenvs/hyprland/waybar/style.css @@ -0,0 +1,58 @@ +* { + border: none; + font-family: Agave Nerd Font Mono, Arial, sans-serif; + font-size: 12pt; + background: transparent; + + padding-top: 2px; + padding-bottom: 2px; + padding-right: 6px; + padding-left: 6px; + + margin-top: 1px; + margin-bottom: 0px; + margin-right: 2px; + margin-left: 2px; + + border-radius: 30px; + } + + #workspaces button { + border: solid; + border-width: 3px; + background: #1a1a1a; + color: #5018dd; + } + + + #workspaces button.active { + border: solid; + border-width: 3px; + background: #1a1a1a; + color: #E40046; + + } + + #workspaces button.urgent { + border: solid; + border-width: 3px; + background: #E40046; + color: #1a1a1a; + + } + + + #clock, #disk, #window, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor { + border: solid; + border-width: 3px; + background: #1a1a1a; + color: #5018dd; + } + + #idle_inhibitor.activated { + border: solid; + border-width: 3px; + background: #1a1a1a; + color: #E40046; + + } diff --git a/desktopenvs/hyprland/wofi/config b/desktopenvs/hyprland/wofi/config new file mode 100644 index 0000000..ec8f4ca --- /dev/null +++ b/desktopenvs/hyprland/wofi/config @@ -0,0 +1,3 @@ +normal_window=true +width = 700 +height= 400 diff --git a/desktopenvs/hyprland/wofi/style.css b/desktopenvs/hyprland/wofi/style.css new file mode 100644 index 0000000..1dc2563 --- /dev/null +++ b/desktopenvs/hyprland/wofi/style.css @@ -0,0 +1,57 @@ + + * { + font-family: JetBrains Mono, Agave Nerd Font Mono, Arial, sans-serif; + border-radius: 15px; + font-size: 18pt; + background-color: #1a1a1a; + + padding-top: 1px; + padding-bottom: 1px; + padding-right: 6px; + padding-left: 6px; + + margin-top: 2px; + margin-bottom: 2px; + margin-right: 2px; + margin-left: 2px; + } + + window { + + color: #E40046; + } + #input { + border: solid; + border-width: 4px; + color: #5018dd; + border-radius: 30px; + + + + #padding-top: 15px; + + margin-top: 15px; + padding-right: 15px; + padding-left: 15px; + + margin-right: 15px; + margin-left: 15px; + } + + #entry:selected { + border: solid; + border-width: 4px; + color: #E40046; + border-radius: 30px; + + } + + #inner-box { + } + #scroll{ + margin-bottom: 15px; + padding-bottom: 15px; + + + + }