[qubes-users] Attaching USB devices by name instead of devid (from the command line)

2023-04-26 Thread Gabriel Philippe
Hi,

I use an USB scanner which is sometimes unplugged and might be plugged
to another USB port. I would like it to be permanently attached to the
"scanner" vm (I don't want to reattach it after reboot).

However the documented way uses the devid, ex. sys-usb:2.5. If I
attach it permanently to a vm (qvm-usb attach -p scanner sys-usb:2.5),
then unplug the scanner and plug an USB flash drive to same port, the
flash drive gets attached automatically to my "scanner" vm (which I
don't want).

Is there a way to attach a specific device to a vm, and not an USB port?

I tried with qvm-block, but couldn't find my scanner label in /dev/

Currently, my best solution is to have a launcher running this:
qvm-usb attach scanner "$(qvm-usb|grep Canon|cut -f 1 -d ' ')"

-- 
Gabriel

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CAJ-6NAsdNNYVQxYfG_%3DST-F_ov8JrZ9CpK4wDFcMUtja_rE1eg%40mail.gmail.com.


[qubes-users] Re: Changing key mappings / running a command at startup

2023-04-17 Thread Gabriel Philippe
"solved". Ugly, but works. Via a .desktop in ~/.config/autostart. The
trick was to not run xmodmap immediately, but to delay it: sleep 2;
xmodmap /home/user/...

For the record:
~/.config/autostart/xmodmap.desktop:
[Desktop Entry]
Type=Application
Name=xmodmap
Exec=/home/user/.config/xmodmap.sh
X-GNOME-Autostart-enabled=true

~/.config/xmodmap.sh:
sleep 2; xmodmap /home/user/.config/xmodmap

~/.config/xmodmap:
remove Lock = Caps_Lock
keycode 9 = Caps_Lock
keycode 66 = Escape
add Lock = Caps_Lock

Also added to /etc/skel/ of the templates for future vms and dispvms.

On Mon, Apr 17, 2023 at 3:25 PM Gabriel Philippe
 wrote:
>
> Hi,
>
> I'm used to swapping CapsLock and Escape keys, but don't manage it to
> do it through vms. Any help?
>
> Basically what I need is not more complicated than running xmodmap
> config_file, where config_file is:
> remove Lock = Caps_Lock
> keycode 9 = Caps_Lock
> keycode 66 = Escape
> add Lock = Caps_Lock
>
> Several years ago I was using Qubes 3.2, and if I remember correctly I
> only had to do it in dom0, then it was propagated to vms. This does
> not work anymore in 4.1.
>
> Currently, when doing it in dom0 it works in dom0, but when starting a
> vm I get this weird situation:
> - CapsLock key does nothing,
> - Escape key sends both Escape and CapsLock.
>
> I can manually run xmodmap config_file in vms, then it is fine, but I
> can't automate it. At startup:
> - ~/.Xmodmap is not read
> - ~/.xsession is not executed
> - /rw/config/rc.local is executed, but adding "xmodmap
> /home/user/config_file" in it does nothing.
> - I tried adding a script in the template,
> /etc/X11/Xsession.d/99script, containing "xmodmap
> /home/user/config_file", but it does not work either (though the
> script is executed).
>
> I found this thread, but don't understand anything, and I can't figure
> such a simple thing could be that complicated.
> https://forum.qubes-os.org/t/remap-super-key-keyboard/4894
>
> --
> Gabriel



-- 
Gabriel

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CAJ-6NAsgMQCrECs9cbUNMj1zT1Zp_hKZJAnrOjU4y%2B6tWTCrng%40mail.gmail.com.


[qubes-users] Changing key mappings / running a command at startup

2023-04-17 Thread Gabriel Philippe
Hi,

I'm used to swapping CapsLock and Escape keys, but don't manage it to
do it through vms. Any help?

Basically what I need is not more complicated than running xmodmap
config_file, where config_file is:
remove Lock = Caps_Lock
keycode 9 = Caps_Lock
keycode 66 = Escape
add Lock = Caps_Lock

Several years ago I was using Qubes 3.2, and if I remember correctly I
only had to do it in dom0, then it was propagated to vms. This does
not work anymore in 4.1.

Currently, when doing it in dom0 it works in dom0, but when starting a
vm I get this weird situation:
- CapsLock key does nothing,
- Escape key sends both Escape and CapsLock.

I can manually run xmodmap config_file in vms, then it is fine, but I
can't automate it. At startup:
- ~/.Xmodmap is not read
- ~/.xsession is not executed
- /rw/config/rc.local is executed, but adding "xmodmap
/home/user/config_file" in it does nothing.
- I tried adding a script in the template,
/etc/X11/Xsession.d/99script, containing "xmodmap
/home/user/config_file", but it does not work either (though the
script is executed).

I found this thread, but don't understand anything, and I can't figure
such a simple thing could be that complicated.
https://forum.qubes-os.org/t/remap-super-key-keyboard/4894

-- 
Gabriel

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CAJ-6NAuog0vLCb3Y4%3Dho9vx8%3DS6pA6eVL%3DPgoE1-JNtTBUXv%3DQ%40mail.gmail.com.