Added wallpaper selector
This commit is contained in:
parent
f3769e5cb2
commit
cfadd69475
@ -14,7 +14,7 @@ detect-transient = true;
|
||||
glx-no-stencil = true;
|
||||
use-damage = true;
|
||||
|
||||
log-level = "warn";
|
||||
log-level = "error";
|
||||
|
||||
wintypes:
|
||||
{
|
||||
|
106
config/rofi/wallselector.rasi
Normal file
106
config/rofi/wallselector.rasi
Normal file
@ -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;
|
||||
}
|
@ -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
|
||||
|
44
misc/bin/wallselector
Normal file
44
misc/bin/wallselector
Normal file
@ -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
|
8
setup.sh
8
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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user