text: Q:
  
  'at' command not working in arch linux
  
  When I schedule a task using at in Arch Linux it doesn't get executed when its time to but it does get removed from the queue.
  Here is an example of me scheduling a task.
  at now + 2 min
  warning: commands will be executed using /bin/sh
  at Thu Jul  2 15:34:00 2020
  at> code
  at> google-chrome-stable
  at> <EOT>
  job 16 at Thu Jul  2 15:34:00 2020
  
  I just want to open a few applications with the at command.
  code is the command that opens up Visual Studio Code.
  google-chrome-stable opens Google Chrome
  Please help!!
  
  A:
  
  I don't use Arch, so I cannot easily test in Arch; but at in my Kubuntu does not retain the value of DISPLAY. The commands you want to run need to display windows, right?
  In my tests an attempt to schedule just kate (GUI text editor) fails. I need to specify DISPLAY:
  at> DISPLAY=:0 kate
  at> <EOT>
  
  Then it works.
  Use the right value (invoking echo "$DISPLAY" before you run at may be helpful). Note this is a solution for X Window System. I'm not familiar with Wayland.
  If you need to run more than one command then remember all input to at creates a script for sh. Make the first line export DISPLAY=:0, like you would do in a script, so the variable affects all lines that follow. Example:
  at> export DISPLAY=:0
  at> code
  at> google-chrome-stable
  at> <EOT>
  
  The following shell function injects the export DISPLAY=… line into code piped to the real at. It obtains the value from the variable existing in the current shell, so it makes at work as if it retained the value of DISPLAY.
  at () { { printf 'export DISPLAY="%s"\n' "$DISPLAY"; cat; } | command at "$@"; }
  
  Use it exactly as you would use at if the problem didn't exist. Your code from the question body should now work.
  
  