From f13af3b019a5931676a8b479b6c63602d55a5d06 Mon Sep 17 00:00:00 2001 From: kokopi-dev Date: Sun, 7 Dec 2025 14:09:54 +0900 Subject: [PATCH] update:custom rofi images --- mango/bash_profile | 10 ---- mango/bashrc | 55 ------------------- .../config-manager/rofi-config-manager.sh | 24 +++++++- mango/rofi/help-manager/rofi-help-manager.sh | 9 ++- .../settings-manager/rofi-settings-manager.sh | 4 +- 5 files changed, 34 insertions(+), 68 deletions(-) delete mode 100644 mango/bash_profile delete mode 100644 mango/bashrc diff --git a/mango/bash_profile b/mango/bash_profile deleted file mode 100644 index b72a316..0000000 --- a/mango/bash_profile +++ /dev/null @@ -1,10 +0,0 @@ -# -# ~/.bash_profile -# - -[[ -f ~/.bashrc ]] && . ~/.bashrc - -if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then - exec mango -fi - diff --git a/mango/bashrc b/mango/bashrc deleted file mode 100644 index a7fe8dc..0000000 --- a/mango/bashrc +++ /dev/null @@ -1,55 +0,0 @@ -# -# ~/.bashrc -# - -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -alias ls='ls --color=auto' -alias grep='grep --color=auto' -PS1='[\u@\h \W]\$ ' -alias ll="ls -l" -alias v="nvim" -alias ..="cd .." -alias ux='chmod u+x' -alias mkdir='mkdir -p' - -alias ziptar="tar -zcvf" -alias unziptar="tar -xvzf" - -alias gadd='git add' -alias gdiff='git diff' -alias mpush='git push origin master' -alias gstat='git status' -function gcom() { - GITMESSAGE="$*" - git commit -m "$GITMESSAGE" -} - -alias ll='exa -lg --icons' -alias lll='exa -lga' -alias cat='bat --style=header,grid' - -export PATH="$PATH:$HOME/.local/bin" -export PATH="$PATH:$HOME/go/bin" - -eval "$(fnm env --use-on-cd)" - -eval "$(starship init bash)" -pass() { - (cd /home/kokopi/kp/syncpass && bash /home/kokopi/kp/syncpass/syncpass "$@") -} -export PASSWORD_STORE_EXTENSION_COMMANDS=("c") -__password_store_extension_complete_c() { - COMPREPLY+=($(compgen -W "-o --option" -- ${cur})) - _pass_complete_entries 1 -} - -export GTK_THEME=tokyonight-dark - -bind 'TAB:menu-complete' -bind 'set show-all-if-ambiguous on' - -eval "$(fzf --bash)" -export FZF_CTRL_T_COMMAND="fd --type f --type d --hidden --follow --exclude .git --exclude venv --exclude node_modules --exclude .cache --exclude cache --exclude __pycache__ --exclude pkg --exclude .vim --exclude .themes --exclude .cargo --exclude .config/discord --exclude .npm --exclude .mozilla --exclude .rustup --search-path ." - diff --git a/mango/rofi/config-manager/rofi-config-manager.sh b/mango/rofi/config-manager/rofi-config-manager.sh index 2ba79f0..91942e5 100755 --- a/mango/rofi/config-manager/rofi-config-manager.sh +++ b/mango/rofi/config-manager/rofi-config-manager.sh @@ -2,6 +2,19 @@ # ln -s ~/.config/rofi/config-manager/rofi-config-manager.sh ~/.local/bin/rofi-config-manager.sh THEME_FILE=~/.config/rofi/config-manager/config-manager.rasi +post_rofi() { + local image_dir="$HOME/.config/rofi/images/sg" + local current_image=$(grep "background-image: url" "$THEME_FILE" | cut -d'"' -f2) + local new_image=$(find "$image_dir" -type f | sort -R | head -n 1 | sed "s|^$HOME|~|") + while true; do + if [[ "$new_image" != "$current_image" ]]; then + sed -i 's|url("[^"]*"|url("'"$new_image"'"|' "$THEME_FILE" + break + fi + new_image=$(find "$image_dir" -type f | sort -R | head -n 1 | sed "s|^$HOME|~|") + done +} + MANGO=" Mango" BACK=" Back" MANGO_CONF=" Config" @@ -18,13 +31,14 @@ ROFI_APP=" App" ROFI_SETT=" Setting" ROFI_CONF=" Config" ROFI_POW=" Power" +ROFI_HELP=" Help" MAKO=" Mako" KANSHI="󰍺 Kanshi" if [[ "$1" == "mango" ]]; then chosen=$(echo -e "$MANGO_CONF\n$MANGO_START\n$MANGO_BIND\n$MANGO_RULES\n$MANGO_ENV\n$MANGO_EXEC\n$BACK" | rofi -mesg "󰨇 Mango" -dmenu -p "Action:" -config ~/.config/rofi/config-manager/config-manager.rasi) elif [[ "$1" == "rofi" ]]; then - chosen=$(echo -e "$ROFI_APP\n$ROFI_SETT\n$ROFI_CONF\n$ROFI_POW\n$BACK" | rofi -mesg " Rofi" -dmenu -p "Action:" -config ~/.config/rofi/config-manager/config-manager.rasi) + chosen=$(echo -e "$ROFI_APP\n$ROFI_SETT\n$ROFI_CONF\n$ROFI_POW\n$ROFI_HELP\n$BACK" | rofi -mesg " Rofi" -dmenu -p "Action:" -config ~/.config/rofi/config-manager/config-manager.rasi) else chosen=$(echo -e "$MANGO\n$NVIM\n$WAYBAR\n$GHOSTTY\n$ROFI\n$KANSHI\n$MAKO" | rofi -mesg " Configs" -dmenu -p "Action:" -config ~/.config/rofi/config-manager/config-manager.rasi) fi @@ -88,7 +102,15 @@ case $chosen in ghostty -e nvim ~/.config/rofi/power-manager/power-manager.rasi & disown ghostty -e nvim ~/.config/rofi/power-manager/rofi-power-manager.sh & disown ;; + "$ROFI_HELP") + ghostty -e nvim ~/.config/rofi/help-manager/help-manager.rasi & disown + ghostty -e nvim ~/.config/rofi/help-manager/rofi-help-manager.sh & disown + ;; "$KANSHI") ghostty -e nvim ~/.config/kanshi/config & disown ;; esac + +if [[ "$HOSTNAME" == "astra" ]]; then + post_rofi & +fi diff --git a/mango/rofi/help-manager/rofi-help-manager.sh b/mango/rofi/help-manager/rofi-help-manager.sh index 041e56b..ca076fe 100755 --- a/mango/rofi/help-manager/rofi-help-manager.sh +++ b/mango/rofi/help-manager/rofi-help-manager.sh @@ -34,9 +34,16 @@ case $chosen in echo "Creating firefox profile" mkdir -p /tmp/firefox-dev firefox -CreateProfile "dev-profile /tmp/firefox-dev" + cat >> /tmp/firefox-dev/prefs.js << EOF +user_pref("browser.download.dir", "~/downloads"); +user_pref("browser.download.folderList", 2); +EOF fi firefox -P dev-profile -private-window https://devhints.io/bash & ;; esac -post_rofi & + +if [[ "$HOSTNAME" == "astra" ]]; then + post_rofi & +fi diff --git a/mango/rofi/settings-manager/rofi-settings-manager.sh b/mango/rofi/settings-manager/rofi-settings-manager.sh index 086646d..a532159 100755 --- a/mango/rofi/settings-manager/rofi-settings-manager.sh +++ b/mango/rofi/settings-manager/rofi-settings-manager.sh @@ -32,4 +32,6 @@ case $chosen in ;; esac -post_rofi & +if [[ "$HOSTNAME" == "astra" ]]; then + post_rofi & +fi