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

20 lines
530 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-10-06 19:25:34 +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"
2024-10-06 19:25:34 +00:00
end | sudo tee $file >/dev/null
2024-09-20 00:23:09 +00:00
end
end