Back to rofi, because of fucked up fonts in dmenu.
This commit is contained in:
parent
7a0eabd55f
commit
d050312cff
@ -4,7 +4,7 @@
|
||||
mkdir -p ~/.config ~/.local/bin ~/.local/settings
|
||||
|
||||
# link config
|
||||
for i in clipit dunst fontconfig zathura; do
|
||||
for i in clipit dunst fontconfig rofi zathura; do
|
||||
rm -rf ~/.config/${i}
|
||||
ln -sf ~/.local/repos/dotfiles/_desktop/${i} ~/.config
|
||||
done
|
||||
|
@ -1,4 +1,4 @@
|
||||
configuration {
|
||||
font: "JetBrainsMono Nerd Font Mono 12";
|
||||
theme: "Pop-Dark";
|
||||
theme: "Monokai";
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
div="----------"
|
||||
|
||||
set_output() {
|
||||
sel_sink=$(printf "$sinks\\n$div\\nback\\nexit" | dmenu -l 10 -i -p "sink")
|
||||
sel_sink=$(printf "$sinks\\n$div\\nback\\nexit" | rofi -dmenu -l 10 -i -p "sink")
|
||||
case "$sel_sink" in
|
||||
back) show_current ;;
|
||||
exit) exit ;;
|
||||
@ -14,7 +14,7 @@ set_output() {
|
||||
}
|
||||
|
||||
set_input() {
|
||||
sel_source=$(printf "$sources\\n$div\\nBluetooth profile\\n$div\\nback\\nexit" | dmenu -l 10 -i -p "source")
|
||||
sel_source=$(printf "$sources\\n$div\\nBluetooth profile\\n$div\\nback\\nexit" | rofi -dmenu -l 10 -i -p "source")
|
||||
case "$sel_source" in
|
||||
back) show_current ;;
|
||||
exit) exit ;;
|
||||
@ -29,7 +29,7 @@ set_bt_profile() {
|
||||
bt_sink=$(pactl list cards | awk -F'"' '/device.name.*bluez/ {print $2}')
|
||||
[ -z "${bt_sink}" ] &&
|
||||
{ dunstify -u critical "🎧 no headphones connected"; exit; }
|
||||
profile_chosen=$(printf "profile mSBC\\nprofile LDAC\\n$div\\nback\\nexit" | dmenu -l 5 -i -p "profile")
|
||||
profile_chosen=$(printf "profile mSBC\\nprofile LDAC\\n$div\\nback\\nexit" | rofi -dmenu -l 5 -i -p "profile")
|
||||
case "$profile_chosen" in
|
||||
back) show_current ;;
|
||||
exit) exit ;;
|
||||
@ -44,7 +44,7 @@ set_bt_profile() {
|
||||
show_current() {
|
||||
def_snk=$(pactl list | grep -A 1 "Name: $(pactl get-default-sink)\$" | awk -F': ' '/Description: / {print $2}')
|
||||
def_src=$(pactl list | grep -A 1 "Name: $(pactl get-default-source)\$" | awk -F': ' '/Description: / {print $2}')
|
||||
chosen=$(printf "Output: $def_snk\\nInput: $def_src" | dmenu -l 2 -p "current settings")
|
||||
chosen=$(printf "Output: $def_snk\\nInput: $def_src" | rofi -dmenu -l 2 -p "current settings")
|
||||
if [ "$1" = "no_switch" ]; then
|
||||
case "$chosen" in
|
||||
*) dunstify -u critical "🔊 no device to switch" ;;
|
||||
|
@ -299,7 +299,7 @@ show_menu() {
|
||||
}
|
||||
|
||||
# Rofi command to pipe into, can add any options here
|
||||
rofi_command="dmenu -l 20 -i -p"
|
||||
rofi_command="rofi -dmenu -l 20 -i -p"
|
||||
|
||||
case "$1" in
|
||||
--status)
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
twoscreen() {
|
||||
mirror=$(printf "no\\nyes" | dmenu -l 2 -i -p "mirror")
|
||||
mirror=$(printf "no\\nyes" | rofi -dmenu -l 2 -i -p "mirror")
|
||||
if [ "$mirror" = "yes" ]; then
|
||||
external=$(echo "$screens" | dmenu -l 2 -i -p "optimize resolution for")
|
||||
external=$(echo "$screens" | rofi -dmenu -l 2 -i -p "optimize resolution for")
|
||||
internal=$(echo "$screens" | grep -v "$external")
|
||||
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
|
||||
tail -n 1 | awk '{print $1}')
|
||||
@ -19,9 +19,9 @@ twoscreen() {
|
||||
--output "$internal" --auto --same-as "$external" \
|
||||
--scale "$scale_x"x"$scale_y"
|
||||
else
|
||||
primary=$(echo "$screens" | dmenu -l 50 -i -p "primary")
|
||||
primary=$(echo "$screens" | rofi -dmenu -l 50 -i -p "primary")
|
||||
secondary=$(echo "$screens" | grep -v "$primary")
|
||||
direction=$(printf "left\\nright" | dmenu -l 2 -i -p "side of $primary should $secondary be on")
|
||||
direction=$(printf "left\\nright" | rofi -dmenu -l 2 -i -p "side of $primary should $secondary be on")
|
||||
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
|
||||
fi
|
||||
}
|
||||
@ -30,7 +30,7 @@ onescreen() {
|
||||
if [ "$2" = "native" ]; then
|
||||
xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -)
|
||||
else
|
||||
scale=$(printf "native\\n0.75\\n0.5" | dmenu -l 3 -i -p "scale") &&
|
||||
scale=$(printf "native\\n0.75\\n0.5" | rofi -dmenu -l 3 -i -p "scale") &&
|
||||
case "$scale" in
|
||||
"native") xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -);;
|
||||
*) xrandr --output "$1" --auto --scale ${scale}x${scale} $(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -);;
|
||||
@ -55,7 +55,7 @@ screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
|
||||
{ onescreen "$screens" "native"; postrun; dunstify -u critical "💻 no device to switch"; exit ;}
|
||||
|
||||
# Get user choice including both and manual selection:
|
||||
chosen=$(printf -- "%s\\nmulti" "$screens" | dmenu -l 5 -i -p "display") &&
|
||||
chosen=$(printf -- "%s\\nmulti" "$screens" | rofi -dmenu -l 5 -i -p "display") &&
|
||||
case "$chosen" in
|
||||
"multi") twoscreen ;;
|
||||
*) onescreen "$chosen" ;;
|
||||
|
@ -103,7 +103,7 @@ static Key keys[] = {
|
||||
TAGKEYS( XK_0, 9)
|
||||
/* apps n'shit */
|
||||
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_space, spawn, SHCMD("dmenu_run -l 10 -i -p 'Run:'") },
|
||||
{ MODKEY, XK_space, spawn, SHCMD("rofi -show run") },
|
||||
{ MODKEY, XK_f, spawn, SHCMD("st -n nnn -e nnn -de") },
|
||||
{ MODKEY, XK_i, spawn, SHCMD("scrot -f -s 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
||||
{ SHTKEY, XK_i, spawn, SHCMD("scrot 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
||||
@ -114,7 +114,7 @@ static Key keys[] = {
|
||||
{ CTRKEY, XK_a, spawn, SHCMD("dmenu-audio") },
|
||||
{ CTRKEY, XK_b, spawn, SHCMD("dmenu-bluetooth") },
|
||||
{ CTRKEY, XK_d, spawn, SHCMD("dmenu-display") },
|
||||
{ CTRKEY, XK_e, spawn, SHCMD("dmenu-emoji") },
|
||||
{ CTRKEY, XK_e, spawn, SHCMD("rofi -show emoji") },
|
||||
{ CTRKEY, XK_l, spawn, SHCMD("physlock") },
|
||||
/* window controls */
|
||||
{ SHTKEY, XK_m, zoom, {0} },
|
||||
|
Loading…
Reference in New Issue
Block a user