baskerville / bspwm

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

Bspwmrc won't run on start #1454

Closed Ouxyre closed 10 months ago

Ouxyre commented 1 year ago

System information:

OS: Arch Linux x86_64 Host: 20KN003XUS ThinkPad E480 Kernel: 6.3.1-zen1-1-zen Uptime: 4 mins Packages: 512 (pacman) Shell: bash 5.1.16 Resolution: 1920x1080 WM: bspwm Theme: Adwaita [GTK2/3] Icons: Adwaita [GTK2/3] Terminal: kitty CPU: Intel i5-8250U (8) @ 3.400GHz GPU: Intel UHD Graphics 620 Memory: 1874MiB / 15758MiB

Yes I have the file marked as executable and so is sxhkd. I tried looking everywhere but I just cannot seem to figure out why it does not run when I log in. I am not aware of any error messages. My session manager is sddm. Below are the files configs

bspwmrc config

#! /bin/sh
pgrep -x sxhkd > /dev/null || sxhkd &

setxkbmap us &
nitrogen --restore
picom 

bspc config border_width         2
bspc config window_gap          12

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

bspc monitor -d I II III IV V VI VII VIII IX X

# bspc rule -a Gimp desktop='^8' state=floating follow=on
# bspc rule -a Chromium desktop='^2'
# bspc rule -a mplayer2 state=floating
# bspc rule -a Kupfer.py focus=on
# bspc rule -a Screenkey manage=off

sddm conf

[Autologin]
# Whether sddm should automatically log back into sessions when they exit
Relogin=false

# Name of session file for autologin session (if empty try last logged in)
Session=

# Username for autologin session
User=

[General]
# Halt command
HaltCommand=/usr/bin/systemctl poweroff

# Input method module
InputMethod=

# Comma-separated list of Linux namespaces for user session to enter
Namespaces=

# Initial NumLock state. Can be on, off or none.
# If property is set to none, numlock won't be changed
# NOTE: Currently ignored if autologin is enabled.
Numlock=none

# Reboot command
RebootCommand=/usr/bin/systemctl reboot

[Theme]
# Current theme name
Current=

# Cursor theme used in the greeter
CursorTheme=

# Number of users to use as threshold
# above which avatars are disabled
# unless explicitly enabled with EnableAvatars
DisableAvatarsThreshold=7

# Enable display of custom user avatars
EnableAvatars=true

# Global directory for user avatars
# The files should be named <username>.face.icon
FacesDir=/usr/share/sddm/faces

# Font used in the greeter
Font=

# Theme directory path
ThemeDir=/usr/share/sddm/themes

[Users]
# Default $PATH for logged in users
DefaultPath=/usr/local/sbin:/usr/local/bin:/usr/bin

# Comma-separated list of shells.
# Users with these shells as their default won't be listed
HideShells=

# Comma-separated list of users that should not be listed
HideUsers=

# Maximum user id for displayed users
MaximumUid=60513

# Minimum user id for displayed users
MinimumUid=1000

# Remember the session of the last successfully logged in user
RememberLastSession=true

# Remember the last successfully logged in user
RememberLastUser=true

# When logging in as the same user twice, restore the original session, rather than create a new one
ReuseSession=true

[Wayland]
# Enable Qt's automatic high-DPI scaling
EnableHiDPI=false

# Path to a script to execute when starting the desktop session
SessionCommand=/usr/share/sddm/scripts/wayland-session

# Directory containing available Wayland sessions
SessionDir=/usr/share/wayland-sessions

# Path to the user session log file
SessionLogFile=.local/share/sddm/wayland-session.log

[X11]
# Path to a script to execute when starting the display server

DisplayCommand=/usr/share/sddm/scripts/Xsetup

# Path to a script to execute when stopping the display server
DisplayStopCommand=/usr/share/sddm/scripts/Xstop

# Enable Qt's automatic high-DPI scaling
EnableHiDPI=false

# The lowest virtual terminal number that will be used.
MinimumVT=1

# Arguments passed to the X server invocation
ServerArguments=-nolisten tcp

# Path to X server binary
ServerPath=/usr/bin/X

# Path to a script to execute when starting the desktop session
SessionCommand=/usr/share/sddm/scripts/Xsession

# Directory containing available X sessions
SessionDir=/usr/share/xsessions

# Path to the user session log file
SessionLogFile=.local/share/sddm/xorg-session.log

# Path to the Xauthority file
UserAuthFile=.Xauthority

# Path to xauth binary
XauthPath=/usr/bin/xauth

# Path to Xephyr binary
XephyrPath=/usr/bin/Xephyr

Sorry for editing so many times, this is my first time posting a issue.

TAforever commented 1 year ago

bspwmrc is a shell script so you have to run your programs in the background so they don't stop the script from running. Put an amersand after nitrogen and picom.

dudeamal commented 1 year ago

Problem is, the rest of the script wont run until picom has exited

Two ways to fix this

  1. Add an ampersand ' & ' after picom, this will make it run in the background.
  2. Use picom's -b flag, which runs it in the background

Both methods work, it's really a matter of preference

#! /bin/sh
pgrep -x sxhkd > /dev/null || sxhkd &

setxkbmap us &
nitrogen --restore &
picom &

bspc config border_width         2
bspc config window_gap          12

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

bspc monitor -d I II III IV V VI VII VIII IX X

bspc rule -a Gimp desktop='^8' state=floating follow=on

And make sure it is executable by running chmod +x ~/.config/bspwm/bspwmrc ( or wherever your rc is located )

dudeamal commented 1 year ago

By the way, feh is a much lightweight solution both for image viewing and wallpapers, after installing it just do feh --bg-fill /path/to/wallpaper or feh --bg-fill -z /path/to/folder for a random wallpaper from a directory