1
0
Fork 0

Update dot_config/i3/config

Update dot_config/i3/executable_common_var.sh
Update dot_config/i3/executable_configure_monitors.sh
Add dot_config/i3/executable_on_i3_start.sh
Update dot_config/i3/executable_relative_workspace.sh
This commit is contained in:
Florian RICHER 2022-05-08 16:11:11 +02:00
parent e0297d280b
commit 87da83122a
5 changed files with 55 additions and 30 deletions

View file

@ -145,6 +145,9 @@ bindsym $mod+q focus parent
# focus the child container
#bindsym $mod+d focus child
# SOURCE OF ALL CONFS
# https://github.com/sharpTrick/set-i3-workspace
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
@ -159,28 +162,28 @@ set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
bindsym $mod+1 exec ~/.config/i3/relative_workspace.sh $ws1
bindsym $mod+2 exec ~/.config/i3/relative_workspace.sh $ws2
bindsym $mod+3 exec ~/.config/i3/relative_workspace.sh $ws3
bindsym $mod+4 exec ~/.config/i3/relative_workspace.sh $ws4
bindsym $mod+5 exec ~/.config/i3/relative_workspace.sh $ws5
bindsym $mod+6 exec ~/.config/i3/relative_workspace.sh $ws6
bindsym $mod+7 exec ~/.config/i3/relative_workspace.sh $ws7
bindsym $mod+8 exec ~/.config/i3/relative_workspace.sh $ws8
bindsym $mod+9 exec ~/.config/i3/relative_workspace.sh $ws9
bindsym $mod+0 exec ~/.config/i3/relative_workspace.sh $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+Shift+1 exec ~/.config/i3/relative_workspace.sh $ws1 move
bindsym $mod+Shift+2 exec ~/.config/i3/relative_workspace.sh $ws2 move
bindsym $mod+Shift+3 exec ~/.config/i3/relative_workspace.sh $ws3 move
bindsym $mod+Shift+4 exec ~/.config/i3/relative_workspace.sh $ws4 move
bindsym $mod+Shift+5 exec ~/.config/i3/relative_workspace.sh $ws5 move
bindsym $mod+Shift+6 exec ~/.config/i3/relative_workspace.sh $ws6 move
bindsym $mod+Shift+7 exec ~/.config/i3/relative_workspace.sh $ws7 move
bindsym $mod+Shift+8 exec ~/.config/i3/relative_workspace.sh $ws8 move
bindsym $mod+Shift+9 exec ~/.config/i3/relative_workspace.sh $ws9 move
bindsym $mod+Shift+0 exec ~/.config/i3/relative_workspace.sh $ws10 move
# kill window
bindsym $mod+Shift+q kill
@ -268,6 +271,9 @@ exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=secrets
exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=ssh
exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=pkcs11
# Set current monitor configuration
exec_always --no-startup-id ~/.config/i3/on_i3_start.sh
# Desktop notifications_
exec --no-startup-id /usr/bin/dunst

View file

@ -2,3 +2,10 @@
MONITOR_CONF=~/.screenlayout/monitor.sh
GENERATED_MONITOR_CONF=~/.screenlayout/generated_monitor.sh
# Set command from current VM
MSG_COMMAND=i3-msg
if [[ $DESKTOP_SESSION =~ ^sway$ ]]; then
MSG_COMMAND=swaymsg
fi

View file

@ -12,7 +12,7 @@ function set_configuration () {
$MONITOR_CONF # Apply configuration
}
# set_configuration
set_configuration
# SCREENS => HashMap | Key => Output name | Value => Position X
# SCREENS EX:
@ -49,3 +49,4 @@ EXPORT_SCREENS="${EXPORT_SCREENS:0:-1})" # Remove last space
echo "#!/bin/bash" > $GENERATED_MONITOR_CONF
echo $EXPORT_SCREENS >> $GENERATED_MONITOR_CONF
echo "SCREEN_NUMBER=\${#SCREENS[@]}" >> $GENERATED_MONITOR_CONF

View file

@ -0,0 +1,17 @@
#!/bin/bash
source ~/.config/i3/common_var.sh
source $GENERATED_MONITOR_CONF
$MONITOR_CONF # Apply configured layout
# To launch as dry mode. Uncomment line in below
# MSG_COMMAND=echo
for i in $(seq 1 $SCREEN_NUMBER); do
INDEX=$(($i - 1))
SCREEN=${SCREENS[$INDEX]}
for j in $(seq 1 10); do
$MSG_COMMAND move workspace number $(($INDEX * 10 + $j)) to output $SCREEN
done
done

View file

@ -6,14 +6,6 @@
source ~/.config/i3/common_var.sh
source $GENERATED_MONITOR_CONF
SCREEN_NUMBER=${#SCREENS[@]}
# Set command from current WM
MSG_COMMAND=i3-msg
if [[ $DESKTOP_SESSION =~ ^sway$ ]]; then
MSG_COMMAND=swaymsg
fi
# Get current workspace output (Screen)
CURRENT_WORKSPACE=$($MSG_COMMAND -t get_workspaces \
| jq '.[] | select(.visible == true and .focused == true) | .output' \
@ -33,9 +25,11 @@ done
DESIRED_WORKSPACE=$(($SCREEN_INDEX * 10 + $1))
# To run in DRY RUN uncomment line in below
MSG_COMMAND=echo
# MSG_COMMAND=echo
if [[ "$2" == "move" ]]; then
notify-send "move to $DESIRED_WORKSPACE"
$MSG_COMMAND move container to workspace number $DESIRED_WORKSPACE
else
notify-send "switch to $DESIRED_WORKSPACE"
$MSG_COMMAND workspace number $DESIRED_WORKSPACE
fi