fix rofi
This commit is contained in:
@@ -31,9 +31,10 @@ bind = $mainMod, V, exec, code # open vscode
|
|||||||
# Control actions
|
# Control actions
|
||||||
################################################
|
################################################
|
||||||
# Rofi is toggled on/off if you repeat the key presses
|
# 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, SPACE, exec, pkill rofi || rofi -show drun # launch desktop applications
|
||||||
bind = $mainMod, tab, exec, pkill rofi || ~/.config/hypr/scripts/rofilaunch.sh w # switch between desktop applications
|
bind = $mainMod, tab, exec, pkill rofi || rofi -show window # switch between desktop applications
|
||||||
bind = $mainMod, R, exec, pkill rofi || ~/.config/hypr/scripts/rofilaunch.sh f # browse system files
|
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
|
# Audio control
|
||||||
# bind = , F10, exec, ~/.config/hypr/scripts/volumecontrol.sh -o m # toggle audio mute
|
# bind = , F10, exec, ~/.config/hypr/scripts/volumecontrol.sh -o m # toggle audio mute
|
||||||
|
|||||||
@@ -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}"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user