From 7471c3e721d9209e53e8af89d25ba39a3ca01d4d Mon Sep 17 00:00:00 2001 From: haemka Date: Thu, 5 Aug 2021 08:30:22 +0200 Subject: [PATCH] More g14control backlight fixes --- .g14control.sh.swp | Bin 0 -> 12288 bytes g14control.sh | 16 ++++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .g14control.sh.swp diff --git a/.g14control.sh.swp b/.g14control.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..bd09bd49eaa53c4d6adff4c41d97c1bf189a5f05 GIT binary patch literal 12288 zcmeI2O>87b8HOuMAT%Ka0SZJ2>D%@s@v^k1$GeDSoXN`TwH=eS$MR1Ic#T!=u9>klv}yiVB4Sg#x#$Ks#+%m+oU1CM&iIHD;cr_rGubcB2;U z3k3=V3Iz%U3Iz%U3Iz%U3Iz%U?jQxy_%8M|@;#I1{EhtmuA%q*vUn>LC=@6ZC=@6Z zC=@6ZC=@6ZC=@6ZC=@6ZC=|E@72qyof5w-6`)(wU|M~a6|NrHF#@+;PfY-sR;1%#Q z@ICNtumbJ@KY9;iFM{uauY+g6P0$4wz#I3WJ$MED2K*9y4Lk$t-~-?cc>Uds{R#X6 zJO{oC954qS0u229UdDb4Zh<}UdC&j?%!4^F4juu2eHUXdgI|G{z|X;#!Dqk}co2LD z{Lx_Sd2k52;5w*-kASh%D4ZaAz0Gfb<>tGcufEiE&m%t~0^36Zq zb_W{&|2t)I!%qo61aPBJFhfZ0FvBpWrqo|uR#BhYk~dLoeDqwu^nY%cg|!F6dPiZ6 z1`nyUUteCEUYYNrQsY0A%?*_8Y`e$W?F^K;zKo9*x+rwG6l9k6RX-;AA=~r(Ku}Yp zQJhLL-Re%YQJwQlLX9bMBNzn<3CD}bTvvirsbtfJ<nkhjvb)(O>oH_MSoZi6d6CJC zFiQPK$C4s+$()0Ft;iMRcsy(h*QD!=88cb^T4~(jDMBqQtKq{N`YN{k_YNq`LZEPTNuX>kiHJYT& z%_&Mf5fYNfTIv?1{R)KcwW*-;A$@Mcwk9`A{U&Nuxk4un%jgfHW|n0~mR+&yJ3^M@ zfTxWpX_dKbODo*A_F8^9^^zz}1F?l{k`@oP;wbQ)4%F?bUK=;B@PLPo($u^XMKZE>u!is^%os@^%yIvVuz;PhHr!Siz6wxy5g6Z6`|V zP)Lb|IlLH7X@At#9B{VM&ycBz2WC>;Q~t`l-;RgN+woB;tbJkAkg#??)7%Mg_|p2~ zpig&3O@m53$7cS4WmPtk+HqOsF~Ok1ZCUjy&WV6`M)DipOy7E5TT&J|3xC1J`W(n?mhGId>ovVcGPClP#x%1HCMVQp*Dl%8@VNK`oJ; zTB`lrPF-XwO?9Y2_HxBm`klD!`tB|BmfMWmTib#C-!8cm+YT?c-e#>HTaMfD)HT3V zn`{k?u`zuP`;xem;sCjf8y2a{e%k8vr6>$KOv7NMj) zbzr;m%j-Jaa(#8-DRQD#9QZgLJ2dXJlLUt%VzwntlQ0S`UCGKSp$O|sdL(Y72}VbAEj$P&^7zXMVkI4l+esYZF%hEWr!eaE zdfH2rA_?JX0^%g@9#8PxmHnJuJx`9Qew@UQQw*|7(?^y1(o$BgLrkx(uhL3=o<1vL zuamST%~vi`z+;R?s>FC3BS@-*AJ3Btj>Ec2P^Dtomn^%2Te~7rf>x ${MAX} ]]; then - LEVEL=${1} - elif [[ ${1} == "up" && ${CURRLEVEL} < ${MAX} ]]; then + if [[ ${1} == "up" ]]; then [[ $((CURRLEVEL+STEP)) > ${MAX} ]] && \ - LEVEL=${MAX} || LEVEL=$((CURRLEVEL+STEP)) - else [[ ${1} == "down" && ${CURRLEVEL} > 0 ]] + LEVEL=${MAX} || \ + [[ ${CURRLEVEL} < ${MAX} ]] && \ + LEVEL=$((CURRLEVEL+STEP)) + elif [[ ${1} == "down" ]]; then [[ $((CURRLEVEL-STEP)) < 0 ]] && \ - LEVEL=0 || LEVEL=$((CURRLEVEL-STEP)) + LEVEL=0 || + [[ ${CURRLEVEL} > 0 ]] && \ + LEVEL=$((CURRLEVEL-STEP)) + elif [[ ${1} =~ ^[0-9]{1,${#MAX}}$ && ! ${1} > ${MAX} ]]; then + LEVEL=${1} fi echo ${LEVEL} > ${INTERFACE}