Lubuntu 16.04 - Openbox session
I can use the terminal to open a time-stamped file with gedit
:
gedit ~/$(date +%Y%m%d%H%M%S).txt
The command can also be used via a keyboard shortcut in Openbox.
<keybind key="W-4"> # gedit time-stamped file
<action name="Execute"><command>sh -c 'gedit ~/$(date +%Y%m%d%H%M%S).txt'</command></action>
</keybind>
But I can't do the same via the Exec=
line of a .desktop
file.
Exec=sh -c 'gedit ~/$(date +%Y%m%d%H%M%S).txt'
just creates a file called ~/.txt
So how do I get a .desktop file to do what I want?
$()
commands like that. I think you need it to call another script that contains your sub-shell command for opening your file.Exec=/bin/bash -c "echo $(date) > ~/out.txt"
runs fine. the+%Y%m%d%H%M%S
seems to be the issue. still chewing on it.