diff --git a/configs/alacritty/alacritty.yml b/configs/alacritty/alacritty.yml index 6194a03..b42edbb 100644 --- a/configs/alacritty/alacritty.yml +++ b/configs/alacritty/alacritty.yml @@ -1,4 +1,5 @@ font: normal: family: FiraCode NF -background_opacity: 0.5 # Require `picom -f &` in .xinitrc \ No newline at end of file +window: + opacity: 0.5 # Require `picom -f &` in .xinitrc diff --git a/configs/kvm/usbhotplug/README.md b/configs/kvm/usbhotplug/README.md new file mode 100644 index 0000000..20e1294 --- /dev/null +++ b/configs/kvm/usbhotplug/README.md @@ -0,0 +1 @@ +https://github.com/olavmrk/usb-libvirt-hotplug diff --git a/configs/kvm/usbhotplug/plug.sh b/configs/kvm/usbhotplug/plug.sh new file mode 100755 index 0000000..6292a6c --- /dev/null +++ b/configs/kvm/usbhotplug/plug.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# sudo virsh attach-device "$1" "$2.xml" + +DOMAIN=$1 +COMMAND="attach-device" + +# +# This is a bit ugly. udev passes us the USB bus number and +# device number with leading zeroes. E.g.: +# BUSNUM=001 DEVNUM=022 +# This causes libvirt to assume that the numbers are octal. +# To work around this, we need to strip the leading zeroes. +# The easiest way is to ask bash to convert the numbers from +# base 10: +# +BUSNUM=$((10#$2)) +DEVNUM=$((10#$3)) + +# +# Now we have all the information we need to update the VM. +# Run the appropriate virsh-command, and ask it to read the +# update XML from stdin. +# +echo "Running virsh ${COMMAND} ${DOMAIN} for USB bus=${BUSNUM} device=${DEVNUM}:" >&2 +virsh "${COMMAND}" "${DOMAIN}" /dev/stdin < + +
+ + +END diff --git a/configs/kvm/usbhotplug/unplug.sh b/configs/kvm/usbhotplug/unplug.sh new file mode 100755 index 0000000..b548dac --- /dev/null +++ b/configs/kvm/usbhotplug/unplug.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# sudo virsh attach-device "$1" "$2.xml" + +DOMAIN=$1 +COMMAND="detach-device" + +# +# This is a bit ugly. udev passes us the USB bus number and +# device number with leading zeroes. E.g.: +# BUSNUM=001 DEVNUM=022 +# This causes libvirt to assume that the numbers are octal. +# To work around this, we need to strip the leading zeroes. +# The easiest way is to ask bash to convert the numbers from +# base 10: +# +BUSNUM=$((10#$2)) +DEVNUM=$((10#$3)) + +# +# Now we have all the information we need to update the VM. +# Run the appropriate virsh-command, and ask it to read the +# update XML from stdin. +# +echo "Running virsh ${COMMAND} ${DOMAIN} for USB bus=${BUSNUM} device=${DEVNUM}:" >&2 +virsh "${COMMAND}" "${DOMAIN}" /dev/stdin < + +
+ + +END diff --git a/configs/kvm/usbhotplug/usb_bluetooth.xml b/configs/kvm/usbhotplug/usb_bluetooth.xml new file mode 100644 index 0000000..3b1e540 --- /dev/null +++ b/configs/kvm/usbhotplug/usb_bluetooth.xml @@ -0,0 +1,7 @@ + + + + + +
+