mirror of
https://github.com/Cametendo/MyI3Config-fork.git
synced 2026-03-18 03:40:20 +01:00
added compatibility with sway
This commit is contained in:
9
scripts/display-tool.sh
Executable file
9
scripts/display-tool.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$SWAYSOCK" ]; then
|
||||
# Sway
|
||||
wdisplays
|
||||
else
|
||||
# i3
|
||||
arandr
|
||||
fi
|
||||
10
scripts/keyboard-setup.sh
Executable file
10
scripts/keyboard-setup.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$SWAYSOCK" ]; then
|
||||
# Sway
|
||||
swaymsg input "*" xkb_layout "ch"
|
||||
swaymsg input "*" xkb_variant "de"
|
||||
else
|
||||
# i3
|
||||
setxkbmap -layout ch -variant de
|
||||
fi
|
||||
22
scripts/layout-toggle.sh
Executable file
22
scripts/layout-toggle.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle between CH and US layouts
|
||||
if [ -n "$SWAYSOCK" ]; then
|
||||
# Sway: get current layout and toggle
|
||||
current=$(swaymsg -t get_inputs | jq -r '.[] | select(.type=="keyboard") | .xkb_active_layout_name' | head -1)
|
||||
if [ "$current" = "Swiss" ] || [ "$current" = "ch" ]; then
|
||||
swaymsg input "*" xkb_layout "us"
|
||||
swaymsg input "*" xkb_variant "workman"
|
||||
else
|
||||
swaymsg input "*" xkb_layout "ch"
|
||||
swaymsg input "*" xkb_variant "de"
|
||||
fi
|
||||
else
|
||||
# i3: get current layout and toggle
|
||||
current=$(setxkbmap -query | grep layout | awk '{print $2}')
|
||||
if [ "$current" = "ch" ]; then
|
||||
setxkbmap -layout us -variant workman
|
||||
else
|
||||
setxkbmap -layout ch -variant de
|
||||
fi
|
||||
fi
|
||||
9
scripts/lock.sh
Executable file
9
scripts/lock.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$SWAYSOCK" ]; then
|
||||
# Sway
|
||||
swaylock
|
||||
else
|
||||
# i3
|
||||
i3lock
|
||||
fi
|
||||
9
scripts/screenshot.sh
Executable file
9
scripts/screenshot.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$SWAYSOCK" ]; then
|
||||
# Sway
|
||||
grim -g "$(slurp)" - | wl-copy
|
||||
else
|
||||
# i3
|
||||
maim -s | xclip -selection clipboard -t image/png
|
||||
fi
|
||||
12
scripts/startup.sh
Executable file
12
scripts/startup.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$SWAYSOCK" ]; then
|
||||
# Sway startup commands
|
||||
# Set cursor (optional, Sway handles this differently)
|
||||
# For Sway, output configuration should be in the config file, not here
|
||||
echo "Running Sway startup"
|
||||
else
|
||||
# i3 startup commands
|
||||
xsetroot -cursor_name left_ptr
|
||||
xrandr --output HDMI-1 --auto --left-of DP-2 --output DP-2 --auto
|
||||
fi
|
||||
Reference in New Issue
Block a user