Added desktop to handle rofi "applications"

This commit is contained in:
James Patrick 2019-06-14 20:47:58 -04:00
parent 948da03559
commit 611f2bd51b
5 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Media Controls
Exec=sh ~/.config/rofi/scripts/media_controls
Terminal=false

7
rofi/desktop/Power.desktop Executable file
View File

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Power
Exec=sh ~/.config/rofi/scripts/media_controls
Terminal=false

7
rofi/desktop/btctl.desktop Executable file
View File

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Bluetooth Controls
Exec=sh ~/.config/rofi/scripts/btctl
Terminal=false

1
rofi/desktop/readme.md Normal file
View File

@ -0,0 +1 @@
These files are copied over to `~/.local/applications` to provide a means to launch these through rofi's run menu.

View File

@ -3,12 +3,18 @@ SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include ../lib/shared.mk
TARGET := $(XDG_DIR)/rofi
DESKTOP_SRC := $(SRC)/desktop
DESKTOP_TARGET := ~/.local/share/applications
install: | init update
init:
ifeq ($(call cmd_exist,rofi), true)
$(info => Setting up rofi)
$(mk_link) $(SRC) $(TARGET)
$(MAKE) -C $(SRC) desktop_init
else
$(report) warn "rofi not installed. Skipping."
endif
update:
@ -16,3 +22,24 @@ update:
remove:
$(info => Remvoing rofi)
$(rm_link) $(TARGET)
$(MAKE) -C $(SRC) desktop_remove
desktop_init:
ifeq ($(shell [ -e $(DESKTOP_TARGET) ] $(return_val_truthy) ), true)
$(info ==> Setting up desktop shortcuts.)
cd $(DESKTOP_SRC) ; \
for i in *.desktop; do ; \
$(mk_link) $(DESKTOP_SRC)/$$i $(DESKTOP_TARGET)/$$i ; \
done
else
$(report) warn "$(DESKTOP_TARGET) does not exist. Skipping."
endif
desktop_remove:
ifeq ($(shell [ -e $(DESKTOP_TARGET) ] $(return_val_truthy) ), true)
$(info ==> removing rofi desktop entries.)
cd $(DESKTOP_SRC) ; \
for i in *.desktop; do ; \
$(rm_link) $(DESKTOP_TARGET)/$$i ; \
done
endif