eradman/entr

Can't use entr in `.xinitrc`. My system will freeze at X startup. why?

LinArcX opened this issue · 2 comments

Hello.

I want to run this command at the start of my X session:

echo ~/.config/BraveSoftware/Brave-Browser/Default/Bookmarks | entr sh -c "cp /home/linarcx/.config/BraveSoftware/Brave-Browser/Default/Bookmarks /home/linarcx/VoidConf/home/.config/Bookmarks" &

So i put it inside my .xinitrc:

umlockx on &
dunst &
alacritty &
/home/linarcx/brave/brave-browser &
emacsclient -s /var/run/user/1000/emacs/server -c -n -a emacs &
echo ~/.config/BraveSoftware/Brave-Browser/Default/Bookmarks | entr sh -c "cp /home/linarcx/.config/BraveSoftware/Brave-Browser/Default/Bookmarks /home/linarcx/VoidConf/home/.config/Bookmarks" &

session=${1:-i3}
case $session in
  dwm             ) exec dwm;;
  i3|i3wm         ) exec i3;;
  pantheon        ) exec gnome-session --session=pantheon;;
  gnome           ) exec gnome-session;;
  gnome-classic   ) exec gnome-session --session=gnome-classic;;
  deepin          ) exec startdde;;
  xfce|xfce4      ) exec startxfce4;;
  kde             ) exec startkde;;
  cinnamon        ) exec cinnamon-session;;
  mate            ) exec mate-session;;
  stumpwm         ) exec stumpwm;;
  *               ) exec $1;;
esac

The problem is that whenever i run: xinit dwm, the system will freeze and i can't see anything. I don't know why this happens. Any idea?

OS: VoidLinux

WindowsManager: DWM

If you run ps -x do you see entr in the state T (stopped)?

If so you can fix this by adding -n to avoid opening STDIN.

BTW, I could use inotifywait to solve my issue:

while true; do
 inotifywait ~/.config/BraveSoftware/Brave-Browser/Default/Bookmarks >/dev/null 2>&1; cp /home/linarcx/.config/BraveSoftware/Brave-Browser/Default/Bookmarks /home/linarcx/VoidConf/home/.config/Bookmarks
done &