diff --git a/.config/autorandr/desktop/config b/.config/autorandr/desktop/config new file mode 100644 index 0000000..a48c086 --- /dev/null +++ b/.config/autorandr/desktop/config @@ -0,0 +1,7 @@ +output eDP +mode 1920x1080 +pos 0x0 +primary +output HDMI-A-0 +mode 1920x1080 +pos 1920x0 diff --git a/.config/autorandr/desktop/postswitch b/.config/autorandr/desktop/postswitch new file mode 120000 index 0000000..1a4e529 --- /dev/null +++ b/.config/autorandr/desktop/postswitch @@ -0,0 +1 @@ +/home/ange/bin/wallpaper \ No newline at end of file diff --git a/.config/autorandr/desktop/setup b/.config/autorandr/desktop/setup new file mode 100644 index 0000000..0415911 --- /dev/null +++ b/.config/autorandr/desktop/setup @@ -0,0 +1,2 @@ +HDMI-A-0 00ffffffffffff004c2d200d34415743191e010380341d782a9315a655519c27115054bfef80714f81c0810081809500a9c0b3000101023a801871382d40582c450009252100001e000000fd00324b1e5111000a202020202020000000fc00533234463335300a2020202020000000ff0048345a4e3630323031370a20200114020311b14690041f13120365030c001000011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000051 +eDP 00ffffffffffff0009e5d50800000000231d0104a5221378030b95935c59932a20505400000001010101010101010101010101010101043a803671381e403020360058c21000001a000000000000000000000000000000000000000000fe00424f452043510a202020202020000000fe004e5431353646484d2d4e34330a000e diff --git a/.config/autorandr/laptop/config b/.config/autorandr/laptop/config new file mode 100644 index 0000000..fe5c323 --- /dev/null +++ b/.config/autorandr/laptop/config @@ -0,0 +1,6 @@ +output HDMI-A-0 +off +output eDP +mode 1920x1080 +pos 0x0 +primary diff --git a/.config/autorandr/laptop/postswitch b/.config/autorandr/laptop/postswitch new file mode 120000 index 0000000..1a4e529 --- /dev/null +++ b/.config/autorandr/laptop/postswitch @@ -0,0 +1 @@ +/home/ange/bin/wallpaper \ No newline at end of file diff --git a/.config/autorandr/laptop/setup b/.config/autorandr/laptop/setup new file mode 100644 index 0000000..22d4553 --- /dev/null +++ b/.config/autorandr/laptop/setup @@ -0,0 +1 @@ +eDP 00ffffffffffff0009e5d50800000000231d0104a5221378030b95935c59932a20505400000001010101010101010101010101010101043a803671381e403020360058c21000001a000000000000000000000000000000000000000000fe00424f452043510a202020202020000000fe004e5431353646484d2d4e34330a000e diff --git a/.xinitrc b/.xinitrc index 617fcec..578a819 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,30 +1,16 @@ #!/bin/sh -# display -## laptop -if ls -d /sys/class/power_supply/BAT*/ > /dev/null 2>&1; then - stimeout=300 -else # desktop - stimeout=1800 -fi - -cycle=15 # lock 15 sec after stimeout -dpms="$((stimeout + cycle + 1))" # turn off screen 1 sec after lock - -xset s "$stimeout" "$cycle" & -xset dpms "$dpms" "$dpms" "$dpms" & -feh --bg-fill "$XDG_CONFIG_HOME/wallpapers/mount_cook.jpg" --no-fehbg & -xss-lock -n "feh --fullscreen $XDG_CONFIG_HOME/wallpapers/lock.png" -- lock & - # bar #(i3status | while read line; do xsetroot -name "$line"; done) & # startup +set-display & +xss-lock -n screensaver -- lock & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 || # arch /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 || # debian - /usr/libexec/polkit-gnome-authentication-agent-1 & # fedora -picom & -gammastep 2> /dev/null & -sbar & + /usr/libexec/polkit-gnome-authentication-agent-1 & # fedora +picom & +gammastep 2> /dev/null & +sbar & exec dbus-launch dwm diff --git a/bin/screensaver b/bin/screensaver new file mode 100755 index 0000000..eab5b80 --- /dev/null +++ b/bin/screensaver @@ -0,0 +1,3 @@ +#!/bin/bash + +feh --fullscreen "$XDG_CONFIG_HOME/wallpapers/lock.png" diff --git a/bin/wallpaper b/bin/wallpaper new file mode 100755 index 0000000..1c631d1 --- /dev/null +++ b/bin/wallpaper @@ -0,0 +1,18 @@ +#!/bin/bash + +feh --bg-fill "$XDG_CONFIG_HOME/wallpapers/mount_cook.jpg" --no-fehbg + +NBMON="$(xrandr | grep -c connected)" +BAT="$(ls /sys/class/power_supply/BAT*/ 2> /dev/null)" + +if [ "$NBMON" = 1 ] && [ -n "$BAT" ]; then + stimeout=300 # laptop +else + stimeout=1800 # desktop +fi + +cycle=15 # lock 15 sec after stimeout +dpms="$((stimeout + cycle + 1))" # turn off screen 1 sec after lock + +xset s "$stimeout" "$cycle" +xset dpms "$dpms" "$dpms" "$dpms"