1st dotfiles commit

This commit is contained in:
ohinh 2026-08-03 17:03:40 +02:00
parent 39c99549d0
commit a57c4c068f
31 changed files with 8636 additions and 0 deletions

346
sway/workspaces_rules Normal file
View file

@ -0,0 +1,346 @@
# Default config for sway
# Copy this to ~/.config/sway/config and edit it to your liking.
# Read `man 5 sway` for a complete reference.
include /home/oh/.config/sway/basic_key_bindings
include /home/oh/.config/sway/windows_rules
include /home/oh/.config/sway/input_config
include /home/oh/.config/sway/colors
include /home/oh/.config/sway/workspaces_rules
include /home/oh/.config/sway/app_assignment
include /home/oh/.config/sway/layout
include /home/oh/.config/sway/utilities
### Variables
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left k
set $down l
set $up o
set $right m
# screens
set $laptop eDP-1
set $external HDMI-A-1
## Preferred apps
set $term foot
set $menu wofi --show drun
set $file nautilus
set $browser flatpak run app.zen_browser.zen
include /etc/sway/config-vars.d/*
# autoload when start wm
exec waybar
exec /usr/libexec/polkit-mate-authentication-agent-1
exec wlsunset
exec wl-paste --watch cliphist store
### Output configuration
# using "swaybg" just put file path as below and end with 'fill'
output * background ~/.config/sway/wallpapers/frieren.png fill
#
output HDMI-A-1 resolution 1920x1080 position 1920,0
#
#exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
# before-sleep 'swaylock -f -c 000000'
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
input "2:14:ETPS/2_Elantech_Touchpad" {
dwt enabled
tap enabled
natural_scroll enabled
middle_emulation enabled
}
input type:keyboard {
xkb_options caps:escape
xkb_layout fr
repeat_delay 300
repeat_rate 50
}
input "6058:20564:ThinkPad_Extra_Buttons" {
}
# window gaps
smart_borders on
default_border pixel 2
default_floating_border pixel 3
gaps inner 1
gaps outer 1
# Window borders
# Colors: border background text indicator child_border
client.focused #9932cc #285577 #ffffff #2e9ef4 #2e9ef4
client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
client.unfocused #333333 #222222 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
# Background color for inactive tabs in tabbed/stacked layout
client.background #000000
# faire disparaître le titlebar
font pango:monospace 0.001
titlebar_border_thickness 1
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Enter exec $term
# Kill focused window
bindsym $mod+q kill
# Start your launcher
bindsym $mod+space exec $menu
bindsym $mod+shift+d exec wofi --show run
# Start a file manager
bindsym $mod+e exec $file
# Start browser
bindsym $mod+a exec $browser
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# clipboard manager
bindsym $mod+w exec cliphist list | wofi | cliphist decode | wl-copy
# Reload the configuration file
bindsym $mod+Shift+r reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
# Switch to workspace
bindsym Mod4+ampersand workspace 1
bindsym Mod4+eacute workspace 2
bindsym Mod4+quotedbl workspace 3
bindsym Mod4+apostrophe workspace 4
bindsym Mod4+parenleft workspace 5
bindsym Mod4+minus workspace 6
bindsym Mod4+egrave workspace 7
bindsym Mod4+underscore workspace 8
bindsym Mod4+ccedilla workspace 9
bindsym Mod4+agrave workspace 10
# Move focused container to workspace
bindsym Mod4+Shift+ampersand workspace 01
bindsym Mod4+Shift+eacute workspace 02
bindsym Mod4+Shift+quotedbl workspace 03
bindsym Mod4+Shift+apostrophe workspace 04
bindsym Mod4+Shift+parenleft workspace 05
bindsym Mod4+Shift+minus workspace 06
bindsym Mod4+Shift+egrave workspace 07
bindsym Mod4+Shift+underscore workspace 08
bindsym Mod4+Shift+ccedilla workspace 09
bindsym Mod4+Shift+agrave workspace 010
bindsym Mod4+tab workspace next
bindsym Mod4+Shift+tab workspace prev
# external screen
# on laptop monitor
workspace 1 output $laptop
workspace 2 output $laptop
workspace 3 output $laptop
workspace 4 output $laptop
workspace 5 output $laptop
workspace 6 output $laptop
workspace 7 output $laptop
workspace 8 output $laptop
workspace 9 output $laptop
workspace 10 output $laptop
# on external monitor
workspace 01 output $external
workspace 02 output $external
workspace 03 output $external
workspace 04 output $external
workspace 05 output $external
workspace 06 output $external
workspace 07 output $external
workspace 08 output $external
workspace 09 output $external
workspace 010 output $external
# assignment
for_window [app_id=.*] focus
assign [app_id="foot"] 01
assign [app_id="foot"] 1
assign [app_id="zen"] 02
assign [app_id="zen"] 2
assign [app_id="anki"] 02
assign [app_id="anytype"] 3
assign [app_id="libreoffice"] 3
assign [app_id="signal"] 4
assign [app_id="thunderbird"] 04
assign [app_id="thunderbird"] 4
assign [app_id="mpv"] 05
assign [app_id="mpv"] 5
assign [app_id="vlc"] 05
assign [app_id="vlc"] 5
assign [app_id="steam"] 06
assign [app_id="steam"] 6
assign [app_id="kde-connect"] 7
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
# bindsym $mod+s layout stacking
# bindsym $mod+w layout tabbed
bindsym $mod+s layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+u focus mode_toggle
# Move focus to the parent container
# bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
# bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
# bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+alt+r mode "resize"
#
# Utilities:
#
# Special keys to adjust volume via PulseAudio
bindsym --locked XF86AudioMute exec amixer sset Master toggle
bindsym --locked XF86AudioLowerVolume exec amixer sset Master 5%-
bindsym --locked XF86AudioRaiseVolume exec amixer sset Master 5%+
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
# Special keys to adjust brightness via brightnessctl
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
# Special key to take a screenshot with grim
bindsym Print exec grim
bindsym $mod+Print exec grim -g "$(slurp)"
#power
bindsym Mod4+Escape exec wlogout
bindsym Mod4+Shift+x exec swaylock
#
# Status Bar disable because of use waybar instead if you not use waybar just uncomment those below:
#
# Read `man 5 sway-bar` for more information about this section.
# bar {
# position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
# status_command while date +'%Y-%m-%d %X'; do sleep 1; done
# colors {
# statusline #ffffff
# background #323232
# inactive_workspace #32323200 #32323200 #5c5c5c
# }
#}
include /etc/sway/config.d/*