From ea025189531fdd9c1bba4069b7acee92408aaeea Mon Sep 17 00:00:00 2001 From: ambertia <95402631+ambertia@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:11:09 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Completed=20rofi=20theme=20switcher?= =?UTF-8?q?=20menu,=20general=20rofi=20theming=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/hypr/hyprland.conf | 2 +- .config/rofi/imagepicker.rasi | 43 +++++ .config/wal/templates/colors-rofi-dark.rasi | 168 ++++++++++++++++++++ .scripts/themeSwitcher.sh | 14 +- .scripts/wallpaper-launcher.sh | 2 + 5 files changed, 224 insertions(+), 5 deletions(-) create mode 100644 .config/rofi/imagepicker.rasi create mode 100644 .config/wal/templates/colors-rofi-dark.rasi create mode 100755 .scripts/wallpaper-launcher.sh diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 9a76386..2da930a 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -202,7 +202,7 @@ bind = $mainMod, N, exec, wlogout # Launch logout menu bind = $mainMod, P, exec, hyprpicker --autocopy --format=hex # Open color picker bind = $mainMod SHIFT, E, exec, rofimoji # Emoji picker bind = $mainMod, F, fullscreen, 0 # Toggle fullscreen for the active window -bind = $mainMod, T, exec, rofi -show file-browser-extended -file-browser-dir ~/.backgrounds/ -file-browser-cmd ~/.scripts/themeSwitcher.sh +bind = $mainMod, T, exec, ~/.scripts/themeSwitcher.sh bind = $mainMod, M, exec, qalculate-gtk # M for Math - replace old kill hyprland bind with bind to open my preferred calculator application # TODO nChain options - eventually # bind = $mainMod, grave, hyprexpo:expo, toggle # Bind for hyprexpo plugin diff --git a/.config/rofi/imagepicker.rasi b/.config/rofi/imagepicker.rasi new file mode 100644 index 0000000..9eba0c1 --- /dev/null +++ b/.config/rofi/imagepicker.rasi @@ -0,0 +1,43 @@ +configuration { + modi: "dmenu"; + show-icons: true; +} + +@theme "~/.cache/wal/colors-rofi-dark.rasi" + +* { + background: transparent; +} + +window { + width: 700px; +} + +listview { + columns: 3; + scrollbar: true; + spacing: 10px; + padding: 10px; + dynamic: true; + fixed-height: true; + lines: 3; +} + +inputbar { + children: [ "prompt", "entry" ]; +} + +element { + orientation: vertical; + padding: 5px; +} + +element-icon { + size: 10em; + margin: -30px 0; +} + +element-text { + vertical-align: 0.5; + horizontal-align: 0.5; +} diff --git a/.config/wal/templates/colors-rofi-dark.rasi b/.config/wal/templates/colors-rofi-dark.rasi new file mode 100644 index 0000000..6d9f80c --- /dev/null +++ b/.config/wal/templates/colors-rofi-dark.rasi @@ -0,0 +1,168 @@ +* {{ + active-background: {color2}80; + active-foreground: @foreground; + normal-background: {background}80; + normal-foreground: @foreground; + urgent-background: {color1}80; + urgent-foreground: @foreground; + + alternate-active-background: @background; + alternate-active-foreground: @foreground; + alternate-normal-background: @background; + alternate-normal-foreground: @foreground; + alternate-urgent-background: @background; + alternate-urgent-foreground: @foreground; + + selected-active-background: {color1}80; + selected-active-foreground: @foreground; + selected-normal-background: {color2}80; + selected-normal-foreground: @foreground; + selected-urgent-background: {color3}80; + selected-urgent-foreground: @foreground; + + background-color: @background; + background: {background}; + foreground: {foreground}; + border-color: @background; + spacing: 2; +}} + +#window {{ + background-color: {background}80; + border: 0; + border-radius: 10px; + padding: 2.5ch; +}} + +#mainbox {{ + border: 0; + padding: 0; +}} + +#message {{ + border: 2px 0px 0px; + border-color: @border-color; + padding: 1px; +}} + +#textbox {{ + text-color: @foreground; +}} + +#inputbar {{ + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +}} + +#textbox-prompt-colon {{ + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +}} + +#listview {{ + fixed-height: 0; + border: 2px 0px 0px; + border-color: @border-color; + spacing: 2px; + scrollbar: true; + padding: 2px 0px 0px; +}} + +#element {{ + border: 0; + border-radius: 10px; + padding: 1px; +}} + +#element-text, element-icon {{ + background-color: transparent; + text-color: inherit; +}} + +#element.normal.normal {{ + background-color: @normal-background; + text-color: @normal-foreground; +}} + +#element.normal.urgent {{ + background-color: @urgent-background; + text-color: @urgent-foreground; +}} + +#element.normal.active {{ + background-color: @active-background; + text-color: @active-foreground; +}} + +#element.selected.normal {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#element.selected.urgent {{ + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +}} + +#element.selected.active {{ + background-color: @selected-active-background; + text-color: @selected-active-foreground; +}} + +#element.alternate.normal {{ + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +}} + +#element.alternate.urgent {{ + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +}} + +#element.alternate.active {{ + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +}} + +#scrollbar {{ + width: 4px; + border: 0; + handle-width: 8px; + padding: 0; +}} + +#sidebar {{ + border: 2px 0px 0px; + border-color: @border-color; +}} + +#button {{ + text-color: @normal-foreground; +}} + +#button.selected {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#inputbar {{ + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +}} + +#case-indicator {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#entry {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#prompt {{ + spacing: 0; + text-color: @normal-foreground; +}} diff --git a/.scripts/themeSwitcher.sh b/.scripts/themeSwitcher.sh index c2e001b..d68b234 100755 --- a/.scripts/themeSwitcher.sh +++ b/.scripts/themeSwitcher.sh @@ -1,7 +1,12 @@ #!/bin/bash -BACKGROUND_PATH=${1} -echo $BACKGROUND_PATH +local BACKGROUND_PATH +FILE_NAME=$($HOME/.scripts/wallpaper-launcher.sh) +RETURN_STATUS=$? +BACKGROUND_PATH="${HOME}/.backgrounds/${FILE_NAME}" +if [ $RETURN_STATUS -eq 1 ]; then + exit +fi # Update current-wallpaper cp $BACKGROUND_PATH $HOME/.backgrounds/current-wallpaper @@ -15,8 +20,9 @@ gradience-cli import -p ~/.cache/wal/pywal.json gradience-cli apply -n pywal # Run script to apply pywal theme to Mako notifications ~/.scripts/update-mako-theme.sh -# Send a notification -notify-send "Theme updated" # Prevent duplicate waybar instances from modifications to hyprland.conf colors +sleep 2 killall waybar && killall cava && waybar & +# Send a notification +notify-send "Theme updated" diff --git a/.scripts/wallpaper-launcher.sh b/.scripts/wallpaper-launcher.sh new file mode 100755 index 0000000..f0794d3 --- /dev/null +++ b/.scripts/wallpaper-launcher.sh @@ -0,0 +1,2 @@ +#!/bin/bash +find "${HOME}/.backgrounds/" -maxdepth 1 -type f \( -iname "*.png" \) -exec basename {} \; | sort | while read -r A; do echo -en "$A\x00icon\x1f"".backgrounds/$A\n" ; done | rofi -dmenu -p "~/.backgrounds/" -config ${HOME}/.config/rofi/imagepicker.rasi