mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-15 12:54:15 +01:00
rofi: Make launch.sh a toggle script
This lets us set the super key to launch.sh, which handles both opening rofi and closing it if it's already open.
This commit is contained in:
parent
ff4eddace5
commit
4f5a891280
@ -41,6 +41,12 @@
|
|||||||
# fact that active windows will not handle DPI changes anyway, you should
|
# fact that active windows will not handle DPI changes anyway, you should
|
||||||
# probably have no GUIs running when switching DPI.
|
# probably have no GUIs running when switching DPI.
|
||||||
|
|
||||||
|
# Kill rofi if it's already running to make this a simple toggle script.
|
||||||
|
if pgrep -x rofi; then
|
||||||
|
killall rofi
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
ROFI_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2)
|
ROFI_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2)
|
||||||
ROFI_SCALE=$(expr $ROFI_DPI / 96)
|
ROFI_SCALE=$(expr $ROFI_DPI / 96)
|
||||||
ROFI_DPI_SCALE=$(awk "BEGIN { print "1/$ROFI_SCALE" }")
|
ROFI_DPI_SCALE=$(awk "BEGIN { print "1/$ROFI_SCALE" }")
|
||||||
|
Loading…
Reference in New Issue
Block a user