forked from extern/i3-layout-manager
fixed weird bug with xdotool reporting varying responses
This commit is contained in:
parent
42630ea793
commit
064e139594
@ -134,11 +134,13 @@ if [[ "$ACTION" = "LOAD LAYOUT" ]]; then
|
|||||||
|
|
||||||
for window in $WINDOWS; do
|
for window in $WINDOWS; do
|
||||||
|
|
||||||
HAS_PID=$(xdotool getwindowpid $window 2>&1 | grep "pid" | wc -l)
|
# the grep filters out a line which reports on the command that was just being called
|
||||||
|
# however, the line is not there when calling with rofi from i3
|
||||||
|
HAS_PID=$(xdotool getwindowpid $window 2>&1 | grep -v command | wc -l)
|
||||||
|
|
||||||
echo "Unloading window '$window'" >> "$LOG_FILE"
|
echo "Unloading window '$window'" >> "$LOG_FILE"
|
||||||
|
|
||||||
if [ ! $HAS_PID -eq 0 ]; then
|
if [ $HAS_PID -eq 0 ]; then
|
||||||
echo "Window '$window' does not have a process" >> "$LOG_FILE"
|
echo "Window '$window' does not have a process" >> "$LOG_FILE"
|
||||||
else
|
else
|
||||||
xdotool windowunmap "$window" >> "$LOG_FILE" 2>&1
|
xdotool windowunmap "$window" >> "$LOG_FILE" 2>&1
|
||||||
@ -184,11 +186,14 @@ if [[ "$ACTION" = "LOAD LAYOUT" ]]; then
|
|||||||
|
|
||||||
# and then we can reintroduce the windows back to the workspace
|
# and then we can reintroduce the windows back to the workspace
|
||||||
for window in $WINDOWS; do
|
for window in $WINDOWS; do
|
||||||
HAS_PID=$(xdotool getwindowpid $window 2>&1 | grep "pid" | wc -l)
|
|
||||||
|
# the grep filters out a line which reports on the command that was just being called
|
||||||
|
# however, the line is not there when calling with rofi from i3
|
||||||
|
HAS_PID=$(xdotool getwindowpid $window 2>&1 | grep -v command | wc -l)
|
||||||
|
|
||||||
echo "Loading back window '$window'" >> "$LOG_FILE"
|
echo "Loading back window '$window'" >> "$LOG_FILE"
|
||||||
|
|
||||||
if [ ! $HAS_PID -eq 0 ]; then
|
if [ $HAS_PID -eq 0 ]; then
|
||||||
echo "$window does not have a process" >> "$LOG_FILE"
|
echo "$window does not have a process" >> "$LOG_FILE"
|
||||||
else
|
else
|
||||||
xdotool windowmap "$window"
|
xdotool windowmap "$window"
|
||||||
|
Loading…
Reference in New Issue
Block a user