I want to start chromium-browser
minimized using bash
in a terminal.
Currently using chromium-browser
to open Chromium. But how to open it as minimized using a bash
command.
Using wmctrl
, (on Debian-based systems install with apt install wmctrl
), to send commands to any NetWM window manager:
chromium-browser && \
last_chrom=$(wmctrl -l |
grep -i chrom | tail -1 |
while read a b ; do echo $a ; done) ; \
wmctrl -ir $last_chrom -b toggle,hidden
How it works:
chromium-browser
in the variable $last_chrom.wmctrl
to hide that window.(Optional) To have the window close after running for a minute, add one more line:
chromium-browser && \
last_chrom=$(wmctrl -l |
grep -i chrom | tail -1 |
while read a b ; do echo $a ; done) ; \
wmctrl -ir $last_chrom -b toggle,hidden ; \
{ sleep 1m && wmctrl -ic $last_chrom ; } &