New: ydotool automation support
This commit is contained in:
parent
aa796e7523
commit
4add7c2701
11
bin/auto_image_upload_discord.sh
Executable file
11
bin/auto_image_upload_discord.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
sleep .1 # Wait for ydotool's virtual device to start
|
||||||
|
sudo /usr/bin/ydotool mousemove --absolute 310 450
|
||||||
|
sudo /usr/bin/ydotool click 0xC0
|
||||||
|
sudo /usr/bin/ydotool mousemove -- 20 -40
|
||||||
|
sudo /usr/bin/ydotool click 0xC0
|
||||||
|
sleep .2 # Takes a bit to pull up window
|
||||||
|
sudo /usr/bin/ydotool mousemove --absolute 110 150
|
||||||
|
sudo /usr/bin/ydotool click 0xC0
|
||||||
|
sudo /usr/bin/ydotool mousemove --absolute 210 120
|
||||||
|
sudo /usr/bin/ydotool click -r 2 -d 100 0xC0
|
|
@ -44,6 +44,7 @@ declare -r \
|
||||||
'viu' 'viu'
|
'viu' 'viu'
|
||||||
'wl-clipboard' 'wl-paste'
|
'wl-clipboard' 'wl-paste'
|
||||||
'wtype' 'wtype'
|
'wtype' 'wtype'
|
||||||
|
'ydotool' 'ydotool'
|
||||||
'zathura-pdf-mupdf' 'zathura'
|
'zathura-pdf-mupdf' 'zathura'
|
||||||
'zathura' 'zathura'
|
'zathura' 'zathura'
|
||||||
) \
|
) \
|
||||||
|
|
|
@ -146,6 +146,7 @@ xremap_checks() {
|
||||||
check_xremap_executable
|
check_xremap_executable
|
||||||
check_xremap_systemd
|
check_xremap_systemd
|
||||||
check_xremap_sudoer
|
check_xremap_sudoer
|
||||||
|
check_ydotool_sudoer
|
||||||
}
|
}
|
||||||
|
|
||||||
check_xremap_config() {
|
check_xremap_config() {
|
||||||
|
@ -213,7 +214,19 @@ check_xremap_sudoer() {
|
||||||
|
|
||||||
if ! sudo -l | grep -Eq 'NOPASSWD:[[:space:]]+/usr/bin/systemctl restart xremap.service'; then
|
if ! sudo -l | grep -Eq 'NOPASSWD:[[:space:]]+/usr/bin/systemctl restart xremap.service'; then
|
||||||
printf "ERR: xremap.service not passwordless for sudoers\n"
|
printf "ERR: xremap.service not passwordless for sudoers\n"
|
||||||
printf "\t $ please bash -c 'echo \"%s\" >> /etc/sudoers.d/xremap'\n" '%wheel ALL=NOPASSWD: /usr/bin/systemctl restart xremap.service'
|
printf '\t $ please bash -c "cp $HOME/.configs_pointer/sudoers.d/xremap /etc/sudoers.d/xremap"\n'
|
||||||
|
return_code=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
return $return_code
|
||||||
|
}
|
||||||
|
|
||||||
|
check_ydotool_sudoer() {
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
if ! sudo -l | grep -Eq 'NOPASSWD:[[:space:]]+/usr/bin/ydotool \*'; then
|
||||||
|
printf "ERR: ydotool not passwordless for sudoers\n"
|
||||||
|
printf '\t $ please bash -c "cp $HOME/.configs_pointer/sudoers.d/ydotool /etc/sudoers.d/ydotool"\n'
|
||||||
return_code=1
|
return_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
1
sudoers.d/xremap
Normal file
1
sudoers.d/xremap
Normal file
|
@ -0,0 +1 @@
|
||||||
|
%wheel ALL=NOPASSWD: /usr/bin/systemctl restart xremap.service
|
1
sudoers.d/ydotool
Normal file
1
sudoers.d/ydotool
Normal file
|
@ -0,0 +1 @@
|
||||||
|
%wheel ALL=NOPASSWD: /usr/bin/ydotool *
|
|
@ -100,6 +100,11 @@ bindsym $mod2+tab exec ~/.config/sway/cycle_windows.py previous
|
||||||
# Important rust jerk
|
# Important rust jerk
|
||||||
bindsym $mod1+ctrl+r exec wtype "asExpectedOfRust"
|
bindsym $mod1+ctrl+r exec wtype "asExpectedOfRust"
|
||||||
|
|
||||||
|
# Automatic upload image to discord
|
||||||
|
bindsym $mod1+ctrl+u exec sudo -u emiliko ~/.configs_pointer/bin/auto_image_upload_discord.sh
|
||||||
|
# Paste by typing
|
||||||
|
bindsym Mod4+Ctrl+v exec ~/.configs_pointer/bin/wpastetype.py
|
||||||
|
|
||||||
# rEsize containers ====
|
# rEsize containers ====
|
||||||
bindsym $mod1+e mode "resize"
|
bindsym $mod1+e mode "resize"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue