initial commit
This commit is contained in:
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# dmenu_run with custom history
|
||||
#
|
||||
set -e
|
||||
|
||||
export PATH=$PATH:~/.local/bin:~/.local/bin/sh
|
||||
|
||||
# . $HOME/.config/rc/config/dmenu/dmenu.rc
|
||||
# . $HOME/.config/rc/sh/dmenu_path
|
||||
|
||||
# NB="#303446"
|
||||
#NF="#838ba7"
|
||||
#SF="#303446"
|
||||
#SB="#ebcb8b"
|
||||
NB="#090e13fa"
|
||||
|
||||
NF="#c6d0f5"
|
||||
NF="#c6d0f54d"
|
||||
SB="#303446"
|
||||
SF="#babbf1"
|
||||
#$nf #c6d0f5$TR
|
||||
#$nb #303446$TR
|
||||
#$sf #ebcb8b$TR
|
||||
|
||||
# NORD: NF="#4c566aEF"
|
||||
# NORD: NB="#2e3440EF"
|
||||
# NORD: SF="#2e3440EF"
|
||||
# NORD: SB="#ebcb8bEF"
|
||||
|
||||
# FONT="monospace:size=11"
|
||||
FONT="JetBrainsMono Nerd Font 10"
|
||||
|
||||
HISTORY=$HOME/.cache/dmenu_run.history
|
||||
|
||||
# MONITOR="$(swaymsg -t get_outputs | jq -r 'map(.focused) | index(true)')"
|
||||
# MONITORNAME="$(swaymsg -t get_outputs | jq -r '.[] | select(.focused==true) | .name')"
|
||||
_HIST_PREPEND() {
|
||||
( printf "%s\n" 1 i "$@" . w | ex $HISTORY ) &>/dev/null
|
||||
awk -i inplace '!x[$0]++' "$HISTORY"
|
||||
}
|
||||
|
||||
# dmenu -m $MONITOR -fn ${FONT} -nb ${NB} -nf ${NF} -sb ${SB} -sf ${SF} -p "dmenu: " "$@") \
|
||||
cmd=$((
|
||||
cat "$HISTORY"; \
|
||||
flatpak list --columns=application | awk '$0="Ƒ "$0' ; \
|
||||
dmenu_path) | \
|
||||
wmenu -i -f "${FONT}" -M ${NB} -m ${SB} -N ${NB} -n ${NF} -S ${SB} -s ${SF} -p "dmenu: " "$@" ) \
|
||||
|| exit
|
||||
|
||||
_HIST_PREPEND "$cmd" &
|
||||
|
||||
case $cmd in
|
||||
Ƒ*) flatpak run "${cmd#Ƒ }" ;;
|
||||
!*) exec foot -e -T "${cmd#!}" "${cmd#!}" ;;
|
||||
*) exec $cmd & ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user