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 # 120 min suspend
pkill -x swayidle pkill -x swayidle
swayidle -w \ 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" \ resume "$LOCK_CMD on" \
timeout 1800 "$LOCK_CMD off" \ timeout 1800 "$LOCK_CMD off" \
timeout 2700 "$LOCK_CMD lockonly" \ timeout 2700 "$LOCK_CMD lockonly" \

View file

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

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# dependencies # dependencies
# apt install gir1.2-playerctl-2.0 # - gir1.2-playerctl-2.0
import argparse import argparse
import logging import logging
import sys 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 $idle_cmd $HOME/.config/sway/bin/start_swayidle.sh
set $waybar_cmd $HOME/.config/sway/bin/start_waybar.sh set $waybar_cmd $HOME/.config/sway/bin/start_waybar.sh
set $sov_cmd $HOME/.config/sway/bin/start_sov.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 $move_cmd $HOME/.config/sway/bin/sway_move
set $font Cascadia Code PL Regular 10 set $font Cascadia Code PL Regular 10
set $notify_cmd dunstify -r 123 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" bindsym $mod+p exec "$term_cmd $output_cmd"
#
## Lock
#
bindsym $mod+Delete exec $lock_cmd
# #
# Gaps # 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 [title="nmtui"] floating enable
for_window [app_id="nm-connection-editor"] 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 [title="float*"] floating enable
for_window [app_id="pavucontrol"] floating enable for_window [app_id="pavucontrol"] floating enable
for_window [app_id="com.nextcloud.desktopclient.nextcloud"] 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="Plexamp" window_type="normal"] mark s
for_window [class="Ferdium" window_type="normal" window_role="browser-window"] mark z 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="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 # matlab workaround
no_focus [class="MATLAB R2021a" instance="sun-awt-X11-XDialogPeer"] 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: # Status Bar:
# #
exec_always $waybar_cmd exec_always $waybar_cmd
exec_always $sov_cmd
exec_always $idle_cmd
# #
# Autostart # 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 "bash -c 'sleep 10; nextcloud --background'"
exec --no-startup-id dunst exec --no-startup-id dunst
exec --no-startup-id nm-applet --indicator 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-24 "Dell Inc. DELL E2422HS H1VWFM3"
set $extern-29 "Lenovo Group Limited L29w-30 UPV08NFA" set $extern-29 "Lenovo Group Limited L29w-30 UPV08NFA"
set $extern-38 "Goldstar Company Ltd 38GN950 008NTLEFY912" set $extern-38 "Goldstar Company Ltd 38GN950 008NTLEFY912"
set $main DP-10 # set $main DP-10
set $main eDP-1
### Output configuration ### Output configuration
output $intern mode 1920x1080 output $intern mode 1920x1080
output $extern-34 mode 3440x1440 position 0 0 output $extern-34 mode 3440x1440 position 0 0
output $extern-24 mode 1920x1080 position 3440 0 output $extern-24 mode 1920x1080 position 3440 0
output $extern-29 mode 2560x1080 output $extern-29 mode 2560x1080 position 640 0
output $extern-38 mode 3840x1600 output $extern-38 mode 3840x1600 position 0 1080
bindswitch --reload --locked lid:on output $intern disable bindswitch --reload --locked lid:on output $intern disable

View file

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

View file

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