mirror of
https://github.com/klaxalk/i3-layout-manager.git
synced 2024-11-24 15:43:18 +01:00
added option for full path to layout file
This commit is contained in:
parent
39af10297a
commit
80ade872bf
@ -82,7 +82,12 @@ DELETE LAYOUT" | rofi -i -dmenu -no-custom -p "Select action")
|
||||
else
|
||||
|
||||
ACTION="LOAD LAYOUT"
|
||||
LAYOUT_NAME="${1^^}"
|
||||
# if the layout name is a full path, just pass it, otherwise convert it to upper case
|
||||
if [[ "${1}" == *".json" ]]; then
|
||||
LAYOUT_NAME="${1}"
|
||||
else
|
||||
LAYOUT_NAME="${1^^}"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
@ -93,7 +98,14 @@ fi
|
||||
|
||||
# #}
|
||||
|
||||
LAYOUT_FILE=$LAYOUT_PATH/layout-"$LAYOUT_NAME".json
|
||||
# if the layout name is a full path, use it, otherwise fabricate the full path
|
||||
if [[ $LAYOUT_NAME == *".json" ]]; then
|
||||
LAYOUT_FILE="$LAYOUT_NAME"
|
||||
else
|
||||
LAYOUT_FILE=$LAYOUT_PATH/layout-"$LAYOUT_NAME".json
|
||||
fi
|
||||
|
||||
echo $LAYOUT_FILE
|
||||
|
||||
if [ "$ACTION" == "LOAD LAYOUT" ] && [ ! -f "$LAYOUT_FILE" ]; then
|
||||
exit
|
||||
|
Loading…
Reference in New Issue
Block a user