baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.72k stars 416 forks source link

bspwm can't quit after closing laptop lid? #646

Open gamehelp16 opened 7 years ago

gamehelp16 commented 7 years ago

Everytime after suspending my laptop by closing its lid and then resuming by opening the lid again somehow bspwm can't quit and I have to turn off my laptop by force by holding the power button. When I try to power off or quit bspwm, polybar (usually) will disappear but the background image will stay and it just stays so.

0x647262 commented 7 years ago

What do your configs look like?

I'm having no problems opening and closing my laptop lid with the latest git version.

gamehelp16 commented 7 years ago

Just to clarify there is no problem with suspending and resuming by closing/opening the laptop lid itself. The problem occurs when resuming after doing the suspend and I try to power off the laptop then bspwm won't quit. Hope this explains.

0x647262 commented 7 years ago

Sorry, I jumped the gun a bit on that one.

How are you powering down your system? A script? Poweroff? Shutdown?

gamehelp16 commented 7 years ago

sudo poweroff, but bspwm also won't quit using bspc quit.

0x647262 commented 7 years ago

Alright few questions:

  1. What are your system specs? Laptop model should be sufficient.

  2. Still running Arch? If so, which kernel are you using?

  3. Which version of bspwm are you using? (git master, 0.9.2, something else?)

  4. How do you start bspwm? What do your configurations for it look like?

gamehelp16 commented 7 years ago
  1. Asus A456U
  2. I actually have never installed arch, not sure why you thought so. Current kernel version: 4.10.14-200.fc25.x86_64 (I discovered the bug some time ago and I have done a couple of kernel updates since then but the bug still persists)
  3. 0.9.1-100-g64339f8
  4. I use lightdm to launch bspwm.

Here's my bspwmrc:

#! /bin/sh

sxhkd &

bspc monitor -d web term chat code music 6 7 

bspc config border_width         0 
bspc config window_gap           37 

bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true

bspc desktop ^1 -l monocle

bspc rule -a Gimp desktop=^8 state=floating follow=on
bspc rule -a Google-chrome desktop=^1
bspc rule -a Genymotion desktop=^3
bspc rule -a TelegramDesktop desktop=^3
bspc rule -a Subl desktop=^4
bspc rule -a Spotify desktop=^5
bspc rule -a Lmms desktop=^5
bspc rule -a mplayer2 state=floating
bspc rule -a Gedit state=floating
bspc rule -a Eog state=floating
bspc rule -a Nautilus state=floating desktop=^6
bspc rule -a File-roller state=floating
bspc rule -a Gnome-system-monitor state=floating
bspc rule -a XaoS state=floating

bspc config super mod4
bspc config pointer_action1 move
bspc config pointer_action2 none
bspc config pointer_action3 resize_corner
bspc config click_to_focus true

bspc config presel_feedback_color \#aaaaaa

xsetroot -cursor_name left_ptr
xinput set-prop "Asus TouchPad" "libinput Tapping Enabled" 1

feh --randomize --bg-fill ~/Pictures/dark
compton --config ~/compton.conf -b
xrdb -merge ~/.Xdefaults
redshift &

polybar top &
0x647262 commented 7 years ago

I actually have never installed arch, not sure why you thought so.

I assumed since you forked: https://github.com/gamehelp16/dotfiles

Try running bspwm without lightdm (using startx) and see if the problem persists.

gamehelp16 commented 7 years ago

Yeah, the problem still persists after running bspwm using startx. I'm starting to think if this is a problem with Xorg instead of bspwm itself :thinking:

msteen commented 7 years ago

I had a similar problem and when this happened I looked at the output of ps aux | grep bspwm and I noticed my xsession was still running. I still use bspc quit 0 for the restart loop, but when I really want to kill bspwm including its session I use the following script:

#!/usr/bin/env bash

if zenity --question --title='Quit bspwm?' --ok-label='Quit' \
  --text='Are you sure you want to quit bspwm?'; then
  # https://bbs.archlinux.org/viewtopic.php?pid=654186#p654186
  for wid in $(bspc query -N); do
    bspc window $wid --close
  done
  bspc quit ${1:-1}
  # https://askubuntu.com/questions/180628/how-can-i-logout-from-the-gui-using-cli
  kill -- -1
fi

PS: The script needs to run as a regular user, not as root, otherwise the kill call will kill more than you would want it to.