Еще один (портативный) способ отредактировать оперативный файл состоит в том, чтобы использовать ed
.
# cf. http://wiki.bash-hackers.org/howto/edit-ed
cat <<-'EOF' | ed -s messages.txt
H
,g/a/s//b/g
wq
EOF
# ... or read the file contents into a variable, modify it and write it back to file
file_contents="$(cat messages.txt)"
printf '%s' "$file_contents" | sed -e 's/a/b/g' > messages.txt
# ... and, if you want to play around with a file descriptor hack, ...
# (As long as there's a fd associated with a file, the file can be accessed via the fd.)
exec 3<messages.txt # open file on fd 3 for reading
rm -f messages.txt
sed -e 's/a/b/g' <&3 > messages.txt
Аппаратные триггеры, такие как закрытие/открытие крышки могут интерпретироваться и управляться Вашей Настольной средой, но так как Вы не можете найти, что что-либо имело отношение в конфигурации Xfce, это могло означать, что они обрабатываются универсальным способом - acpid
демон. Изучите файлы под /etc/acpi/
. Вы можете grep для "крышки" там (выполненный grep -iR lid /etc/acpi/
).
$ xfce4-keyboard-settings
как обычный пользователь Удалите следующую строку:
«xfce4-display-settings --minimal XF86Display»