Skip to content
Browse files

make dmenu options more dynamic, some better naming

  • Loading branch information...
neeasade committed Oct 29, 2019
1 parent 0bbbd64 commit 1022ee80c6e1ed87051905ca21ea237e9211318e
Showing with 20 additions and 13 deletions.
  1. +20 −13 wm/.wm/scripts/interact/dmenu_options
@@ -1,22 +1,29 @@
#!/usr/bin/env bash
# print dmenu dimensions for current monitor, and set prompt.
# colors are set by Xresources.

# TODO: more dynamic width with percent of screen based on line height
dim() {
bspc query -T -m | jq .rectangle.$1

eval "$(theme get)"

width=$(bspc query -T -m | jq .rectangle.width)
width=$(echo .30 \* $width | bc | sed 's/\..*//')

mon="$(bspc query -M -m)"
dim() {
bspc query -T -m $mon | jq .rectangle.$1
# need a dmenu with xft font handling
# todo: txth -f "xft:${p_font_main}:style=Regular" -s $font_size "asdf"

height=$((lines * line_height))

x="$(( ($(dim width) - width) / 2 ))"
y="$(( ($(dim height) - height) / 2))"
x=$(( ($(dim width) - width) / 2 ))
y=$(( ($(dim height) - height) / 3))

# trim alphas
p_fg_normal=$(colort -t "${p_fg_normal}")
p_fg_active=$(colort -t "${p_fg_active}")
p_bg_normal=$(colort -t "${p_bg_normal}")
p_bg_active=$(colort -t "${p_bg_active}")

echo "-dim 0.8 -y $y -x $x -h $height -w $width -l $lines -i -p ${1}:"
echo "-nf #$p_fg_normal -nb #$p_bg_normal -sf #$p_fg_active -sb #$p_bg_active -fn \"${p_font_main}\" -y $y -x $x -h $line_height -w $width -l $lines -i -p ${1}:"

0 comments on commit 1022ee8

Please sign in to comment.
You can’t perform that action at this time.