20 lines
536 B
Fish
20 lines
536 B
Fish
|
function addInputConfig -a vendorID productID name
|
||
|
set -l file /etc/xdg/kcminputrc
|
||
|
set -l statements $argv[4..]
|
||
|
|
||
|
if [ -z "$statements" ]
|
||
|
set statements (cat)
|
||
|
end
|
||
|
|
||
|
if not cat $file | grep "\\[$name\\]" > /dev/null 2>&1
|
||
|
begin
|
||
|
printf %s\n \
|
||
|
(if [ -f $file ] && [ -n (cat $file) ]
|
||
|
echo ""
|
||
|
end) \
|
||
|
"[Libinput][$vendorID][$productID][$name]" \
|
||
|
"$statements"
|
||
|
end | sudo tee $file > /dev/null
|
||
|
end
|
||
|
end
|