From b00d060a5654ca8775bf7c83b4bf002f7a4f7026 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 22 Apr 2025 14:30:03 +0800 Subject: [PATCH] fix rofi --- .../home/hyprland/conf/hypr/keybindings.conf | 7 +-- .../hyprland/conf/hypr/scripts/rofilaunch.sh | 48 ------------------- .../hyprland/conf/hypr/scripts/rofiselect.sh | 24 ---------- 3 files changed, 4 insertions(+), 75 deletions(-) delete mode 100755 modules/home/hyprland/conf/hypr/scripts/rofilaunch.sh delete mode 100755 modules/home/hyprland/conf/hypr/scripts/rofiselect.sh diff --git a/modules/home/hyprland/conf/hypr/keybindings.conf b/modules/home/hyprland/conf/hypr/keybindings.conf index eaa337e..4f0c0ba 100644 --- a/modules/home/hyprland/conf/hypr/keybindings.conf +++ b/modules/home/hyprland/conf/hypr/keybindings.conf @@ -31,9 +31,10 @@ bind = $mainMod, V, exec, code # open vscode # Control actions ################################################ # Rofi is toggled on/off if you repeat the key presses -bind = $mainMod, SPACE, exec, pkill rofi || ~/.config/hypr/scripts/rofilaunch.sh d # launch desktop applications -bind = $mainMod, tab, exec, pkill rofi || ~/.config/hypr/scripts/rofilaunch.sh w # switch between desktop applications -bind = $mainMod, R, exec, pkill rofi || ~/.config/hypr/scripts/rofilaunch.sh f # browse system files +bind = $mainMod, SPACE, exec, pkill rofi || rofi -show drun # launch desktop applications +bind = $mainMod, tab, exec, pkill rofi || rofi -show window # switch between desktop applications +bind = $mainMod, F, exec, pkill rofi || rofi -show filebrowser # browse system files +bind = $mainMod, R, exec, pkill rofi || rofi -show run # run a command # Audio control # bind = , F10, exec, ~/.config/hypr/scripts/volumecontrol.sh -o m # toggle audio mute diff --git a/modules/home/hyprland/conf/hypr/scripts/rofilaunch.sh b/modules/home/hyprland/conf/hypr/scripts/rofilaunch.sh deleted file mode 100755 index 2441e36..0000000 --- a/modules/home/hyprland/conf/hypr/scripts/rofilaunch.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env sh - -theme_file="$HOME/.config/hypr/themes/theme.conf" -rofi_conf="~/.config/rofi/config.rasi" - - -# rofi action - -case $1 in - d) r_mode="drun" ;; - w) r_mode="window" ;; - f) r_mode="filebrowser" ;; - h) echo -e "rofilaunch.sh [action]\nwhere action," - echo "d : drun mode" - echo "w : window mode" - echo "f : filebrowser mode," - exit 0 ;; - *) r_mode="drun" ;; -esac - - -# read hypr theme border - -hypr_border=`awk -F '=' '{if($1~" rounding ") print $2}' $theme_file | sed 's/ //g'` -hypr_width=`awk -F '=' '{if($1~" border_size ") print $2}' $theme_file | sed 's/ //g'` -wind_border=$(( hypr_border * 3 )) -elem_border=`[ $hypr_border -eq 0 ] && echo "10" || echo $(( hypr_border * 2 ))` -r_override="window {border: ${hypr_width}px; border-radius: ${wind_border}px;} element {border-radius: ${elem_border}px;}" - - -# read hypr font size - -#fnt_size=`awk '{if($6=="font-name") print $NF}' $theme_file | sed "s/'//g"` -fnt_override=`gsettings get org.gnome.desktop.interface font-name | awk '{gsub(/'\''/,""); print $NF}'` -fnt_override="configuration {font: \"JetBrainsMono Nerd Font ${fnt_override}\";}" - - -# read hypr theme icon - -icon_override=`gsettings get org.gnome.desktop.interface icon-theme | sed "s/'//g"` -icon_override="configuration {icon-theme: \"${icon_override}\";}" - - -# launch rofi - -rofi -show $r_mode -theme-str "${fnt_override}" -theme-str "${r_override}" -theme-str "${icon_override}" -config "${rofi_conf}" - - diff --git a/modules/home/hyprland/conf/hypr/scripts/rofiselect.sh b/modules/home/hyprland/conf/hypr/scripts/rofiselect.sh deleted file mode 100755 index 8e43c3c..0000000 --- a/modules/home/hyprland/conf/hypr/scripts/rofiselect.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env sh - -## set variables ## -BaseDir=`dirname $(realpath $0)` -ThemeSet="$HOME/.config/hypr/themes/theme.conf" -RofiConf="$HOME/.config/rofi/themeselect.rasi" -RofiStyle="$HOME/.config/rofi/styles" -Rofilaunch="$HOME/.config/rofi/config.rasi" - -## show and apply theme ## -hypr_border=`awk -F '=' '{if($1~" rounding ") print $2}' $ThemeSet | sed 's/ //g'` -elem_border=$(( hypr_border * 5 )) -icon_border=$(( elem_border - 5 )) -r_override="element {border-radius: ${elem_border}px;} element-icon {border-radius: ${icon_border}px;}" - -RofiSel=$( ls $RofiStyle/style_*.rasi | awk -F '/' '{print $NF}' | cut -d '.' -f 1 | while read rstyle -do - echo -en "$rstyle\x00icon\x1f$RofiStyle/${rstyle}.png\n" -done | rofi -dmenu -theme-str "${r_override}" -config $RofiConf) - -if [ ! -z $RofiSel ] ; then - cp $RofiStyle/$RofiSel.rasi $Rofilaunch -fi -