Skip to content

Commit

Permalink
fix: Some sway and way-display fixes
Browse files Browse the repository at this point in the history
- Apparently way-display fails at first start due to:
  alex-courtis/way-displays#171
  so we do another `way-display -g` at start-up to really
  trigger the display reordering etc.
  • Loading branch information
gabyx committed Jun 12, 2024
1 parent 7a862ea commit 65347b7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/dot_config/sway/config
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ set $term-start ~/.config/sway/scripts/start-term.sh
# on the original workspace that the command was run on.

set $file-manager kitty -- zsh "-c" "lf"
set $display-manager way-displays
set $launcher-menu ~/.config/rofi/show-launcher-menu.sh
set $power-menu ~/.config/rofi/show-power-menu.sh
set $wireless-menu ~/.config/rofi/show-network-menu.sh --wireless
Expand Down Expand Up @@ -88,6 +89,7 @@ set $comm-ws 7:7: 
set $ws-7 7:7: 
set $comm signal-desktop
set $comm-matrix element-desktop
set $comm-slack slack

set $mail-ws 8:8: 
set $ws-8 8:8: 
Expand Down
6 changes: 5 additions & 1 deletion config/dot_config/sway/config-applications
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

assign [class="(?i).*chrome.*"] $web-ws
assign [app_id="(?i).*firefox.*"] $web-ws
assign [class="(?i).*signal.*"] $comm-ws

assign [app_id="(?i).*evolution.*"] $mail-ws

assign [class="(?i).*signal.*"] $comm-ws
assign [class="(?i).*slack.*"] $comm-ws
assign [class="(?i).*element.*"] $comm-ws

assign [class="(?i).*bitwarden.*"] $creds-ws

# Set floating mode for generated windows
Expand Down
3 changes: 2 additions & 1 deletion config/dot_config/sway/config-startup
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
### Startup ===================================================================
exec_always --no-startup-id flashfocus

exec way-displays
exec $display-manager 2>&1 ~/.way-displays.log
exec $notifications
exec $mail
exec $web
exec $comm
exec $comm-matrix
exec $comm-slack
exec $creds
exec $nightshifter

Expand Down
6 changes: 6 additions & 0 deletions config/dot_config/sway/scripts/executable_start-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@ swaymsg "workspace \$ws-3; exec \$term-start Main-1 \$term-start-cmd"
swaymsg "workspace \$ws-4; exec \$term-start Main-2 \$term-start-cmd"
swaymsg "workspace \$ws-1; exec \$term-start NixOS \$term-start-cmd"

echo "Start 'way-displays -g' to reassign the workspaces if needed."
echo "Somehow 'way-displays' crashed on start-up sometimes and this helps."
# See: https://github.com/alex-courtis/way-displays/issues/171
sleep 1
swaymsg exec "\$display-manager -g"

echo "Finished"
2 changes: 2 additions & 0 deletions config/dot_config/way-displays/cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ORDER:
#
# Laptop Monitor comes always last.
- "!^Tianma.*TL140ADXP24.*" # Internal monitor.
- "eDP-1"

# Enable scaling, overrides AUTO_SCALE and SCALE
SCALING: TRUE
Expand Down Expand Up @@ -55,6 +56,7 @@ MODE:
- NAME_DESC: "!^Tianma.*TL140ADXP24.*" # Tuxedo - Internal
WIDTH: 1920
HEIGHT: 1200
HZ: 120

# Rotate or translate the display.
# 90, 180, 270, FLIPPED, FLIPPED-90, FLIPPED-180, FLIPPED-270
Expand Down
1 change: 1 addition & 0 deletions config/dot_config/waybar/config
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
},

"sway/workspaces": {
"window-rewrite": {},
"all-outputs": false,
"disable-scroll": false,
"smooth-scrolling-threshold": 10,
Expand Down

0 comments on commit 65347b7

Please sign in to comment.