diff --git a/config/picom/picom.conf b/config/picom/picom.conf index 99260d7..6b97e70 100644 --- a/config/picom/picom.conf +++ b/config/picom/picom.conf @@ -14,7 +14,7 @@ detect-transient = true; glx-no-stencil = true; use-damage = true; -log-level = "warn"; +log-level = "error"; wintypes: { diff --git a/config/rofi/wallselector.rasi b/config/rofi/wallselector.rasi new file mode 100644 index 0000000..718ead4 --- /dev/null +++ b/config/rofi/wallselector.rasi @@ -0,0 +1,106 @@ +// Originally created by - https://github.com/gh0stzk + +configuration { + modi: "drun"; + show-icons: true; + drun-display-format: "{name}"; + font: "JetBrainsMono NF Bold 11"; + + //hover-select: true; + //me-select-entry: ""; + //me-accept-entry: "MousePrimary"; +} + +//----- Global Properties -----// + +* { +main-bg: #1f2329E6; +main-fg: #b8bfe5; +select-bg: #3f5273; +select-fg: #1f2329; +} + +//----- Main Window -----// + +window { + enabled: true; + fullscreen: false; + width: 100%; + transparency: "real"; + cursor: "default"; + spacing: 0px; + padding: 0px; + border: 0px; + border-radius: 0px; + border-color: transparent; + background-color: transparent; +} + +//----- Main Box -----// + +mainbox { + enabled: true; + children: [ "listview" ]; + background-color: @main-bg; +} + +//----- Listview -----// + +listview { + enabled: true; + columns: 6; + lines: 1; + spacing: 50px; + padding: 20px 30px; + cycle: true; + dynamic: false; + scrollbar: false; + layout: vertical; + reverse: true; + fixed-height: true; + fixed-columns: true; + cursor: "default"; + background-color: transparent; + text-color: @main-fg; +} + +//----- Elements -----// + +element { + enabled: true; + orientation: horizontal; + spacing: 0px; + padding: 0px; + border-radius: 20px; + cursor: pointer; + background-color: transparent; + text-color: @main-fg; +} + +@media(max-aspect-ratio: 1.8) { + element { + orientation: vertical; + } +} + +element selected.normal { + background-color: @select-bg; + text-color: @select-fg; +} + +element-icon { + size: 33%; + cursor: inherit; + border-radius: 0px; + background-color: transparent; + text-color: inherit; +} + +element-text { + vertical-align: 0.5; + horizontal-align: 0.5; + padding: 20px; + cursor: inherit; + background-color: transparent; + text-color: inherit; +} \ No newline at end of file diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index 4d7552d..70baf39 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -49,7 +49,7 @@ ctrl + alt + {plus,minus,t} # Random wallpaper super + alt + w - feh -z --no-fehbg --bg-fill ~/pics/wallpapers/ + wallselector # Screenshot Now Print diff --git a/misc/bin/wallselector b/misc/bin/wallselector new file mode 100644 index 0000000..37a3935 --- /dev/null +++ b/misc/bin/wallselector @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Originally created by - https://github.com/gh0stzk + +# Check if xdpyinfo and imagemagick are installed +if ! command -v xdpyinfo > /dev/null 2>&1; then + dunstify "Missing package" "Please install the xorg-xdpyinfo package to continue" -u critical + exit 1 +elif ! command -v convert > /dev/null 2>&1; then + dunstify "Missing package" "Please install the imagemagick package to continue" -u critical + exit 1 +fi + +# Set some variables +wall_dir="${HOME}/pics/wallpapers" +cacheDir="${HOME}/.cache/wallselector" +rofi_command="rofi -dmenu -theme ${HOME}/.config/rofi/wallselector.rasi -theme-str ${rofi_override}" + +monitor_res=$(xdpyinfo | grep dimensions | awk '{print $2}' | cut -d 'x' -f1) +monitor_scale=$(xdpyinfo | grep -oP "resolution:.*" | awk '{print $2}' | cut -d 'x' -f1) +monitor_res=$(( monitor_res * 17 / monitor_scale )) +rofi_override="element-icon{size:${monitor_res}px;border-radius:0px;}" + +# Create cache dir if not exists +if [ ! -d "${cacheDir}" ] ; then + mkdir -p "${cacheDir}" + fi + +# Convert images in directory and save to cache dir +for image in "$wall_dir"/*.{jpg,jpeg,png,webp}; do + if [ -f "$image" ]; then + nombre_archivo=$(basename "$image") + if [ ! -f "${cacheDir}/${file-name}" ] ; then + convert -strip "$image" -thumbnail 500x500^ -gravity center -extent 500x500 "${cacheDir}/${file-name}" + fi + fi +done + +# Launch rofi +wall_selection=$(find "${wall_dir}" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) -exec basename {} \; | sort | while read -r A ; do echo -en "$A\x00icon\x1f""${cacheDir}"/"$A\n" ; done | $rofi_command) + +# Set wallpaper +[[ -n "$wall_selection" ]] || exit 1 +feh --no-fehbg --bg-fill "${wall_dir}"/"${wall_selection}" +exit 0 \ No newline at end of file diff --git a/setup.sh b/setup.sh index 7a70f67..7daca62 100644 --- a/setup.sh +++ b/setup.sh @@ -52,13 +52,13 @@ clear logo "Installing needed packages.." -dependencies=(alacritty base-devel brightnessctl bspwm dunst feh git jgmenu \ +dependencies=(alacritty base-devel brightnessctl bspwm dunst feh git imagemagick jgmenu \ jq libnotify libwebp lsd maim mpc mpd ncmpcpp neofetch neovim \ pacman-contrib pamixer papirus-icon-theme physlock picom playerctl \ - polkit-gnome polybar ranger rofi rustup sxhkd \ - ttf-inconsolata ttf-jetbrains-mono ttf-jetbrains-mono-nerd ttf-joypixels \ + polkit-gnome polybar ranger rofi rustup sxhkd \ + ttf-inconsolata ttf-jetbrains-mono ttf-jetbrains-mono-nerd ttf-joypixels \ ttf-terminus-nerd ueberzug webp-pixbuf-loader xclip xdg-user-dirs xdo xdotool \ - xorg-xkill xorg-xprop xorg-xrandr xorg-xsetroot xorg-xwininfo \ + xorg-xdpyinfo xorg-xkill xorg-xprop xorg-xrandr xorg-xsetroot xorg-xwininfo \ zsh zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting) is_installed() {