From cec6982ccff1d67f4421984dedd95413d048acb8 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 26 Jul 2021 08:44:07 +0200 Subject: [PATCH] Change padding script to mimic CSS shorthands --- bin/padding | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/padding b/bin/padding index 8a238e9..70de483 100755 --- a/bin/padding +++ b/bin/padding @@ -1,15 +1,23 @@ #!/bin/sh -h=0 if [ -n "$1" ] -then h="$1" +then t="$1" +else t="0" fi -v=$h if [ -n "$2" ] -then v="$2" +then l="$2" +else l="$t" +fi +if [ -n "$3" ] +then b="$3" +else b="$t" +fi +if [ -n "$4" ] +then r="$4" +else r="$l" fi if [ "$TERM" = "xterm-kitty" ] then - kitty @ set-spacing padding-h=$h padding-v=$v + kitty @ set-spacing padding-top=$t padding-left=$l padding-bottom=$b padding-right=$r fi