1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00
This commit is contained in:
Henrik Hautakoski 2023-07-27 17:21:44 +02:00
parent 52110f5c71
commit 0c57898246
4 changed files with 121 additions and 95 deletions

187
i3/config
View file

@ -2,37 +2,54 @@
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 10
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Variables
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
set_from_resource $color_bg i3wm.background #111111
set_from_resource $color_fg i3wm.foreground #f1f1f1
set_from_resource $color_red i3wm.color1 #cc817f
set_from_resource $color_green i3wm.color2 #7ccfaf
set_from_resource $color_yellow i3wm.color3 #ffcc99
set_from_resource $color_blue i3wm.color4 #8ac6f2
set_from_resource $color_magenta i3wm.color5 #9999cc
set_from_resource $color_gray0 i3wm.colorGray0 #383a43
set_from_resource $color_gray1 i3wm.colorGray1 #404754
set_from_resource $color_win_focus_fg i3wm.foreground #f1f1f1
set_from_resource $color_win_focus_bg i3wm.colorGray1 #404754
set_from_resource $color_win_unfocus_fg i3wm.foreground #f1f1f1
set_from_resource $color_win_unfocus_bg i3wm.colorGray0 #383a43
set_from_resource $color_win_urgent_fg i3wm.foreground #f1f1f1
set_from_resource $color_win_urgent_bg i3wm.color1 #cc817f
set $mod Mod4
set $super Shift
set $ws1 "1:main"
set $ws2 "2:www"
set $ws3 "3:code"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6:chat"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
set $second_monitor eDP-1
## Startup programs
exec --no-startup-id ~/.config/i3/xrandr.sh
exec --no-startup-id dex-autostart --autostart --environment i3
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -c $color_bg --nofork
#exec --no-startup-id nm-applet
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
## Config
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
font pango:DejaVu Sans Mono 11
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
@ -42,18 +59,13 @@ floating_modifier $mod
tiling_drag modifier titlebar
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec urxvt -e fish
# kill focused window
bindsym $mod+Shift+q kill
bindsym $mod+$super+q kill
# start dmenu (a program launcher)
# start rofi
bindsym $mod+d exec "rofi -show drun"
# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
@ -68,16 +80,16 @@ bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+odiaeresis move right
bindsym $mod+$super+j move left
bindsym $mod+$super+k move down
bindsym $mod+$super+l move up
bindsym $mod+$super+odiaeresis move right
# alternatively, you can use the cursor 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
bindsym $mod+$super+Left move left
bindsym $mod+$super+Down move down
bindsym $mod+$super+Up move up
bindsym $mod+$super+Right move right
# split in horizontal orientation
bindsym $mod+h split h
@ -94,7 +106,7 @@ bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
bindsym $mod+$super+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
@ -105,18 +117,14 @@ bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# 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:main"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# Workspace settings
workspace $ws1 output primary
workspace $ws2 output primary
workspace $ws3 output primary
workspace $ws4 output primary
workspace $ws5 output primary
workspace $ws6 output $second_monitor gaps inner 0
# switch to workspace
bindsym $mod+1 workspace number $ws1
@ -131,23 +139,30 @@ bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $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+$super+1 move container to workspace number $ws1
bindsym $mod+$super+2 move container to workspace number $ws2
bindsym $mod+$super+3 move container to workspace number $ws3
bindsym $mod+$super+4 move container to workspace number $ws4
bindsym $mod+$super+5 move container to workspace number $ws5
bindsym $mod+$super+6 move container to workspace number $ws6
bindsym $mod+$super+7 move container to workspace number $ws7
bindsym $mod+$super+8 move container to workspace number $ws8
bindsym $mod+$super+9 move container to workspace number $ws9
bindsym $mod+$super+0 move container to workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
bindsym $mod+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
bindsym $mod+$super+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
bindsym $mod+$super+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# Assignments
assign [class="^Vivaldi"] $ws2
assign [class="^Code$"] $ws3
assign [class="^Telegram"] $ws6
# resize window (you can also use the mouse for that)
mode "resize" {
@ -178,30 +193,36 @@ bindsym $mod+r mode "resize"
# COLORS
# class border bground text indicator child_border
client.focused #8ABEB7 #8ABEB7 #1D232C #1D232C #1D232C
client.focused_inactive #1D232C #1D232C #404754 #484E50 #5F676A
client.unfocused #333333 #222222 #5F676A #292D2E #222222
client.urgent #CC817F #CC817F #1D232C #CC817F #CC817F
client.placeholder #000000 #0C0C0C #F1F1F1 #000000 #0C0C0C
client.background $color_bg
client.background #1D232C
# class border bground text indicator child_border
client.focused $color_win_focus_bg $color_win_focus_bg $color_win_focus_fg $color_win_focus_bg $color_win_focus_bg
client.focused_inactive $color_win_unfocus_bg $color_win_unfocus_bg $color_win_unfocus_fg $color_win_unfocus_bg $color_win_unfocus_bg
client.unfocused $color_win_unfocus_bg $color_win_unfocus_bg $color_win_unfocus_fg $color_win_unfocus_bg $color_win_unfocus_bg
client.urgent $color_win_urgent_bg $color_win_urgent_bg $color_win_urgent_fg $color_win_urgent_bg $color_win_urgent_bg
client.placeholder $color_bg $color_bg $color_fg $color_bg $color_bg
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
output primary
status_command i3status
separator_symbol " > "
separator_symbol " | "
font pango:DejaVu Sans Mono 14
strip_workspace_numbers no
strip_workspace_name no
workspace_min_width 50
colors {
background #1D232C
statusline #F1F1F1
separator #F1F1F1
background $color_bg
statusline $color_white
separator $color_gray
focused_workspace #8ABEB7 #8ABEB7 #111111
active_workspace #FFCC99 #FFCC99 #111111
inactive_workspace #1D232C #1D232C #404754
urgent_workspace #CC817F #CC817F #111111
binding_mode #9999CC #9999CC #111111
focused_workspace $color_gray1 $color_gray1 $color_fg
active_workspace $color_yellow $color_yellow $color_bg
inactive_workspace $color_bg $color_bg $color_fg
urgent_workspace $color_red $color_red $color_bg
binding_mode $color_magenta $color_magenta $color_bg
}
}

9
i3/xrandr.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
xrandr --output eDP-1 --mode 1920x1080 --pos 3440x0 --rotate normal \
--output DP-1-0 --off \
--output DP-1-1 --off \
--output DP-1-2 --off \
--output DP-1-3 --off \
--output HDMI-1-0 --primary --mode 3440x1440 --pos 0x0 --rotate normal \
--output DP-1-4 --off