summaryrefslogtreecommitdiff
path: root/x11/.xprofile
blob: 474b2b01ee178963f7120440c343bec5eb6ceb4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

# This file runs when a DM logs you into a graphical session.
# If you use startx/xinit this file will also be sourced.

xrdb "$HOME/.Xresources"
xrdbpid=$!

# Ensure that xrdb has finished running
[ -n "$xrdbpid" ] && wait "$xrdbpid"

# HiDPI scaling
if [ "$(xdpyinfo | awk '/dimensions/ {print $2}')" == '3840x2160' ]; then
	xrdb -merge <<< "Xft.dpi: 192"
	xrdb -merge <<< "*.font: monospace:size=12"
fi

# generate configs with colors from .Xresources
mkdir -pv "$HOME/.config/zathura" && "$HOME/.local/bin/genzathurarc" > "$HOME/.config/zathura/zathurarc"
mkdir -pv "$HOME/.config/dunst" && "$HOME/.local/bin/gendunstrc" > "$HOME/.config/dunst/dunstrc"

"$HOME/.local/bin/setbg"

"$HOME/.local/bin/remaps"

autostart=(
	"xcompmgr"
	"mpd"
	"dunst"
	"unclutter"
	"syncthing --no-browser"
	"redshift -l40:2"
	"slstatus"
)

for program in "${autostart[@]}" ; do
	pidof -s "${program%% *}" || setsid -f $program
done >"$XDG_CACHE_HOME/xprofile.errors" 2>&1

"$HOME/.local/bin/startxautolock"
"$HOME/.local/bin/sb-mpdup"

xset b off

gentoo-pipewire-launcher restart &

if [ -x /usr/bin/gpg-agent ]; then
	eval "$(/usr/bin/gpg-agent --daemon)"
fi