diff --git a/.config/X11/opt-apps b/.config/X11/opt-apps new file mode 100755 index 00000000..8f68f8d9 --- /dev/null +++ b/.config/X11/opt-apps @@ -0,0 +1,12 @@ +#!/bin/sh + +autostart="flameshot nextcloud telegram-desktop headset-charge-indicator spotify ferdium picom discord" + +for program in $autostart; do + pidof -s "$program" || "$program" & +done >/dev/null 2>&1 + +numlockx on & +setxkbmap lv & +xrandr --output DisplayPort-0 --mode 1920x1080 --rate 75 --output HDMI-A-0 --mode 1920x1080 --rate 60 --left-of DisplayPort-0 & +/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc new file mode 100755 index 00000000..aaa7c97c --- /dev/null +++ b/.config/X11/xinitrc @@ -0,0 +1,19 @@ +#!/bin/sh + +# xinitrc runs automatically when you run startx. + +# There are some small but important commands that need to be run when we start +# the graphical environment. There is a link to this file in ~/.xprofile +# because that file is run automatically if someone uses a display manager +# (login screen) and so they are needed there. To prevent doubling up commands, +# I source them here with the line below. + +if [ -f "$XDG_CONFIG_HOME/X11/xprofile" ]; then + . "$XDG_CONFIG_HOME/X11/xprofile" +else + . "$HOME/.xprofile" +fi + +ssh-agent "$WM" + +# exec ssh-agent dbus-launch --sh-syntex --exit-with-session awesome diff --git a/.config/X11/xprofile b/.config/X11/xprofile new file mode 100755 index 00000000..945fa4fc --- /dev/null +++ b/.config/X11/xprofile @@ -0,0 +1,22 @@ +#!/bin/sh + +# This file runs when a DM logs you into a graphical session. +# If you use startx/xinit like a Chad, this file will also be sourced. + +# xrandr --dpi 96 # Set DPI. User may want to use a larger number for larger screens. +setbg & # set the background with the `setbg` script +xrdb "$XDG_CONFIG_HOME/X11/xresources" & +xrdbpid=$! # Uncomment to use Xresources colors/settings on startup +remaps & # run the remaps script, switching caps/esc and more; check it for more info +# ssh-agent dbus-launch --sh-syntex --exit-with-session & + +autostart="pipewire pipewire-pulse wireplumber dunst" + +for program in $autostart; do + pidof -s "$program" || "$program" & +done >/dev/null 2>&1 + +. "$XDG_CONFIG_HOME/X11/opt-apps" + +# Ensure that xrdb has finished running before moving on to start the WM/DE. +[ -n "$xrdbpid" ] && wait "$xrdbpid" diff --git a/.config/sx/sxrc b/.config/sx/sxrc deleted file mode 100755 index c557f527..00000000 --- a/.config/sx/sxrc +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -autostart="pipewire pipewire-pulse wireplumber telegram-desktop flameshot spotify discord nextcloud" - -for program in $autostart; do - pidof -s "$program" || "$program" & -done >/dev/null 2>&1 - -numlockx on & -xinput --set-prop 'COOLERMASTER CM310' 'libinput Accel Speed' -.9 & -xrandr --output DisplayPort-0 --mode 1920x1080 --rate 75 --output HDMI-A-0 --mode 1920x1080 --rate 60 --left-of DisplayPort-0 & -xrdb -load "$XDG_CONFIG_HOME/X11/xresources" & -/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & - -exec dbus-launch --sh-syntax --exit-with-session awesome diff --git a/.config/zsh/.zprofile-X11 b/.config/zsh/.zprofile-X11 index 05f14933..3b9aa28a 100644 --- a/.config/zsh/.zprofile-X11 +++ b/.config/zsh/.zprofile-X11 @@ -1,5 +1,4 @@ #!/bin/zsh -if [ "$(tty)" = "/dev/tty1" ]; then - pgrep awesome || sx -fi +# Start graphical server on user's current tty if not already running. +[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec dbus-launch --sh-syntax --exit-with-session startx "$XINITRC"