From 2a3dda49dfd0faae1cbe9dbea14bf0d40623bd6a Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Wed, 3 May 2023 23:18:40 +0200 Subject: . --- sway/config | 16 ++++++++++++---- sway/init.sh | 32 ++++++-------------------------- sway/outputs | 27 --------------------------- sway/swayidle.sh | 4 ++++ sway/terminal.sh | 32 +++++++++++++++----------------- 5 files changed, 37 insertions(+), 74 deletions(-) delete mode 100644 sway/outputs create mode 100755 sway/swayidle.sh (limited to 'sway') diff --git a/sway/config b/sway/config index a8e2ddc..a453178 100644 --- a/sway/config +++ b/sway/config @@ -1,18 +1,26 @@ set $mod Mod4 xwayland disable -bar swaybar_command waybar + seat seat0 xcursor_theme default 32 -exec_always ~/.config/sway/init.sh +input type:touchpad tap enable + +font "pango:Inter Medium 12" +floating_modifier $mod +default_border pixel 4 + +assign [app_id="^tmux_term$"] 9:term + +exec ~/.config/sway/init.sh bindsym { $mod+Return exec alacritty - $mod+space exec wofi --show drun --allow-images --allow-markup --gtk-dark + $mod+space exec ~/.dotfiles/wofi/run.sh $mod+Tab layout toggle $mod+Shift+q kill - $mod+Shift+r restart + $mod+Shift+r reload $mod+Shift+e exit $mod+Shift+space floating toggle $mod+Shift+Return fullscreen toggle diff --git a/sway/init.sh b/sway/init.sh index da76f9c..c01f216 100755 --- a/sway/init.sh +++ b/sway/init.sh @@ -1,31 +1,5 @@ #!/bin/sh -mod=Mod4 -primary=eDP-1 -secondary=$(swaymsg -t get_outputs -r | - jq "map(select(.name != \"$primary\") | .name)[0]" 2> /dev/null | - tr -d "\"") - -swaymsg output $primary pos 0 0 res 1920x1080 bg ~/.pictures/bg1.jpg stretch -[ ! -z "$secondary" ] && swaymsg output $secondary pos 1920 0 bg ~/.pictures/bg2.jpg stretch - -swaymsg workspace 1:1 output $primary -swaymsg workspace 2:2 output $primary -swaymsg workspace 3:3 output $primary -swaymsg workspace 4:4 output $primary -swaymsg workspace 5:a output ${secondary:-$primary} -swaymsg workspace 6:s output ${secondary:-$primary} -swaymsg workspace 7:d output ${secondary:-$primary} -swaymsg workspace 8:f output ${secondary:-$primary} - -swaymsg input type:touchpad tap enable - -swaymsg font "pango:Inter Medium 12" -swaymsg floating_modifier $mod -swaymsg default_border pixel 4 - -swaymsg assign "[app_id=\"^tmux_term\$\"]" 9:term - # export GDK_DPI_SCALE=0.95 gsettings set org.gnome.desktop.interface scaling-factor 1 gsettings set org.gnome.desktop.interface text-scaling-factor 1 @@ -41,3 +15,9 @@ systemctl --user import-environment \ dbus-update-activation-environment --systemd --all systemctl --user restart plasma-kactivitymanagerd.service + +~/.config/sway/swayidle.sh & + +kanshi & + +waybar -c ~/.config/waybar/sway.conf & diff --git a/sway/outputs b/sway/outputs deleted file mode 100644 index 9a26dc2..0000000 --- a/sway/outputs +++ /dev/null @@ -1,27 +0,0 @@ -output "eDP-1" { - mode 1920x1080@59.999Hz - pos 0 0 - transform normal - scale 1.0 - scale_filter nearest - adaptive_sync off - dpms on -} -output "DP-5" { - mode 2560x1440@59.951Hz - pos 1920 0 - transform normal - scale 1.0 - scale_filter nearest - adaptive_sync off - dpms on -} -output "DP-3" { - mode 1920x1080@60.0Hz - pos 4480 0 - transform normal - scale 1.0 - scale_filter nearest - adaptive_sync off - dpms on -} diff --git a/sway/swayidle.sh b/sway/swayidle.sh new file mode 100755 index 0000000..63d40c0 --- /dev/null +++ b/sway/swayidle.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +exec swayidle -w timeout 600 'swaymsg "output * power off"' \ + resume 'swaymsg "output * power on"' diff --git a/sway/terminal.sh b/sway/terminal.sh index ec864ab..2acb4ad 100755 --- a/sway/terminal.sh +++ b/sway/terminal.sh @@ -1,28 +1,26 @@ #!/bin/sh -DESKTOP=term -INSTANCE=tmux_term +term_workspace="9:term" +term_app_id=tmux_term -TERM_WORKSPACE="9:term" -TERM_APP_ID=tmux_term +focused_output=$(swaymsg -t get_outputs -r | + jq -r '.[] | select(.focused == true) | .name') +focused_workspace=$(swaymsg -t get_workspaces -r | + jq -r '.[] | select(.focused == true) | .name') -FOCUSED_OUTPUT=$(swaymsg -t get_outputs -r | - jq '.[] | select(.focused == true) | .name' | - tr -d '"') -FOCUSED_WORKSPACE=$(swaymsg -t get_workspaces -r | - jq '.[] | select(.focused == true) | .name' | - tr -d '"') - -if [ "$FOCUSED_WORKSPACE" = "$TERM_WORKSPACE" ]; then +if [ "$focused_workspace" = "$term_workspace" ]; then swaymsg workspace back_and_forth + else - swaymsg workspace $TERM_WORKSPACE - swaymsg move workspace to $FOCUSED_OUTPUT - swaymsg workspace $TERM_WORKSPACE + swaymsg workspace $term_workspace + swaymsg move workspace to $focused_output + swaymsg workspace $term_workspace if ! (swaymsg -t get_tree -r | - jq -e "recurse(.nodes[]) | select(.app_id == \"$TERM_APP_ID\")" > /dev/null); then - exec alacritty --class $TERM_APP_ID -e \ + jq -e "recurse(.nodes[]) | select(.app_id == \"$term_app_id\")" > /dev/null); then + exec alacritty --class $term_app_id -e \ tmux new-session -A -s default + # exec foot --app-id $term_app_id \ + # tmux new-session -A -s default fi fi -- cgit v1.2.3-70-g09d2