mirror of
https://github.com/klaxalk/i3-layout-manager.git
synced 2025-02-26 16:50:47 +01:00
Refixed the dependency check.
This commit is contained in:
parent
141f270351
commit
a4b84b5149
@ -21,7 +21,7 @@ XDOTOOL_BIN="$(whereis -b xdotool | awk '{print $2}')"
|
|||||||
XRANDR_BIN="$(whereis -b xrandr | awk '{print $2}')"
|
XRANDR_BIN="$(whereis -b xrandr | awk '{print $2}')"
|
||||||
ROFI_BIN="$(whereis -b rofi | awk '{print $2}')"
|
ROFI_BIN="$(whereis -b rofi | awk '{print $2}')"
|
||||||
|
|
||||||
if [ ! -z "$NVIM_BIN" ] && [ ! -z "$VIM_BIN" ]; then
|
if [ -z "$NVIM_BIN" ] && [ -z "$VIM_BIN" ]; then
|
||||||
echo missing vim or neovim, please install dependencies
|
echo missing vim or neovim, please install dependencies
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -200,7 +200,8 @@ MATCH ANY" | rofi -i -dmenu -p "How to identify windows? (xprop style)")
|
|||||||
# all-tree file we can find the workspace part.
|
# all-tree file we can find the workspace part.
|
||||||
|
|
||||||
# remove the floating window part, that would screw up out matching
|
# remove the floating window part, that would screw up out matching
|
||||||
$VIM_BIN $HEADLESS -nEs -c '%g/"floating_con"/norm ?{
nd%' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c '%g/"floating_con"/norm ?{
|
||||||
|
nd%' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
|
||||||
# remove comments
|
# remove comments
|
||||||
$VIM_BIN $HEADLESS -nEs -c '%g/\/\//norm dd' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c '%g/\/\//norm dd' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
@ -272,7 +273,8 @@ MATCH ANY" | rofi -i -dmenu -p "How to identify windows? (xprop style)")
|
|||||||
# the information about the split type
|
# the information about the split type
|
||||||
cat $ALL_WS_FILE | cat - $LAYOUT_FILE > /tmp/tmp.txt && mv /tmp/tmp.txt $LAYOUT_FILE
|
cat $ALL_WS_FILE | cat - $LAYOUT_FILE > /tmp/tmp.txt && mv /tmp/tmp.txt $LAYOUT_FILE
|
||||||
# add closing bracked at the end
|
# add closing bracked at the end
|
||||||
$VIM_BIN $HEADLESS -nEs -c "normal Go]
}" -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c "normal Go]
|
||||||
|
}" -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
|
||||||
# now we have to do some postprocessing on it, all is even advices on the official website
|
# now we have to do some postprocessing on it, all is even advices on the official website
|
||||||
# https://i3wm.org/docs/layout-saving.html
|
# https://i3wm.org/docs/layout-saving.html
|
||||||
@ -325,16 +327,20 @@ MATCH ANY" | rofi -i -dmenu -p "How to identify windows? (xprop style)")
|
|||||||
$VIM_BIN $HEADLESS -nEs -c '%g/\/\//norm dd' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c '%g/\/\//norm dd' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
|
||||||
# add a missing comma to the last element of array we just deleted
|
# add a missing comma to the last element of array we just deleted
|
||||||
$VIM_BIN $HEADLESS -nEs -c '%g/swallows/norm j^%k:s/,$//g
' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c '%g/swallows/norm j^%k:s/,$//g
|
||||||
|
' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
|
||||||
# delete all empty lines
|
# delete all empty lines
|
||||||
$VIM_BIN $HEADLESS -nEs -c '%g/^$/norm dd' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c '%g/^$/norm dd' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
|
||||||
# pick up floating containers and move them out of the root container
|
# pick up floating containers and move them out of the root container
|
||||||
$VIM_BIN $HEADLESS -nEs -c '%g/floating_con/norm ?{
nd%"_ddGA
p' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c '%g/floating_con/norm ?{
|
||||||
|
nd%"_ddGA
|
||||||
|
p' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
|
||||||
# add missing commas between the newly created inner parts of the root element
|
# add missing commas between the newly created inner parts of the root element
|
||||||
$VIM_BIN $HEADLESS -nEs -c '%s/}\n{/},
{/g' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c '%s/}\n{/},
|
||||||
|
{/g' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
|
||||||
# surroun everythin in []
|
# surroun everythin in []
|
||||||
$VIM_BIN $HEADLESS -nEs -c 'normal ggO[Go]' -c "wqa" -- "$LAYOUT_FILE"
|
$VIM_BIN $HEADLESS -nEs -c 'normal ggO[Go]' -c "wqa" -- "$LAYOUT_FILE"
|
||||||
|
Loading…
Reference in New Issue
Block a user