[Linux Mint 20 Mate]
[Dell Vostro 5590 Laptop]
This is a bit of a strange situation, but my code seems to freeze at a certain point, and is only able to continue if I run another copy of itself in a different terminal.
I've had a bit of trouble with running certain programs in full screen mode, so to make a kind of "pseudo-fullscreen" I wrote a script that hides window decoration and my panels, or toggles them back on, and is triggered by pressing Super+F. It works for the most part, but when I press it once, it just hides the window decoration, and I have to press it a second time for it to hide the panels. Same with restoring everything; I have to press it twice. Not a huge inconvenience, but I really want to understand *why* my code does what it does.
Code:
#!/bin/bash
state=`dconf read /org/mate/panel/toplevels/toplevel-0/auto-hide`;
echo $state
if [[ $state == false ]]; then # panels are visible
# hide panels
echo "1a";
gtk-window-decorator --replace --minimal;
echo "1b";
dconf write /org/mate/panel/toplevels/bottom/auto-hide true;
echo "1c";
dconf write /org/mate/panel/toplevels/toplevel-0/auto-hide true;
echo "1d";
else
# show panels
echo "2a";
gtk-window-decorator --replace;
echo "2b";
dconf write /org/mate/panel/toplevels/bottom/auto-hide false;
echo "2c";
dconf write /org/mate/panel/toplevels/toplevel-0/auto-hide false;
echo "2d";
fi
echo "Done!"
(I put in a bunch of "echo" commands to let me know exactly where the code freezes.)
I ran the command from a terminal, and it hid the window decor and printed "1a" but then stopped. I ran it again in a second terminal window, and that too printed "1a" and stopped, but the original terminal finished and printed "Done!" Running it a third time caused it to un-hide the window decor and print "2a", but then it stopped while the second terminal finished and printed "Done!" Ran it again in the second terminal and the first one finished restoring the panels, but then the second one was stuck at "2a".
I assume the same thing is happening when I press the key combo; the output just doesn't display anywhere I can see it. What on earth is going on?