diff --git a/RiceInstaller b/RiceInstaller index c200b9b..d0acd1d 100755 --- a/RiceInstaller +++ b/RiceInstaller @@ -67,9 +67,9 @@ clear logo "Installing needed packages.." dependencias=(base-devel rustup pacman-contrib bspwm polybar sxhkd \ - alacritty brightnessctl dunst rofi lsd \ + alacritty brightnessctl dunst rofi lsd stalonetray \ jq polkit-gnome git playerctl mpd xclip \ - ncmpcpp geany ranger mpc picom xdotool \ + ncmpcpp geany ranger mpc picom xdo xdotool jgmenu \ feh ueberzug maim pamixer libwebp xdg-user-dirs \ webp-pixbuf-loader xorg-xprop xorg-xkill physlock papirus-icon-theme \ ttf-jetbrains-mono ttf-jetbrains-mono-nerd ttf-terminus-nerd ttf-inconsolata ttf-joypixels \ @@ -263,6 +263,26 @@ else printf "\n%s%sTdrop is already installed%s\n" "${BLD}" "${CGR}" "${CNC}" fi +# Installing Eww + if command -v eww >/dev/null 2>&1; then + printf "\n%s%sEww is already installed%s\n" "${BLD}" "${CGR}" "${CNC}" + else + printf "\n%s%sInstalling Eww, this could take 10 mins or more.%s\n" "${BLD}" "${CBL}" "${CNC}" + { + sudo pacman -S rustup --noconfirm + cd "$HOME" || exit + git clone https://github.com/elkowar/eww + cd eww || exit + cargo build --release --no-default-features --features x11 + sudo install -m 755 "$HOME/eww/target/release/eww" -t /usr/bin/ + } && { + cd "$HOME" || exit + rm -rf {paru-bin,.cargo,.rustup,eww} + } || { + printf "\n%s%sFailed to install Eww. You may need to install it manually%s\n" "${BLD}" "${CRE}" "${CNC}" + } +fi + ########## ---------- Enabling MPD service ---------- ########## logo "Enabling mpd service" diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index f24ae64..3aa7ad6 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -1,8 +1,11 @@ #!/usr/bin/env bash -# ╔╗ ╔═╗╔═╗╦ ╦╔╦╗ - z0mbi3 -# ╠╩╗╚═╗╠═╝║║║║║║ - https://github.com/gh0stzk/dotfiles -# ╚═╝╚═╝╩ ╚╩╝╩ ╩ - z0mbi3.zk@protonmail.com - +# +# ██████╗ ███████╗██████╗ ██╗ ██╗███╗ ███╗██████╗ ██████╗ +# ██╔══██╗██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝ +# ██████╔╝███████╗██████╔╝██║ █╗ ██║██╔████╔██║██████╔╝██║ +# ██╔══██╗╚════██║██╔═══╝ ██║███╗██║██║╚██╔╝██║██╔══██╗██║ +# ██████╔╝███████║██║ ╚███╔███╔╝██║ ╚═╝ ██║██║ ██║╚██████╗ +# ╚═════╝ ╚══════╝╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ # ┬┌┬┐┌─┐┌─┐┬─┐┌┬┐┌─┐┌┐┌┌┬┐ ┬ ┬┌─┐┬─┐┬┌─┐┌┐ ┬ ┌─┐┌─┐ # ││││├─┘│ │├┬┘ │ ├─┤│││ │ └┐┌┘├─┤├┬┘│├─┤├┴┐│ ├┤ └─┐ @@ -15,20 +18,18 @@ rice_dir="$HOME/.config/bspwm/karla" ## Fix java applications export _JAVA_AWT_WM_NONREPARENTING=1 -# ┬ ┬┌─┐┬─┐┬┌─┌─┐┌─┐┌─┐┌─┐┌─┐┌─┐ -# ││││ │├┬┘├┴┐└─┐├─┘├─┤│ ├┤ └─┐ -# └┴┘└─┘┴└─┴ ┴└─┘┴ ┴ ┴└─┘└─┘└─┘ +# ╦ ╦╔═╗╦═╗╦╔═╔═╗╔═╗╔═╗╔═╗╔═╗╔═╗ +# ║║║║ ║╠╦╝╠╩╗╚═╗╠═╝╠═╣║ ║╣ ╚═╗ +# ╚╩╝╚═╝╩╚═╩ ╩╚═╝╩ ╩ ╩╚═╝╚═╝╚═╝ -workspaces() { - name=1 - for monitor in $(bspc query -M); do - bspc monitor "${monitor}" -n "$name" -d '1' '2' '3' '4' '5' '6' - #bspc monitor ${monitor} -n "$name" -d '' '' '' '' '' '' - (( name++ )) + # Default 1 monitor with 6 workspaces + for monitor in "$(xrandr -q | grep -w 'connected' | cut -d' ' -f1)"; do + bspc monitor "$monitor" -d '1' '2' '3' '4' '5' '6' + #bspc monitor "$monitor" -d '' '' '' '' '' '' done -} -workspaces + ## For two or three monitors configuration see https://github.com/gh0stzk/dotfiles/wiki/Two-or-more-monitors-setup + # ┌┐ ┌─┐┌─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┐┌┌─┐┬┌─┐ # ├┴┐└─┐├─┘││││││ │ │ ││││├┤ ││ ┬ @@ -36,6 +37,7 @@ workspaces bspc config external_rules_command $HOME/.config/bspwm/scripts/ExternalRules +bspc config window_gap 6 bspc config split_ratio 0.51 bspc config single_monocle true bspc config borderless_monocle false @@ -52,15 +54,15 @@ bspc config pointer_action3 resize_corner #bspc wm --adopt-orphans bspc rule -a scratch sticky=on state=floating focus=on -# ┬ ┌─┐┬ ┬┌┐┌┌─┐┬ ┬ ┌─┐┌─┐─┐ ┬┬ ┬ ┬─┐┬┌─┐┌─┐┌─┐ -# │ ├─┤│ │││││ ├─┤ └─┐├┤ ┌┴┬┘└┬┘ ├┬┘││ ├┤ └─┐ -# ┴─┘┴ ┴└─┘┘└┘└─┘┴ ┴ └─┘└─┘┴ └─ ┴ ┴└─┴└─┘└─┘└─┘ +# ╔═╗╦ ╦╔╦╗╔═╗╔═╗╔╦╗╔═╗╦═╗╔╦╗ +# ╠═╣║ ║ ║ ║ ║╚═╗ ║ ╠═╣╠╦╝ ║ +# ╩ ╩╚═╝ ╩ ╚═╝╚═╝ ╩ ╩ ╩╩╚═ ╩ # Set system vars for polybar . SetSysVars # Terminate already running polybar,picom, sxhkd and dunst instances -processes=("picom" "polybar" "sxhkd" "dunst") +processes=("eww" "picom" "polybar" "sxhkd" "dunst") for process in "${processes[@]}"; do if pidof -q "$process"; then @@ -73,8 +75,8 @@ done # Launch picom // If you have old hardware or encounter problems # uncomment the picom "--legacy-backends" line and comment the current one. -picom --config "$HOME"/.config/bspwm/picom.conf & -#picom --legacy-backends --config "$HOME"/.config/bspwm/picom.conf & +pidof -q picom || { picom --config "$HOME"/.config/bspwm/picom.conf & } +#pidof -q picom || { picom --legacy-backends --config "$HOME"/.config/bspwm/picom.conf & } # Launch dunst notification daemon dunst -config "$HOME"/.config/bspwm/dunstrc & @@ -82,6 +84,12 @@ dunst -config "$HOME"/.config/bspwm/dunstrc & # Set random wallpaper for actual rice feh -z --no-fehbg --bg-fill ${rice_dir}/walls +# Launch eww daemon +pidof -q eww || { eww -c "$HOME"/.config/bspwm/eww daemon & } + +# Launch stalonetray +stalonetray -c "$HOME"/.config/bspwm/stalonetrayrc & sleep 0.1 && xdo hide -N stalonetray && touch "/tmp/syshide.lock" + # Reload sxhkd daemon sxhkd -c "$HOME"/.config/bspwm/sxhkdrc & diff --git a/config/bspwm/eww/calendar/calendar.scss b/config/bspwm/eww/calendar/calendar.scss new file mode 100644 index 0000000..e4fc82c --- /dev/null +++ b/config/bspwm/eww/calendar/calendar.scss @@ -0,0 +1,53 @@ +.date { + background-color: $bg; + color: $fg; + border-radius: .5rem; +} + +.cal-box { + font-family: Cantarell; + font-weight: Bold; + font-size: .9rem; + background-color: $bg; + border-radius: .5rem; + padding: 0 1rem .2rem; + color: $fg; + background-color: $bg-alt; + margin: .6rem .6rem .6rem .6rem; + + .cal { + background-color: inherit; + padding: .5rem .15rem .2rem; + margin-left: 10px; + + & > * { + border: solid 0px transparent; + } + + &.highlight { + padding: 10rem; + } + } +} + +calendar:selected { + color: $magenta; +} + +calendar.header { + color: $magenta; + font-weight: bold; +} + +calendar.button { + color: $fg; +} + +calendar.highlight { + color: $green; + font-weight: bold; +} + +calendar:indeterminate { + color: $lightblack; +} diff --git a/config/bspwm/eww/calendar/calendar.yuck b/config/bspwm/eww/calendar/calendar.yuck new file mode 100644 index 0000000..9b07307 --- /dev/null +++ b/config/bspwm/eww/calendar/calendar.yuck @@ -0,0 +1,19 @@ + +(defwidget cal [] + (box :class "cal-box" + :orientation "v" + :space-evenly false + (calendar :class "cal" + :day {formattime(EWW_TIME, "%d")} + :month {formattime(EWW_TIME, "%m")} + :year {formattime(EWW_TIME, "%Y")} + )) +) + +;; Windows ;; +(defwindow date + :geometry (geometry :x "42.3%" + :y "5%" + :anchor "center top") + :wm-ignore true +(cal)) diff --git a/config/bspwm/eww/colors.scss b/config/bspwm/eww/colors.scss new file mode 100644 index 0000000..0d52b27 --- /dev/null +++ b/config/bspwm/eww/colors.scss @@ -0,0 +1,13 @@ +// Eww colors for Karla rice +$bg: #0E1113; +$bg-alt: #111517; +$fg: #afb1db; +$black: #373542; +$lightblack: #262831; +$red: #e7034a; +$blue: #5884d4; +$cyan: #7df0f0; +$magenta: #7a44e3; +$green: #61b33e; +$yellow: #ffb964; +$archicon: #0f94d2; diff --git a/config/bspwm/eww/eww.scss b/config/bspwm/eww/eww.scss new file mode 100644 index 0000000..5394f0f --- /dev/null +++ b/config/bspwm/eww/eww.scss @@ -0,0 +1,17 @@ +* { + all: unset; +} + +tooltip { + background-color: #14171c; + color: #b8bfe5; + font-family: Inconsolata SemiCondensed Medium; + font-weight: Bold; + font-size: 1rem; +} + +@import "colors.scss"; +@import "calendar/calendar.scss"; +@import "powermenu/powermenu.scss"; +@import "profilecard/profilecard.scss"; +@import "player/player.scss"; diff --git a/config/bspwm/eww/eww.yuck b/config/bspwm/eww/eww.yuck new file mode 100644 index 0000000..114e1a1 --- /dev/null +++ b/config/bspwm/eww/eww.yuck @@ -0,0 +1,4 @@ +(include "calendar/calendar.yuck") +(include "powermenu/powermenu.yuck") +(include "profilecard/profilecard.yuck") +(include "player/player.yuck") diff --git a/config/bspwm/eww/player/player.scss b/config/bspwm/eww/player/player.scss new file mode 100644 index 0000000..9da7dab --- /dev/null +++ b/config/bspwm/eww/player/player.scss @@ -0,0 +1,111 @@ +.player { + font-family: "JetBrains Mono Medium", "Material Design Icons Desktop"; + background-color: $bg; + padding: 0.6rem; + min-height: 12rem; + border-radius: 0.6rem; + + .player-art { + background-size: cover; + background-repeat: no-repeat; + background-position: center; + box-shadow: 0 0 0.3rem black; + border-radius: 1.2rem; + min-width: 22rem; + + .player-info { + border-radius: 1rem; + background: linear-gradient(to right, rgb(#191919, 1), rgba(#262626, 0.5)); + padding: 0.65rem; + + .player-shuffle, + .player-loop { + font-size: 1rem; + text-shadow: 0 0 0.2rem black; + } + + .spotify-icon { + font-size: 1.25rem; + color: $green; + text-shadow: 0 0 0.2rem black; + } + + .mpd-icon { + font-size: 1.25rem; + color: $magenta; + text-shadow: 0 0 0.2rem black; + } + + .player-title { + font-style: italic; + font-family: Cartograph CF; + font-size: 1.1rem; + font-weight: bold; + color: $fg; + text-shadow: 0 0 0.5rem rgba($color: black, $alpha: 1); + } + + .player-artist { + font-family: JetBrainsMono Nerd Font; + font-weight: bolder; + font-size: 0.8rem; + color: $fg; + text-shadow: 0 0 0.5rem rgba($color: black, $alpha: 1); + } + + .player-time { + font-style: italic; + font-family: Cartograph CF; + font-size: 0.8rem; + color: $fg; + } + + .player-bar scale trough highlight { + all: unset; + background-image: linear-gradient( + to right, + darken($color: $green, $amount: 15%), + $green + ); + border-radius: 2rem; + } + + .player-bar scale trough { + all: unset; + background-color: rgba($fg, 0.3); + box-shadow: 0px 0px 2px 1px rgba(black, 0.5); + border-radius: 1rem; + min-height: 0.35rem; + margin: 0rem 0.2rem 0.2rem 0rem; + } + + .player-position { + font-size: 0.9rem; + font-weight: 500; + color: $fg; + } + } + } + + .player-controls { + padding: 0rem 0.7rem 0rem 1rem; + border-radius: 1rem; + + .player-toggle { + font-size: 1.6rem; + color: $fg; + } + + .player-previous, + .player-next { + font-size: 1.6rem; + color: $fg; + } + + button { + &:hover { + color: $magenta; + } + } + } +} diff --git a/config/bspwm/eww/player/player.yuck b/config/bspwm/eww/player/player.yuck new file mode 100644 index 0000000..182daf3 --- /dev/null +++ b/config/bspwm/eww/player/player.yuck @@ -0,0 +1,176 @@ +;; Vars ;; + +(defpoll music-player :interval "1s" "MediaControl --player") +(defpoll music-art :interval "1s" "MediaControl --cover") +(defpoll music-title :interval "1s" "MediaControl --title") +(defpoll music-artist :interval "1s" "MediaControl --artist") +(defpoll music-status :interval "1s" "MediaControl --status") +(defpoll music-position :interval "1s" "MediaControl --position") +(defpoll music-positions :interval "1s" "MediaControl --positions") +(defpoll music-length :interval "1s" "MediaControl --length") +(defpoll music-lengths :interval "1s" "MediaControl --lengths") +(defpoll shuffle :interval "1s" "MediaControl --shuffle") +(defpoll loop :interval "1s" "MediaControl --loop") + +;; Widgets ;; + +(defwidget shuffle [color action status] + (eventbox + :cursor "pointer" + (button + :onclick action + :style "color: ${color}" + :tooltip status + "󰒟" + ) + ) +) + +(defwidget loop [icon color status action] + (eventbox + :cursor "pointer" + (button + :onclick action + :style "color: ${color}" + :tooltip status + icon + ) + ) +) + +(defwidget player [] + (box + :class "player" + :space-evenly false + (box + :class "player-art" + :style "background-image: url('${music-art}')" + (box + :class "player-info" + :space-evenly false + :orientation "v" + :spacing 10 + (box + :class "top-icons" + (box + :space-evenly false + :spacing 10 + (shuffle + :action {music-player != "spotify" ? "mpc random" : "playerctl -p spotify shuffle toggle"} + :color {shuffle == "On" ? "#81ae5f" : "#b8bfe5"} + :status shuffle + ) + (loop + :action {loop == "None" ? "playerctl -p spotify loop playlist" : + loop == "Off" ? "mpc repeat on" : + loop == "On" ? "mpc repeat off" : + loop == "Playlist" ? "playerctl -p spotify loop track" : "playerctl -p spotify loop none"} + :icon {loop == "Track" ? "󰑘" : + loop == "Playlist" || loop == "On" ? "󰑖" : "󰑗"} + :color {loop == "Playlist" || loop == "Track" || loop == "On" ? "#81ae5f" : "#b8bfe5"} + :status loop + ) + ) + (box + (button + :class {music-player != "spotify" ? "mpd-icon" : "spotify-icon"} + :halign "end" + {music-player != "spotify" ? "󰎆" : "󰓇"} + ) + ) + ) + (label + :class "player-title" + :halign "start" + :text music-title + :limit-width 30 + :wrap true + :xalign 0 + ) + (label + :class "player-artist" + :halign "start" + :text music-artist + :limit-width 35 + ) + + (box + :space-evenly false + :orientation "v" + :valign "end" + :spacing 6 + :vexpand true + (box + :class "player-bar" + (eventbox + :cursor "pointer" + (scale + :onchange {music-player != "spotify" ? "mpc seek {}" : "playerctl -p ${music-player} position {}"} + :min 0 + :max music-lengths + :value music-positions + ) + ) + ) + (box + :class "player-position" + :space-evenly false + :valign "end" + :spacing 3 + (label + :class "player-time" + :text music-position + ) + (label :class "player-time" :text "/") + (label + :class "player-time" + :text music-length + ) + ) + ) + ) + ) + (box + :class "player-controls" + :orientation "v" + :valign "center" + :hexpand true + :space-evenly false + :spacing 20 + (eventbox + :cursor "pointer" + (button + :class "player-previous" + :onclick "MediaControl --previous" + "󰒮" + ) + ) + (eventbox + :cursor "pointer" + (button + :class "player-toggle" + :onclick "MediaControl --toggle" + {music-status == "Playing" ? "󰏤" : music-status == "Paused" ? "󰐊" : "󰓛"} + ) + ) + (eventbox + :cursor "pointer" + (button + :class "player-next" + :onclick "MediaControl --next" + "󰒭" + ) + ) + ) + ) +) + +;; Windows ;; + +(defwindow music + :geometry (geometry :x "15%" + :y "5%" + :anchor "center top") + :wm-ignore false + (player)) + diff --git a/config/bspwm/eww/powermenu/powermenu.scss b/config/bspwm/eww/powermenu/powermenu.scss new file mode 100644 index 0000000..491cd78 --- /dev/null +++ b/config/bspwm/eww/powermenu/powermenu.scss @@ -0,0 +1,36 @@ +window>.powermenu { + margin: .5rem; + background-color: $bg; +} + +.powermenu { + font-family: "Font Awesome 6 Free Solid"; + font-size: 1.5rem; + padding: .3rem; + border-radius: .5rem; + + &.shutdown { + color: $red; + } + + &.reboot { + color: $green; + } + + &.lock { + color: $yellow; + } + + &.exit { + color: $magenta; + } + + button { + background-color: $bg-alt; + padding: 1.2rem; + + &:hover { + background-color: lighten($color: $bg-alt, $amount: 4%); + } + } +} diff --git a/config/bspwm/eww/powermenu/powermenu.yuck b/config/bspwm/eww/powermenu/powermenu.yuck new file mode 100644 index 0000000..7811b90 --- /dev/null +++ b/config/bspwm/eww/powermenu/powermenu.yuck @@ -0,0 +1,42 @@ +(defwidget powermenu [] + (box :class "powermenu" + :orientation "v" + :space-evenly "false" + (lock-power-restart))) + + +(defwidget lock-power-restart [] + (box :class "powermenu" + :orientation "v" + :spacing 10 + (eventbox :cursor "pointer" + (button :class "powermenu lock" + :onclick "physlock -d" + :tooltip "Lock session" + "")) + (eventbox :cursor "pointer" + (button :class "powermenu exit" + :onclick "bspc quit" + :tooltip "Logout bspwm" + "")) + (eventbox :cursor "pointer" + (button :class "powermenu reboot" + :onclick "systemctl reboot" + :tooltip "Restart" + "")) + (eventbox :cursor "pointer" + (button :class "powermenu shutdown" + :onclick "systemctl poweroff" + :tooltip "Shutdown" + "")) + ) +) + +;; Power Menu ;; +(defwindow powermenu + :geometry (geometry :x "0%" + :y "0%" + :anchor "center right") + :wm-ignore false + (powermenu)) + diff --git a/config/bspwm/eww/profilecard/profilecard.scss b/config/bspwm/eww/profilecard/profilecard.scss new file mode 100644 index 0000000..eb40298 --- /dev/null +++ b/config/bspwm/eww/profilecard/profilecard.scss @@ -0,0 +1,243 @@ +.launchermenu { + background-color: $bg; + border-radius: 0.5rem; + margin: .8rem .8rem; + min-width: 18rem; +} + +.timebox { + margin: 0 2.5rem; + .time-container { + .content { + font-family: JetBrainsMono Nerd Font; + font-weight: Bolder; + font-size: 3.6rem; + color: $fg; + } + .divider { + margin: .2rem 15px; + padding: 0px 1px; + background: linear-gradient($red, $magenta, $blue, $cyan); + } + } + .date-container { + font-family: Inconsolata SemiCondensed Medium; + font-weight: Bold; + font-size: 1rem; + color: $fg; + margin: 3px 0; + } +} + +.usercard { + background-color: $bg-alt; + border-radius: 0.5rem; +} + +.face { + background-repeat: no-repeat; + background-size: cover; + background-position: center; + min-height: 65px; + min-width: 65px; + //border: .2rem solid $bg; + border-radius: 100%; + box-shadow: 0 0 7px 1px rgba($fg, 0.3); + margin: 10px -8px 10px 10px; +} + +.user-host { + color: $fg; + font-family: Cartograph CF; + font-weight: Normal; + font-size: 1rem; +} + +.host { + color: $fg; + font-family: Cartograph CF; + font-size: .8rem; +} + +.uptime { + color: $fg; + font-family: Cartograph CF; + font-size: .7rem; + margin-top: .5rem; +} + +.btn-info { + font-family: Material Design Icons Desktop; + font-size: 1.2rem; + color: $fg; + padding: 0 .6rem; +} + +.btn-info:hover { + text-shadow: 0 0 2px $fg; +} + +.usearch { + background-color: $bg-alt; + padding: .8rem; + border-radius: 0.5rem; + color: $fg; +} + +.launcher-pfp-label { + font-family: Inconsolata SemiCondensed Medium; + font-weight: Bold; + font-size: 1rem; +} + +.pacman { + background-color: $bg-alt; + padding: .8rem; + border-radius: 0.5rem; + color: $fg; + + .pacman-icon { + font-family: Material Design Icons Desktop; + font-size: 1.2rem; + color: $yellow; + } + .pacman-info { + font-family: Inconsolata SemiCondensed Medium; + font-weight: Bold; + font-size: 1rem; + } + .pacman-updates { + font-family: Inconsolata Condensed Medium; + font-weight: Bold; + font-size: 1rem; + } +} + +.fetch { + background-color: $bg-alt; + padding: .8rem 2rem .8rem 1rem; + border-radius: 0.5rem; + color: $fg; + + .arch-icon { + font-family: Material Design Icons Desktop; + font-size: 3rem; + color: $archicon; + } +} + +.os-icon { + font-family: Material Design Icons Desktop; + font-size: .8rem; + color: $archicon; +} + +.pkgs-icon { + font-family: Material Design Icons Desktop; + font-size: .8rem; + color: $yellow; +} + +.wm-icon { + font-family: Material Design Icons Desktop; + font-size: .8rem; + color: $magenta; +} + +.os-text, +.pkgs-text, +.wm-text { + font-family: Inconsolata SemiCondensed Medium; + font-weight: Bold; + font-size: 1rem; +} + +.weatherbox { + background-color: $bg-alt; + border-radius: 0.5rem; + padding: .8rem; +} + +.weathericon { + padding: 0 .8rem; + border-radius: 0.5rem; + margin-left: .6rem; + background-color: $bg-alt; + font-size: 1.5rem; + font-family: "Font Awesome 6 Free Solid"; +} + +.weatherdesc { + font-size: 1.75rem; + font-family: "Inconsolata SemiCondensed Medium"; + font-weight: Bold; +} + +.weathertemp { + font-family: "Iosevka Nerd Font"; + font-size: 1.5rem; + font-weight: bold; + color: $fg; +} + +.weathercity { + font-size: .9rem; + margin-top: .2rem; + color: $fg; + font-family: Inconsolata SemiCondensed Medium; + font-weight: Bold; +} + +.launcher-apps { + background-color: $bg-alt; + padding: .8rem; + border-radius: 0.5rem; +} + +.launcher-btn { + color: $black; + font-family: Material Design Icons Desktop; + font-size: 1.5rem; +} + +.launcher-btn:hover { + color: $fg; + font-family: Material Design Icons Desktop; + font-size: 1.5rem; + text-shadow: 0 0 0.2rem $fg; +} + + + .progress { + background-color: $bg-alt; + padding: .7rem .7rem; + border-radius: 1rem; + + circular-progress { + background-color: $black; + + &.ram { + color: $blue; + } + + &.cpu { + color: $green; + } + + &.temp { + color: $red; + } + + &.disk { + color: $magenta; + } + } + + + .icon { + font-family: "Font Awesome 6 Free Solid"; + font-size: 1rem; + padding: 1.1rem; + } + + } diff --git a/config/bspwm/eww/profilecard/profilecard.yuck b/config/bspwm/eww/profilecard/profilecard.yuck new file mode 100644 index 0000000..bcfffa3 --- /dev/null +++ b/config/bspwm/eww/profilecard/profilecard.yuck @@ -0,0 +1,290 @@ +;; Vars ;; + +(defpoll completeday :interval "1s" "date '+%A, %d %B'") + + +(defvar IMAGEP "../assets/profile.png") + +(defpoll username :interval "24h" "whoami") +(defpoll hostname :interval "24h" "cat /etc/hostname") +(defpoll uptime :interval "30s" "uptime -p | sed -E -e 's/hour(s)?/hrs/g' -e 's/minute(s)?/min/g'") + +(defpoll updates :interval "2m" "Updates --get-updates") +(defpoll packages :interval "1h" "pacman -Q | wc -l") + +(defpoll weathericon :interval "15m" "Weather icon") +(defpoll weathercity :interval "15m" "Weather city") +(defpoll weathertemp :interval "15m" "Weather current_temp") +(defpoll weatherdesc :interval "15m" "Weather weather_desc") +(defpoll weatherhex :interval "15m" "Weather hex") + +(defpoll temp :interval "5s" "../scripts/temp.sh") + +;; Widegets ;; + +(defwidget launchermenu [] + (box :class "launchermenu" + :orientation "v" + :space-evenly "false" + :spacing 7 + (time) + (pfp) + (iuse) + (infoarch) + (weather) + ;;(sysinfo) + (system) + (apps))) + +(defwidget divider [] + (box :class "divider" + :orientation "v" + :space-evenly true) +) + +(defwidget time [] + (box :class "timebox" + :orientation "v" + :space-evenly false + (box :class "time-container" + :orientation "h" + :space-evenly false + :halign "center" + :valign "center" + (label :text "${formattime(EWW_TIME, "%H")}" :class "content") + (divider) + (label :text "${formattime(EWW_TIME, "%M")}" :class "content") + ) + (box :class "date-container" + :orientation "h" + :space-evenly true + :halign "center" + (label :text "${completeday}") + ) + ) +) + +(defwidget pfp [] + (box :orientation "h" + :space-evenly "false" + :class "usercard" + (box :space-evenly "false" + :hexpand true + :orientation "h" + :spacing "15" + (box :style "background-image: url('${IMAGEP}');" + :class "face" + :halign "center") + (box :orientation "v" + :space-evenly "false" + :hexpand true + :valign "center" + (box :class "user-host" + :halign "start" + (label :text username)) + (box :class "host" + :halign "start" + (label :text "@${hostname}")) + (box :class "uptime" + :halign "start" + (label :text uptime))) + (box :orientation "v" + :space-evenly "false" + :spacing 10 + :valign "center" + :halign "start" + :hexpand false + ;;:style "border: 1px solid #ffffff;" + (eventbox :cursor "pointer" + (button :class "btn-info" :tooltip "Lock Computer" :onclick "physlock -d" "󱅞")) + (eventbox :cursor "pointer" + (button :class "btn-info" :tooltip "Logout BSPWM" :onclick "bspc quit" "󰍃"))) + ) + ) +) +(defwidget iuse [] + (box :orientation "v" + :space-evenly "false" + :class "usearch" + :hexpand true + (label :class "launcher-pfp-label" + :xalign 0.5 + :limit-width 30 + :text "I use Arch btw.."))) + +(defwidget infoarch [] + (box :orientation "h" + :space-evenly "false" + :spacing 7 + (box :orientation "v" + :class "pacman" + :hexpand true + (label :halign "start" + :class "pacman-icon" + :text "󰮯") + (box :space-evenly "false" + (eventbox :cursor "pointer" + (button :class "pacman-updates" + :halign "start" + :tooltip "Click to update" + :onclick "OpenApps --update" "${updates} Updates")))) + (box :orientation "h" + :space-evenly "false" + :class "fetch" + :spacing 8 + (label :class "arch-icon" + :halign "start" + :text "󰣇") + (box + :space-evenly "false" + (box :orientation "v" + :spacing 3 + :halign "end" + :style "margin-left: 10px;" + (label :class "os-icon" + :halign "start" + :text "󰣇") + (label :class "pkgs-icon" + :halign "start" + :text "󰮯") + (label :class "wm-icon" + :halign "start" + :text "󱪳"))) + (box + :space-evenly "false" + (box :orientation "v" + :spacing 3 + :halign "start" + (label :class "os-text" + :halign "start" + :text "Arch") + (label :class "pkgs-text" + :halign "start" + :text packages) + (label :class "wm-text" + :halign "start" + :text "Bspwm")))))) + +(defwidget weather[] + (box :orientation "h" :class "weatherboxfull" :space-evenly false + (box :orientation "v" :class "weatherbox" :hexpand true :space-evenly false + (box :orientation "h" :class "weathertop" :space-evenly false + (box :class "weatherdesc" :style "color: ${weatherhex};" :halign "start" :hexpand true weatherdesc) + (box :class "weathertemp" :halign "end" "${weathertemp}°C") + ) + (box :orientation "v" :class "weatherbot" :space-evenly false + (box :class "weathercity" :halign "start" :hexpand true + (label :limit-width 22 :text weathercity)) + ) + ) + (box :class "weathericon" :style "color: ${weatherhex};" :halign "center" weathericon) + ) +) + +(defwidget system_progress [data icon css tip] + (box + :class "progress" + (circular-progress + :class css + :value data + :thickness 6 + :tooltip tip + (overlay + :valign "center" + (label + :class "icon" + :text icon + ) + ) + ) + ) +) + +(defwidget cpu [] + (system_progress + :css "cpu" + :tip "CPU ${round(EWW_CPU.avg,0)}%" + :data {round(EWW_CPU.avg, 0)} + :icon "" + ) +) + +(defwidget ram [] + (system_progress + :css "ram" + :tip "RAM ${round(EWW_RAM.used_mem / 1048576, 2)}MB" + :data {round(EWW_RAM.used_mem_perc, 0)} + :icon "" + ) +) + +(defwidget disk [] + (system_progress + :css "disk" + :tip "SSD ${round(EWW_DISK["/"].used_perc, 2)}%" + :data {round(EWW_DISK["/"].used_perc, 0)} + :icon "" + ) +) + +(defwidget temp [] + (system_progress + :css "temp" + :tip "Cpu temperature ${temp}°C" + :data temp + :icon "" + ) +) + +(defwidget system [] + (box + :class "system" + :spacing 8 + (cpu) + (ram) + (disk) + (temp) + ) +) + +(defwidget apps [] + (box :orientation "v" + :space-evenly "false" + :class "launcher-apps" + (box :orientation "h" + :space-evenly "false" + :hexpand true + :halign "center" + :spacing 12 + (eventbox :cursor "pointer" + (button :class "launcher-btn" + :onclick "OpenApps --browser" + :tooltip "Browser" + "󰇧")) + (eventbox :cursor "pointer" + (button :class "launcher-btn" + :onclick "OpenApps --fetch" + :tooltip "System Fetch" + "󰚌")) + (eventbox :cursor "pointer" + (button :class "launcher-btn" + :onclick "cd && OpenApps --filemanager" + :tooltip "File Manager" + "󰝰")) + (eventbox :cursor "pointer" + (button :class "launcher-btn" + :onclick "cd && OpenApps --terminal" + :tooltip "Terminal" + "󰆍")) + (eventbox :cursor "pointer" + (button :class "launcher-btn" + :onclick "OpenApps --editor" + :tooltip "Editor" + "󰷈"))))) + +;; Windows ;; + +(defwindow launchermenu + :geometry (geometry :x "500px" :y "-219px" :anchor "left center") + :wm-ignore false + (launchermenu)) diff --git a/config/bspwm/jgmenurc b/config/bspwm/jgmenurc new file mode 100644 index 0000000..f68ee6e --- /dev/null +++ b/config/bspwm/jgmenurc @@ -0,0 +1,31 @@ +position_mode = pointer +stay_alive = 0 +tint2_look = 0 +terminal_exec = alacritty +terminal_args = -e +menu_width = 160 +menu_padding_top = 5 +menu_padding_right = 5 +menu_padding_bottom = 5 +menu_padding_left = 5 +menu_radius = 8 +menu_border = 0 +menu_halign = left +sub_hover_action = 1 +item_margin_y = 5 +item_height = 30 +item_padding_x = 8 +item_radius = 6 +item_border = 0 +sep_height = 2 +font = Clarity City Bold 12px +icon_size = 16 +icon_theme = Papirus-Dark +arrow_string = 󰄾 +color_menu_border = #ffffff 0 +color_menu_bg = #0E1113 +color_norm_bg = #ffffff 0 +color_norm_fg = #afb1db +color_sel_bg = #111517 +color_sel_fg = #afb1db +color_sep_fg = #373542 diff --git a/config/bspwm/karla/Theme.sh b/config/bspwm/karla/Theme.sh index 31c554a..9423675 100755 --- a/config/bspwm/karla/Theme.sh +++ b/config/bspwm/karla/Theme.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash # ██╗ ██╗ █████╗ ██████╗ ██╗ █████╗ ██████╗ ██╗ ██████╗███████╗ # ██║ ██╔╝██╔══██╗██╔══██╗██║ ██╔══██╗ ██╔══██╗██║██╔════╝██╔════╝ -# █████╔╝ ███████║██████╔╝██║ ███████║ ██████╔╝██║██║ █████╗ -# ██╔═██╗ ██╔══██║██╔══██╗██║ ██╔══██║ ██╔══██╗██║██║ ██╔══╝ +# █████╔╝ ███████║██████╔╝██║ ███████║ ██████╔╝██║██║ █████╗ +# ██╔═██╗ ██╔══██║██╔══██╗██║ ██╔══██║ ██╔══██╗██║██║ ██╔══╝ # ██║ ██╗██║ ██║██║ ██║███████╗██║ ██║ ██║ ██║██║╚██████╗███████╗ # ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝ # Author : z0mbi3 @@ -12,71 +12,113 @@ # Set bspwm configuration for Karla set_bspwm_config() { - bspc config border_width 3 - bspc config top_padding 48 - bspc config bottom_padding 2 - bspc config normal_border_color "#21222c" - bspc config active_border_color "#353c52" - bspc config focused_border_color "#353c52" - bspc config presel_feedback_color "#ff79c6" - bspc config left_padding 2 - bspc config right_padding 2 - bspc config window_gap 6 + bspc config border_width 3 + bspc config top_padding 48 + bspc config bottom_padding 2 + bspc config left_padding 2 + bspc config right_padding 2 + bspc config normal_border_color "#21222c" + bspc config active_border_color "#353c52" + bspc config focused_border_color "#353c52" + bspc config presel_feedback_color "#8656e3" } # Reload terminal colors set_term_config() { - sed -i "$HOME"/.config/alacritty/fonts.yml \ + sed -i "$HOME"/.config/alacritty/fonts.yml \ -e "s/family: .*/family: JetBrainsMono Nerd Font/g" \ - -e "s/size: .*/size: 6/g" + -e "s/size: .*/size: 10/g" - sed -i "$HOME"/.config/alacritty/rice-colors.yml \ + sed -i "$HOME"/.config/alacritty/rice-colors.yml \ -e "s/colors: .*/colors: *karla_z0mbi3_night/" } # Set compositor configuration set_picom_config() { - sed -i "$HOME"/.config/bspwm/picom.conf \ - -e "s/normal = .*/normal = { fade = false; shadow = false; }/g" \ - -e "s/shadow-color = .*/shadow-color = \"#000000\"/g" \ - -e "s/corner-radius = .*/corner-radius = 0/g" \ - -e "s/\".*:class_g = 'Alacritty'\"/\"95:class_g = 'Alacritty'\"/g" \ - -e "s/\".*:class_g = 'FloaTerm'\"/\"95:class_g = 'FloaTerm'\"/g" + sed -i "$HOME"/.config/bspwm/picom.conf \ + -e "s/normal = .*/normal = { fade = false; shadow = false; }/g" \ + -e "s/shadow-color = .*/shadow-color = \"#000000\"/g" \ + -e "s/corner-radius = .*/corner-radius = 0/g" \ + -e "s/\".*:class_g = 'Alacritty'\"/\"95:class_g = 'Alacritty'\"/g" \ + -e "s/\".*:class_g = 'FloaTerm'\"/\"95:class_g = 'FloaTerm'\"/g" +} + +# Set stalonetray config +set_stalonetray_config() { + sed -i "$HOME"/.config/bspwm/stalonetrayrc \ + -e "s/background .*/background \"#0E1113\"/" \ + -e "s/vertical .*/vertical true/" \ + -e "s/geometry .*/geometry 1x1-50+46/" \ + -e "s/grow_gravity .*/grow_gravity NE/" \ + -e "s/icon_gravity .*/icon_gravity NE/" } # Set dunst notification daemon config set_dunst_config() { - sed -i "$HOME"/.config/bspwm/dunstrc \ + sed -i "$HOME"/.config/bspwm/dunstrc \ -e "s/transparency = .*/transparency = 8/g" \ -e "s/frame_color = .*/frame_color = \"#0E1113\"/g" \ -e "s/separator_color = .*/separator_color = \"#353c52\"/g" \ -e "s/font = .*/font = JetBrainsMono Nerd Font Medium 9/g" \ -e "s/foreground='.*'/foreground='#7a44e3'/g" - sed -i '/urgency_low/Q' "$HOME"/.config/bspwm/dunstrc - cat >> "$HOME"/.config/bspwm/dunstrc <<- _EOF_ - [urgency_low] - timeout = 3 - background = "#0E1113" - foreground = "#afb1db" + sed -i '/urgency_low/Q' "$HOME"/.config/bspwm/dunstrc + cat >> "$HOME"/.config/bspwm/dunstrc <<- _EOF_ + [urgency_low] + timeout = 3 + background = "#0E1113" + foreground = "#afb1db" - [urgency_normal] - timeout = 6 - background = "#0E1113" - foreground = "#afb1db" + [urgency_normal] + timeout = 6 + background = "#0E1113" + foreground = "#afb1db" - [urgency_critical] - timeout = 0 - background = "#0E1113" - foreground = "#afb1db" + [urgency_critical] + timeout = 0 + background = "#0E1113" + foreground = "#afb1db" _EOF_ } +# Set eww colors +set_eww_colors() { + cat > "$HOME"/.config/bspwm/eww/colors.scss << EOF +// Eww colors for Karla rice +\$bg: #0E1113; +\$bg-alt: #111517; +\$fg: #afb1db; +\$black: #373542; +\$lightblack: #262831; +\$red: #e7034a; +\$blue: #5884d4; +\$cyan: #7df0f0; +\$magenta: #7a44e3; +\$green: #61b33e; +\$yellow: #ffb964; +\$archicon: #0f94d2; +EOF +} + +# Set jgmenu colors for Karla +set_jgmenu_colors() { + sed -i "$HOME"/.config/bspwm/jgmenurc \ + -e 's/color_menu_bg = .*/color_menu_bg = #0E1113/' \ + -e 's/color_norm_fg = .*/color_norm_fg = #afb1db/' \ + -e 's/color_sel_bg = .*/color_sel_bg = #111517/' \ + -e 's/color_sel_fg = .*/color_sel_fg = #afb1db/' \ + -e 's/color_sep_fg = .*/color_sep_fg = #373542/' +} + # Launch the bar launch_bars() { - polybar -q karla-bar -c ${rice_dir}/config.ini & - polybar -q karla-bar2 -c ${rice_dir}/config.ini & - polybar -q karla-bar3 -c ${rice_dir}/config.ini & + + for mon in $(polybar --list-monitors | cut -d":" -f1); do + (MONITOR=$mon polybar -q karla-bar -c ${rice_dir}/config.ini)& + (MONITOR=$mon polybar -q karla-bar2 -c ${rice_dir}/config.ini)& + (MONITOR=$mon polybar -q karla-bar3 -c ${rice_dir}/config.ini)& + done + } @@ -86,5 +128,8 @@ launch_bars() { set_bspwm_config set_term_config set_picom_config -set_dunst_config +set_stalonetray_config launch_bars +set_dunst_config +set_eww_colors +set_jgmenu_colors diff --git a/config/bspwm/karla/config.ini b/config/bspwm/karla/config.ini index d3044f7..7e516b3 100644 --- a/config/bspwm/karla/config.ini +++ b/config/bspwm/karla/config.ini @@ -15,11 +15,9 @@ include-file = ~/.config/bspwm/scripts/colors.ini include-file = modules.ini [bar/karla-bar] - +monitor = ${env:MONITOR:} monitor-strict = false - override-redirect = false - bottom = false fixed-center = true @@ -54,10 +52,9 @@ font-2 = "Font Awesome 6 Free Solid:size=10;2" ;dpi = 96 modules-left = launcher -modules-center = cpu memory filesystem +modules-center = cpu sep memory sep filesystem sep usercard modules-right = weather -separator = " | " dim-value = 1.0 ;;locale = es_MX.UTF-8 @@ -68,9 +65,8 @@ cursor-click = pointer cursor-scroll = [bar/karla-bar2] - +monitor = ${env:MONITOR:} monitor-strict = false - override-redirect = false bottom = false @@ -93,7 +89,7 @@ line-color = ${karla.blue} border-size = 2 border-color = ${karla.bc} -padding = 3 +padding = 2 module-margin-left = 0 module-margin-right = 0 @@ -104,24 +100,26 @@ font-0 = "JetBrainsMono:style=Bold:size=9;2" font-1 = "Font Awesome 6 Free Solid:size=10;3" ;dpi = 96 -modules-left = mpd_control -modules-center = brightness battery network pulseaudio updates -modules-right = date +;; Available modules +;; brightness +modules-left = mpd_control sep mplayer +modules-center = battery sep network sep pulseaudio sep updates +modules-right = date systray power -separator = " | " +separator = dim-value = 1.0 ;;locale = es_MX.UTF-8 -tray-position = right -tray-detached = false -tray-maxsize = 16 -tray-background = ${karla.bg} -tray-offset-x = 0 -tray-offset-y = 0 -tray-padding = 0 -tray-scale = 1.0 +;;tray-position = right +;;tray-detached = false +;;tray-maxsize = 16 +;;tray-background = ${karla.bg} +;;tray-offset-x = 0 +;;tray-offset-y = 0 +;;tray-padding = 0 +;;tray-scale = 1.0 wm-restack = bspwm enable-ipc = true @@ -130,9 +128,8 @@ cursor-click = pointer cursor-scroll = [bar/karla-bar3] - +monitor = ${env:MONITOR:} monitor-strict = false - override-redirect = false bottom = false @@ -161,7 +158,7 @@ module-margin-left = 0 module-margin-right = 0 ; Text -font-0 = "JetBrainsMono:style=Bold:size=9;2" +font-0 = "Inconsolata Semi Condensed Extra Bold:size=10;1" ; Icons font-1 = "Material Design Icons Desktop:size=13;3" ;dpi = 96 @@ -170,7 +167,7 @@ modules-left = modules-center = bspwm modules-right = -separator = "" +separator = dim-value = 1.0 ;;locale = es_MX.UTF-8 diff --git a/config/bspwm/karla/modules.ini b/config/bspwm/karla/modules.ini index d062738..25302f8 100644 --- a/config/bspwm/karla/modules.ini +++ b/config/bspwm/karla/modules.ini @@ -15,9 +15,9 @@ time = %I:%M %P date-alt = " %a, %d %b %y" format =