From 7b0c15c647b82baa8f2ed55d2abbc6869172afc9 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 10 Aug 2020 22:54:26 +0200 Subject: Fixing backlight-ctl to be compatible with both machines --- .pluggins.vim | 1 + bin/backlight-ctl | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.pluggins.vim b/.pluggins.vim index b49b906..ff0d158 100644 --- a/.pluggins.vim +++ b/.pluggins.vim @@ -11,6 +11,7 @@ call plug#begin() Plug 'romainl/vim-cool' " disable highlight after search Plug 'tpope/vim-fugitive' " git wrapper Plug 'junegunn/vim-easy-align' " align + " Plug 'easymotion/vim-easymotion' " TODO very intresting " markdown preview in browser Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} diff --git a/bin/backlight-ctl b/bin/backlight-ctl index 7153276..2963d83 100755 --- a/bin/backlight-ctl +++ b/bin/backlight-ctl @@ -2,10 +2,22 @@ [ "$#" -ne 1 ] && exit 1; + +if [ "$(hostname)" = manjaro ] +then + cmd=light + up_opt=-A + down_opt=-U +else + cmd=xbacklight + up_opt=-inc + down_opt=-dec +fi + case "$1" in - "up") xbacklight -inc 5 ;; - "down") xbacklight -dec 5 ;; + "up") "$cmd" "$up_opt" 5 ;; + "down") "$cmd" "$down_opt" 5 ;; *) exit 1 ;; esac -notify-send "backlight $(xbacklight | cut -d '.' -f 1)" +notify-send "backlight $("$cmd" | cut -d '.' -f 1)" -- cgit