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

20 lines
532 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
2024-09-20 04:11:00 +00:00
if not cat $file | grep "\\[$name\\]" &> /dev/null
2024-09-20 00:23:09 +00:00
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