Dotfiles config update (2022-05-28)

This commit is contained in:
q3aql 2022-05-28 01:39:17 +02:00
parent 7bcd5122db
commit 76941c9959
2 changed files with 28 additions and 1 deletions

View File

@ -42,10 +42,11 @@ dist: clean
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f dmenu dmenu_drun dmenu_run stest $(DESTDIR)$(PREFIX)/bin
cp -f dmenu dmenu_drun dmenu_run dmenu_wrun stest $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_drun
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_wrun
chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
@ -57,6 +58,7 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
$(DESTDIR)$(PREFIX)/bin/dmenu_drun\
$(DESTDIR)$(PREFIX)/bin/dmenu_run\
$(DESTDIR)$(PREFIX)/bin/dmenu_wrun\
$(DESTDIR)$(PREFIX)/bin/stest\
$(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
$(DESTDIR)$(MANPREFIX)/man1/stest.1

25
.config/dmenu/dmenu_wrun Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# Search through open programs and switch to their tag
application=$(
# List all running programs
xlsclients |\
# Fix Virtualbox and LibreOffice
sed -e 's/.*VirtualBox/foobar virtualbox/g' -e 's/.*soffice/foobar libreoffice/g' |\
# Remove flash from results
grep -v "plugin-container" |\
# Show only app-names
cut -d" " -f3 |\
# Pipe to dmenu ($@ to include font settings from dwm/config.h)
dmenu -i -p " Switch to" $@
)
# Switch to chosen application
case $application in
gimp | truecrypt)
xdotool search --onlyvisible -classname "$application" windowactivate &> /dev/null
;;
*)
xdotool search ".*${application}.*" windowactivate &> /dev/null
;;
esac