Dotfiles config update (2021-12-12)
This commit is contained in:
parent
64ddcf5829
commit
b59b0c52e1
|
@ -40,8 +40,8 @@ exec --no-startup-id ~/.config/sway/startwlrrandr.sh &
|
|||
# Configure wallpaper
|
||||
exec --no-startup-id "swaybg -i ~/wallpapers/dark-city.jpg -m fill"
|
||||
|
||||
# Configure xscreensaver (don't work on Wayland)
|
||||
exec --no-startup-id "sleep 5 && xscreensaver &"
|
||||
# Start Screensaver (Also Super+Ctrl+Shift+l to poweroff/start screen)
|
||||
exec --no-startup-id ~/.config/sway/startwlrscreensaver.sh
|
||||
|
||||
# Clipboard (Diodon)
|
||||
exec --no-startup-id diodon &
|
||||
|
@ -118,14 +118,14 @@ bindsym $mod+Ctrl+Shift+l exec --no-startup-id $swaylockwall
|
|||
|
||||
# close session
|
||||
#bindsym Mod1+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||
bindsym Mod1+Shift+e exec "swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'swaymsg exit'"
|
||||
bindsym Mod1+Shift+e exec "swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit Sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'"
|
||||
|
||||
# shutdown / restart / suspend...
|
||||
set $mode_system System (l) lock, (e) logout, (r) reboot, (CTRL+s) shutdown
|
||||
|
||||
mode "$mode_system" {
|
||||
bindsym l exec --no-startup-id $swaylockwall, mode "default"
|
||||
bindsym e exec --no-startup-id i3-msg exit, mode "default"
|
||||
bindsym e exec --no-startup-id swaymsg exit, mode "default"
|
||||
bindsym r exec --no-startup-id /sbin/reboot, mode "default"
|
||||
bindsym Ctrl+s exec --no-startup-id /sbin/poweroff, mode "default"
|
||||
|
||||
|
|
|
@ -1,19 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
###############################################################
|
||||
# down-daemon (down-screen) - Daemon to shutdown the screen #
|
||||
# Date: 19-11-2020 #
|
||||
######################################################
|
||||
# down-screen - Script for sleep and resume monitors #
|
||||
# Date: 12-12-2021 #
|
||||
# Author: q3aql #
|
||||
# Contact: q3aql@duck.com #
|
||||
###############################################################
|
||||
VERSION="1.0"
|
||||
M_DATE="191120"
|
||||
######################################################
|
||||
|
||||
# Variable
|
||||
endProcess=0
|
||||
# Load script for sleep and resume monitors
|
||||
LoadScriptScreensaver="${HOME}/.config/sway/startwlrscreensaver.sh"
|
||||
|
||||
# Run screensaver
|
||||
sleep 3
|
||||
echo "* Forcing screen to shutdown..."
|
||||
#xset dpms force off
|
||||
xscreensaver-command -prev
|
||||
# Create or read init file
|
||||
stateFile="${HOME}/.config/sway/screen-state"
|
||||
if [ -f ${stateFile} ] ; then
|
||||
echo "Screen State file detected"
|
||||
else
|
||||
echo "resume" > ${stateFile}
|
||||
fi
|
||||
|
||||
# Boot parameters
|
||||
current_state=$(cat ${stateFile})
|
||||
if [ "${current_state}" == "resume" ] ; then
|
||||
bash "${LoadScriptScreensaver}" sleep
|
||||
echo "sleep" > ${stateFile}
|
||||
elif [ "${current_state}" == "sleep" ] ; then
|
||||
bash "${LoadScriptScreensaver}" resume
|
||||
echo "resume" > ${stateFile}
|
||||
fi
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
scan_rel=0
|
||||
# Ignore sleep when run script from startwlrscreensaver.sh
|
||||
if [ "${1}" == "screensaver" ] ; then
|
||||
echo "Load monitor configuration quickly"
|
||||
else
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
#while [ ${scan_rel} -eq 0 ] ; do
|
||||
# Primer monitor
|
||||
#wlr-randr --output DP-1 --custom-mode 1280x1024@75Hz --pos 288,0
|
||||
# Segundo monitor
|
||||
#wlr-randr --output DP-2 --custom-mode 1280x1024@75Hz --transform 90 --pos 1568,0
|
||||
#sleep 2
|
||||
#done
|
||||
sleep 2
|
||||
# Configuration for your monitor(s). Use wlr-randr and/or wdisplays for help
|
||||
wlr-randr --output DP-1 --custom-mode 1280x1024@75Hz --pos 288,0
|
||||
wlr-randr --output DP-2 --custom-mode 1280x1024@75Hz --transform 90 --pos 1568,0
|
||||
|
|
76
.config/sway/startwlrscreensaver.sh
Executable file
76
.config/sway/startwlrscreensaver.sh
Executable file
|
@ -0,0 +1,76 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Basic configuration variables
|
||||
ScreensaverTime="900" # 15 minutes
|
||||
monitorOne="DP-1" # First monitor
|
||||
monitorTwo="DP-2" # Second monitor
|
||||
monitorThree="" # Third monitor
|
||||
|
||||
# Load script for load monitors config quickly from resume
|
||||
LoadConfigResume="${HOME}/.config/sway/startwlrrandr.sh"
|
||||
|
||||
# Function for sleep monitors
|
||||
function sleepMonitors() {
|
||||
# Check monitor 3
|
||||
if [ -z "${monitorThree}" ] ; then
|
||||
echo "Monitor 3 is empty or disabled"
|
||||
else
|
||||
echo "Sleep monitor 3"
|
||||
wlr-randr --output ${monitorThree} --off
|
||||
fi
|
||||
# Check monitor 2
|
||||
if [ -z "${monitorTwo}" ] ; then
|
||||
echo "Monitor 2 is empty or disabled"
|
||||
else
|
||||
echo "Sleep monitor 2"
|
||||
wlr-randr --output ${monitorTwo} --off
|
||||
fi
|
||||
# Check monitor 1
|
||||
if [ -z "${monitorOne}" ] ; then
|
||||
echo "Monitor 1 is empty or disabled"
|
||||
else
|
||||
echo "Sleep monitor 1"
|
||||
wlr-randr --output ${monitorOne} --off
|
||||
fi
|
||||
}
|
||||
|
||||
# Function for resume monitors
|
||||
function resumeMonitors() {
|
||||
# Check monitor 3
|
||||
if [ -z "${monitorThree}" ] ; then
|
||||
echo "Monitor 3 is empty or disabled"
|
||||
else
|
||||
echo "Resume monitor 3"
|
||||
wlr-randr --output ${monitorThree} --on
|
||||
fi
|
||||
# Check monitor 2
|
||||
if [ -z "${monitorTwo}" ] ; then
|
||||
echo "Monitor 2 is empty or disabled"
|
||||
else
|
||||
echo "Resume monitor 2"
|
||||
wlr-randr --output ${monitorTwo} --on
|
||||
fi
|
||||
# Check monitor 1
|
||||
if [ -z "${monitorOne}" ] ; then
|
||||
echo "Monitor 1 is empty or disabled"
|
||||
else
|
||||
echo "Resume monitor 1"
|
||||
wlr-randr --output ${monitorOne} --on
|
||||
fi
|
||||
# Load monitors config quickly
|
||||
bash ${LoadConfigResume} screensaver
|
||||
}
|
||||
|
||||
# Boot parameters
|
||||
if [ -z "${1}" ] ; then
|
||||
# Kill previous process
|
||||
echo "Trying to kill previous process"
|
||||
killall -9 swayidle
|
||||
# Init swayidle command
|
||||
swayidle timeout ${ScreensaverTime} "bash ${0} sleep" resume "bash ${0} resume"
|
||||
elif [ "${1}" == "sleep" ] ; then
|
||||
sleepMonitors
|
||||
elif [ "${1}" == "resume" ] ; then
|
||||
resumeMonitors
|
||||
fi
|
||||
|
|
@ -135,7 +135,7 @@ My list of extra combinations:
|
|||
- Volume-Down = Volume -5
|
||||
- VolumeMute = Mute Volume
|
||||
- Super + Ctrl + Shift + e = Poweroff screen
|
||||
- Super + Shit + e = Logout
|
||||
- Super + Shift + e = Logout
|
||||
- Super + Backspace = Open menu Logout/Lock/Reboot/Shutdown
|
||||
|
||||
### External links:
|
||||
|
|
|
@ -124,7 +124,7 @@ My list of extra combinations:
|
|||
- Volume-Down = Volume -5
|
||||
- VolumeMute = Mute Volume
|
||||
- Super + Ctrl + Shift + e = Poweroff screen
|
||||
- Super + Shit + e = Logout
|
||||
- Super + Shift + e = Logout
|
||||
- Super + Backspace = Open menu Logout/Lock/Reboot/Shutdown
|
||||
|
||||
### External links:
|
||||
|
|
|
@ -123,7 +123,7 @@ My list of extra combinations:
|
|||
- Volume-Down = Volume -5
|
||||
- VolumeMute = Mute Volume
|
||||
- Super + Ctrl + Shift + e = Poweroff screen
|
||||
- Super + Shit + e = Logout
|
||||
- Super + Shift + e = Logout
|
||||
- Super + Backspace = Open menu Logout/Lock/Reboot/Shutdown
|
||||
|
||||
### External links:
|
||||
|
|
|
@ -74,11 +74,23 @@ dotfiles - My tiling sway configuration (for Devuan/Debian)
|
|||
* Use the command `wlr-randr` for show your config & edit the file `~/.config/sway/startwlrrandr.sh`:
|
||||
|
||||
```shell
|
||||
sleep 2
|
||||
wlr-randr --output DP-1 --custom-mode 1280x1024@75Hz --pos 288,0
|
||||
wlr-randr --output DP-2 --custom-mode 1280x1024@75Hz --transform 90 --pos 1568,0
|
||||
````
|
||||
|
||||
* **`Screensaver:`**
|
||||
|
||||
* The configuration file use my monitor configuration and set the time in 15 minutes:
|
||||
* Use the command `wlr-randr` for show your monitors & edit the file `~/.config/sway/startwlrscreensaver.sh`:
|
||||
|
||||
```shell
|
||||
# Basic configuration variables
|
||||
ScreensaverTime="900" # 15 minutes
|
||||
monitorOne="DP-1" # First monitor
|
||||
monitorTwo="DP-2" # Second monitor
|
||||
monitorThree="" # Third monitor
|
||||
````
|
||||
|
||||
* **`Wallpaper:`**
|
||||
|
||||
* By default, the config load wallpaper on `~/wallpapers/dark-city.jpg`:
|
||||
|
@ -123,8 +135,8 @@ My list of extra combinations:
|
|||
- Volume-Up = Volume +5
|
||||
- Volume-Down = Volume -5
|
||||
- VolumeMute = Mute Volume
|
||||
- Super + Ctrl + Shift + e = Poweroff screen
|
||||
- Super + Shit + e = Logout
|
||||
- Super + Ctrl + Shift + l = Poweroff/Start screen (Screensaver step needed)
|
||||
- Super + Shift + e = Logout
|
||||
- Super + Backspace = Open menu Logout/Reboot/Shutdown
|
||||
|
||||
### External links:
|
||||
|
|
Loading…
Reference in New Issue
Block a user