PortValhalla/scripts/Common/Software/KDE/input.fish

20 lines
536 B
Fish
Raw Normal View History

2024-09-20 00:23:09 +00:00
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