About me
Name
My name is Vyacheslav Levit.
Where are you from?
Languages
I know five languages. Two of them, Russian and Python, are my native languages. I have a dream to learn Kobaïan.
Skills
I can play the violin a little bit1, do a handstand and do a legstand.
Addictions
I like all free stuff: free software, free jazz and carcinogen-free fries.
Bad habits
I do not smoke. I do drink milk a lot.
Religion, Church
Yep, Emacs.
Value system
I appreciate straightforwardness in people and fastforwardness in git merges.
-
So far I can only play 4'33" of John Cage (in ensemble). ↩
-
Francisco06 Sep 2018, 15:17
Good afternoon, I'm trying to use your notify-send.sh script to improve the operation of another script that I'm using to switch between different modes on a Wacom drawing tablet, on Linux. The idea is to get the notifications, after the mode changes, to close immediately, and can see instantly in which mode I am, after pressing the mode change button.
That is, each notification instantly cancels the previous one.
The script for my script I got from here: https://ubuntuforums.org/showthread.php?t=1380744&page=32
This is my script:
!/bin/bash
check if mode_state file exists, if not create it and set to 0
if [ ! -f /tmp/mode_state ]; then echo 0 > /tmp/mode_state fi
read mode state value from temporary file
MODE=
cat /tmp/mode_state
select touch ring mode status LED for current mode state
echo $MODE > /sys/bus/usb/devices/*/wacom_led/status_led0_select
for DEVICE use the pad "device name" from 'xinput list'
DEVICE="Wacom Intuos Pro L Pad pad"
DEVICE="Wacom Intuos Pro L Pad pad"
set touch ring function option and notification for the 4 toggled modes
if [ "$MODE" == 0 ]; then xsetwacom set "$DEVICE" AbsWheelUp "key Ctrl +" # scroll up xsetwacom set "$DEVICE" AbsWheelDown "key Ctrl -" # scroll down notify-send -t 1000 "Modo 1: Zoom" elif [ "$MODE" == 1 ]; then xsetwacom set "$DEVICE" AbsWheelUp "key 4" # increase brush radius (must be mapped in GIMP) xsetwacom set "$DEVICE" AbsWheelDown "key 6" # decrease brush radius (must be mapped in GIMP) notify-send -t 1000 -i /home/fran/icon/touchring.png "Modo 2: Rotación" elif [ "$MODE" == 2 ]; then xsetwacom set "$DEVICE" AbsWheelUp "key 8" # zoom in xsetwacom set "$DEVICE" AbsWheelDown "key 9" # zoom out notify-send -t 1000 "Mode 3: Tamaño del pincel" elif [ "$MODE" == 3 ]; then xsetwacom set "$DEVICE" AbsWheelUp "key Ctrl z" # select previous layer xsetwacom set "$DEVICE" AbsWheelDown "key Ctrl Shift z" # select next layer notify-send -t 1000 "Mode 4: Deshacer/hacer" fi
toggle button increment counter
MODE=$((MODE += 1))
set next mode state
if (( "$MODE" > 3 )); then # roll over to 0, only 4 mode states available echo 0 > /tmp/mode_state else echo $MODE > /tmp/mode_state fi
I have tried using the property that allows you to close notifications of your script, although I have not been able.
Another option that I would be interested in, would be to be able to modify the text contained in a single notification, with each mode change (maybe with --replace-file?).
I would appreciate any ideas that could help me.
Keep in mind that I am an artist, and I do not know anything about programming.
Thanks for your work and greetings,
Francisco
Comments