kanshi, python swayidle, zsh title

This commit is contained in:
2021-07-18 13:34:20 +02:00
parent a6f071cce2
commit 5a57229dc9
17 changed files with 178 additions and 30 deletions

View File

@ -1,7 +1,6 @@
#!/usr/bin/env bash
swaylock --daemonize \
--indicator-radius 100 \
swaylock --indicator-radius 100 \
--indicator-thickness 12 \
--ring-color 2E3440 \
--key-hl-color ECEFF4 \

68
.config/sway/bin/swayidle-conf Executable file
View File

@ -0,0 +1,68 @@
#!/usr/bin/python3
import yaml
import sys
import os
config_files = [
'/etc/sway/idle.yml',
os.path.expanduser('~/.config/sway/idle.yml'),
]
env_config = os.environ.get('SWAYIDLE_CONFIG')
if env_config is not None:
config_files += env_config
options = {
'debug': '-d',
'wait': '-w',
}
config = {}
found = False
for f in config_files:
if not os.path.isfile(f):
continue
found = True
try:
with open(f) as conf:
newconf = yaml.load(conf, yaml.SafeLoader)
config.update(newconf)
except Exception as e:
sys.stderr('{}: Could not load {} ({})'.format(sys.argv[0], f, e))
sys.stderr.flush()
if not found:
sys.stderr('{}: WARNING: No config file found'.format(sys.argv[0]))
sys.stderr.flush()
args = ['swayidle']
for k in config:
c = config[k]
if c is None or c is False or c is []:
continue
if k == 'timeouts':
for t in c:
args.append('timeout')
args.append(str(t['timeout']))
args.append(t['command'])
if 'resume' in t:
args.append('resume')
args.append(t['resume'])
continue
if k in options and c:
args.append(options[k])
continue
args.append(k)
args.append(c)
args.extend(sys.argv[1:])
os.execvp('swayidle', args)

11
.config/sway/idle.yml Normal file
View File

@ -0,0 +1,11 @@
---
debug: false
wait: true
timeouts:
- timeout: 300
command: 'swaylock -f -c 000000'
- timeout: 600
command: 'swaymsg "output * dpms off"'
resume: 'swaymsg "output * dpms on"'
before-sleep: 'swaylock -f -c 000000'

View File

@ -1,2 +1,6 @@
#general
set $BIN_DIR ~/.config/sway/bin
set $BIN_DIR ~/.config/sway/bin
set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable

View File

@ -27,4 +27,4 @@ client.unfocused $color2 $background $color1 $color2 $color2
client.urgent $foreground $background $color7 $foreground $foreground
output * bg ~/Wallpapers/deusex.jpg fill
# output * bg ~/Wallpapers/deusex.jpg fill

View File

@ -7,19 +7,19 @@
output "eDP-1" {
mode 1920x1080@60Hz
pos 1920 0
transform normal
}
output "DP-3" {
mode 1920x1080@60Hz
pos 3840 0
transform normal
}
output "DP-4" {
mode 1920x1080@60Hz
pos 0 0
transform normal
}
# output "eDP-1" {
# mode 1920x1080@60Hz
# pos 1920 0
# transform normal
# }
# output "DP-3" {
# mode 1920x1080@60Hz
# pos 3840 0
# transform normal
# }
# output "DP-4" {
# mode 1920x1080@60Hz
# pos 0 0
# transform normal
# }

View File

@ -138,6 +138,8 @@ mode "resize" {
}
bindsym $mod+r mode "resize"
## Lock screen
bindsym $mod+z exec ~/.config/sway/bin/lock.sh
## Screenshot // Screenshot active display // <Print> ##
#bindsym Print exec $BIN_DIR/screenshots.sh display
@ -172,12 +174,23 @@ bindsym --locked XF86AudioMute exec volumectl toggle
## Modify // Mic mute // <XF86AudioMicMute> ##
bindsym --locked XF86AudioMicMute exec amixer -D pulse sset Capture toggle && notify-send -t 1000 "Microphone state toggled"
bindsym XF86AudioPlay exec volumectl down
# bindsym XF86AudioRaiseVolume exec volumectl raise
# bindsym XF86AudioLowerVolume exec volumectl lower
# bindsym XF86AudioMute exec volumectl mute
# bindsym XF86AudioMicMute exec volumectl mute --mic
# bindsym XF86MonBrightnessUp exec lightctl raise
# bindsym XF86MonBrightnessDown exec lightctl lower
## Notifications // Dismiss notification // <Alt><Space> ##
bindsym $alt+space exec makoctl dismiss
## Notifications // Dismiss all notifications // <Shift><Alt><Space> ##
bindsym Shift+$alt+space exec makoctl dismiss --all
## Launch // Screen sharing // <> x ##
bindsym $mod+x exec $BIN_DIR/dmenuscreenshare.sh

View File

@ -2,6 +2,8 @@ exec --no-startup-id swaymsg 'workspace 1; exec $TERMINAL; workspace 2; exec bra
exec wl-paste -t text --watch clipman store
exec nm-applet --indicator
exec blueman-applet
set $gnome-schema org.gnome.desktop.interface
exec_always {