Skip to content

Commit

Permalink
✨ Completed rofi theme switcher menu, general rofi theming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ambertia committed Dec 31, 2024
1 parent f67f01a commit ea02518
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .config/hypr/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions .config/rofi/imagepicker.rasi
Original file line number Diff line number Diff line change
@@ -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;
}
168 changes: 168 additions & 0 deletions .config/wal/templates/colors-rofi-dark.rasi
Original file line number Diff line number Diff line change
@@ -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;
}}
14 changes: 10 additions & 4 deletions .scripts/themeSwitcher.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"

2 changes: 2 additions & 0 deletions .scripts/wallpaper-launcher.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ea02518

Please sign in to comment.