2021-07-02 11:03:09 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# stdin: default config
|
|
|
|
# stdout: modified config
|
2021-07-02 12:50:24 +02:00
|
|
|
set -e
|
2021-07-02 11:03:09 +02:00
|
|
|
|
|
|
|
# save stdin (content of /etc/mkinitcpio.conf) in variable
|
2021-07-02 12:50:24 +02:00
|
|
|
stdin="$(cat)"
|
2021-07-02 11:03:09 +02:00
|
|
|
|
|
|
|
# assert a screenshot for key-combination "Print" exists
|
|
|
|
echo "$stdin" | grep --quiet '^\s*<property name="Print" type="string" value="xfce4-screenshooter"/>\s*$'
|
|
|
|
|
|
|
|
# replace action key-combination "Print"
|
2021-07-02 12:50:24 +02:00
|
|
|
echo "$stdin" | sed 's|<property name="Print" type="string" value="xfce4-screenshooter"/>|<property name="Print" type="string" value="sh -c 'xfce4-screenshooter -f -s "Pictures/$(date +%Y%m%d_%H%M%S).png"'"/>|'
|