sway: update some things

This commit is contained in:
Konstantin Koslowski 2023-12-20 07:58:49 +01:00
parent 5c1bfb269d
commit dc5511aae9
7 changed files with 36 additions and 18 deletions

View file

@ -11,7 +11,7 @@ SUS_CMD="$HOME/.config/sway/bin/sway_suspend"
# 120 min suspend
pkill -x swayidle
swayidle -w \
timeout 1500 "$TERM_CMD bash -c 'dunstify -r 125 -t 300 display\ will\ turn\ off\ soon'" \
timeout 1500 "$TERM_CMD bash -c 'dunstify -r 123 -u critical -t 300 display\ will\ turn\ off\ soon'" \
resume "$LOCK_CMD on" \
timeout 1800 "$LOCK_CMD off" \
timeout 2700 "$LOCK_CMD lockonly" \

View file

@ -3,30 +3,38 @@ source $HOME/.config/sway/bin/sway_helpers
DEVICE=sysfs/backlight/intel_backlight
NOTIFY_APP="dunstify -a brightness -h string:x-dunst-stack-tag:brightness"
ICON=$HOME/.local/share/icons/Tela-circle-dark/16/panel/xfpm-brightness-lcd.svg
APP="/usr/bin/light -s $DEVICE"
APP="/usr/bin/brightnessctl"
APP_INC="$APP s 10%+"
APP_DEC="$APP s 10%-"
PRG1="●"
PRG2="◌"
function _get_br() {
$APP | grep -oE '[0-9]*%' | sed 's/%//g'
}
## main
_log BRIGHTNESS INFO args: $*
_check_app $APP
case $1 in
d*)
$APP -U 10
BR=$($APP)
$APP_DEC &> /dev/null
BR=$(_get_br)
echo $BR
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
;;
i*)
$APP -A 10
BR=$($APP)
$APP_INC &> /dev/null
BR=$(_get_br)
echo $BR
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
;;
"-h"|"--help")
echo "arguments: [decrease|increase]"
;;
*)
BR=$($APP)
BR=$($APP_BR)
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
;;
esac

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# dependencies
# apt install gir1.2-playerctl-2.0
# - gir1.2-playerctl-2.0
import argparse
import logging
import sys

14
config
View file

@ -24,6 +24,7 @@ set $media_cmd /usr/bin/playerctl
set $idle_cmd $HOME/.config/sway/bin/start_swayidle.sh
set $waybar_cmd $HOME/.config/sway/bin/start_waybar.sh
set $sov_cmd $HOME/.config/sway/bin/start_sov.sh
set $lock_cmd $HOME/.config/sway/bin/sway_lock lock
set $move_cmd $HOME/.config/sway/bin/sway_move
set $font Cascadia Code PL Regular 10
set $notify_cmd dunstify -r 123
@ -217,6 +218,11 @@ bindsym $mod+Print exec grim -g "$(slurp)" \
#
bindsym $mod+p exec "$term_cmd $output_cmd"
#
## Lock
#
bindsym $mod+Delete exec $lock_cmd
#
# Gaps
#
@ -332,6 +338,7 @@ bindsym $mod+o exec $notify_cmd "mode: move-workspace"; mode "move-workspace"
#
for_window [title="nmtui"] floating enable
for_window [app_id="nm-connection-editor"] floating enable
for_window [app_id="evolution-alarm-notify"] floating enable
for_window [title="float*"] floating enable
for_window [app_id="pavucontrol"] floating enable
for_window [app_id="com.nextcloud.desktopclient.nextcloud"] floating enable
@ -349,7 +356,7 @@ for_window [title="fzf"] floating enable
for_window [class="Plexamp" window_type="normal"] mark s
for_window [class="Ferdium" window_type="normal" window_role="browser-window"] mark z
for_window [class="Signal" window_type="normal" window_role="browser-window"] mark x
for_window [class="Microsoft Teams - Preview" window_type="normal"] mark c
for_window [class="Chromium" instance="crx_cifhbcnohmdccbgoicgdjpfamggdegmo" window_type="normal"] mark c
# matlab workaround
no_focus [class="MATLAB R2021a" instance="sun-awt-X11-XDialogPeer"]
@ -357,12 +364,13 @@ no_focus [class="MATLAB R2021a" instance="sun-awt-X11-XDialogPeer"]
# Status Bar:
#
exec_always $waybar_cmd
exec_always $sov_cmd
exec_always $idle_cmd
#
# Autostart
#
exec_always $idle_cmd
exec_always $sov_cmd
exec_always systemctl --user start sway-session.target
exec "bash -c 'sleep 10; nextcloud --background'"
exec --no-startup-id dunst
exec --no-startup-id nm-applet --indicator

View file

@ -5,14 +5,15 @@ set $extern-34 "Dell Inc. DELL U3421WE 6YR9753"
set $extern-24 "Dell Inc. DELL E2422HS H1VWFM3"
set $extern-29 "Lenovo Group Limited L29w-30 UPV08NFA"
set $extern-38 "Goldstar Company Ltd 38GN950 008NTLEFY912"
set $main DP-10
# set $main DP-10
set $main eDP-1
### Output configuration
output $intern mode 1920x1080
output $extern-34 mode 3440x1440 position 0 0
output $extern-24 mode 1920x1080 position 3440 0
output $extern-29 mode 2560x1080
output $extern-38 mode 3840x1600
output $extern-29 mode 2560x1080 position 640 0
output $extern-38 mode 3840x1600 position 0 1080
bindswitch --reload --locked lid:on output $intern disable

View file

@ -5,7 +5,7 @@
// green #b8bb26
{
"layer": "top",
"height": 25,
"height": 26,
"modules-left": [
"sway/workspaces",
"custom/separator#left",
@ -26,7 +26,9 @@
"network#wl0",
"custom/separator#center",
"cpu",
"custom/separator#center",
"memory",
"custom/separator#center",
"temperature",
"custom/separator#space",
"custom/separator#center",
@ -42,7 +44,6 @@
"format": " "
},
"custom/separator#center": {
// "format": "<span foreground='#268bd2'></span>"
"format": "<span foreground='#268bd2'>|</span>"
},
"custom/separator#right": {
@ -83,7 +84,7 @@
},
"clock": {
"format": "<span foreground='#ebdbb2'></span>{: %b %d, %H:%M}",
"on-click": "foot -T float khal interactive"
// "on-click": "foot -T float khal interactive"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span>{usage:3}%",

View file

@ -10,7 +10,7 @@
border: none;
border-radius: 0;
font-family: "Cascadia Code PL", "Material Icons";
font-size: 13px;
font-size: 13.5px;
min-height: 0;
}