Skip to content

Instantly share code, notes, and snippets.

@coleifer
Last active December 9, 2023 14:23
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save coleifer/9fbab2d19a337512ab2a to your computer and use it in GitHub Desktop.
Save coleifer/9fbab2d19a337512ab2a to your computer and use it in GitHub Desktop.
# this yaml config file goes in .themer/templates/i3/config.yaml
variables:
primary: magenta
secondary: green
tertiary: red
special: yellow
transparency: 85
fontName: terminus
fontSize: 12
font: "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*"
files:
xresources.tpl: Xresources
index.tpl: index.html
i3status.tpl: i3status.conf
i3.tpl: i3.conf
# i3 config file (v4), goes in .themer/templates/i3/i3.tpl
# use "ALT" key
set $mod Mod1
# font for window titles. ISO 10646 = Unicode
font {{ font }}
# close window
bindsym $mod+Shift+Q kill
# reload the configuration file
bindsym $mod+Shift+C reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+R restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+E exit
# terminal
bindsym $mod+Return exec i3-sensible-terminal
# dmenu wrapper
bindsym $mod+d exec /home/charles/bin/pyrun.py "{{ black }}" "{{ tertiary }}" "{{ black }}" "{{ secondary }}"
# focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l 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+colon move right
# split in horizontal orientation
bindsym $mod+minus split v
# split in vertical orientation
bindsym $mod+backslash split h
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
# change container layout (stacked, tabbed, default)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout default
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# alt + click to move windows.
floating_modifier $mod
# workspace names
set $ws1 browser
set $ws2 term
set $ws3 irc
set $ws4 misc
# switch to workspace
bindsym $mod+1 workspace 1: $ws1
bindsym $mod+2 workspace 2: $ws2
bindsym $mod+3 workspace 3: $ws3
bindsym $mod+4 workspace 4: $ws4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+exclam move container to workspace 1: $ws1
bindsym $mod+Shift+at move container to workspace 2: $ws2
bindsym $mod+Shift+numbersign move container to workspace 3: $ws3
bindsym $mod+Shift+dollar move container to workspace 4: $ws4
bindsym $mod+Shift+percent move container to workspace 5
bindsym $mod+Shift+asciicircum move container to workspace 6
bindsym $mod+Shift+ampersand move container to workspace 7
bindsym $mod+Shift+asterisk move container to workspace 8
bindsym $mod+Shift+parenleft move container to workspace 9
bindsym $mod+Shift+parenright move container to workspace 10
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
new_window {{ window_style }}
set $background {{ black }}
set $foreground {{ white }}
set $gray {{ alt_black }}
set $primary {{ primary }}
set $secondary {{ secondary }}
set $tertiary {{ tertiary }}
set $warning {{ special }}
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
position bottom
workspace_buttons yes
font {{ font }}
colors {
background $background
statusline $primary
# Colors go <border> <background> <text> <indicator>
focused_workspace $secondary $background $foreground
active_workspace $primary $background $foreground
inactive_workspace $primary $background $foreground
urgent_workspace $foreground $warning
}
}
# colors border bg text
client.focused $primary $primary $background $primary
client.focused_inactive $primary $primary $background $primary
client.unfocused $gray $gray $foreground $secondary
client.urgent $warning $warning $foreground $warning
exec volumeicon
exec feh --bg-fill /home/charles/.wallpaper.jpg
{# this is an "i3" specific file, for configuring my status bar -- goes in .themer/templates/i3status.tpl #}
general {
colors = true
interval = 5
color_good = "{{ green }}"
color_bad = "{{ red }}"
}
order += "disk /"
order += "run_watch DHCP"
order += "wireless wlan0"
order += "ethernet eth0"
order += "battery 0"
order += "cpu_usage"
order += "load"
order += "time"
wireless wlan0 {
format_up = "W: (%quality at %essid) %ip"
format_down = "W: down"
}
ethernet eth0 {
# if you use %speed, i3status requires root privileges
format_up = "E: %ip (%speed)"
format_down = "E: down"
}
battery 0 {
format = "%status %percentage %remaining"
}
run_watch DHCP {
pidfile = "/var/run/dhclient*.pid"
}
run_watch VPN {
pidfile = "/var/run/vpnc/pid"
}
time {
format = "%Y-%m-%d %H:%M:%S"
}
cpu_usage {
format = "%usage"
}
load {
format = "%1min %5min"
}
volume master {
format = "♪: %volume"
device = "default"
mixer = "Master"
mixer_idx = 0
}
disk "/" {
format = "%free/%total"
}
{# this goes in .themer/templates/i3/index.tpl #}
<html>
<body style="background: {{ background }}; color: {{ foreground }}; font: 12px monospace;">
<p>Default text will appear like this.</p>
<h3>Colors</h3>
<ul>
<li><p style="color: {{ white }}">White</p></li>
<li><p style="color: {{ alt_white }}">White (alt)</p></li>
<li><p style="color: {{ magenta }}">Magenta</p></li>
<li><p style="color: {{ alt_magenta }}">Magenta (alt)</p></li>
<li><p style="color: {{ blue }}">Blue</p></li>
<li><p style="color: {{ alt_blue }}">Blue (alt)</p></li>
<li><p style="color: {{ red }}">Red</p></li>
<li><p style="color: {{ alt_red }}">Red (alt)</p></li>
<li><p style="color: {{ green }}">Green</p></li>
<li><p style="color: {{ alt_green }}">Green (alt)</p></li>
<li><p style="color: {{ yellow }}">Yellow</p></li>
<li><p style="color: {{ alt_yellow }}">Yellow (alt)</p></li>
<li><p style="color: {{ cyan }}">Cyan</p></li>
<li><p style="color: {{ alt_cyan }}">Cyan (alt)</p></li>
<li><p style="color: {{ black }}">Black</p></li>
<li><p style="color: {{ alt_black }}">Black (alt)</p></li>
</ul>
<h3>Special</h3>
<ul>
<li><p style="color: {{ primary }}">Primary</p></li>
<li><p style="color: {{ secondary }}">Secondary</p></li>
<li><p style="color: {{ tertiary }}">Tertiary</p></li>
</ul>
<h3>Wallpaper</h3>
<ul>
<li><p style="color: {{ red }}">Left</p></li>
<li><p style="color: {{ green }}">Top</p></li>
<li><p style="color: {{ yellow }}">Right</p></li>
<li><p style="color: {{ magenta }}">Middle</p></li>
</ul>
</body>
</html>
{# belongs in .themer/templates/i3/xresources.tpl
*faceName: {{ fontName.title() }}
*faceSize: {{ fontSize }}
*font: xft:{{ fontName.title() }}:{{ fontSize }}
*.cursorColor: {{ white }}
*background: {% if transparency %}[{{ transparency }}]{% endif %}{% if background %}{{ background }}{% else %}{{ black }}{% endif %}
*foreground: {% if foreground %}{{ foreground }}{% else %}{{ white }}{% endif %}
! black
*color0: {{ black }}
*color8: {{ alt_black }}
! red
*color1: {{ red }}
*color9: {{ alt_red }}
! green
*color2: {{ green }}
*color10: {{ alt_green }}
! yellow
*color3: {{ yellow }}
*color11: {{ alt_yellow }}
! blue
*color4: {{ blue }}
*color12: {{ alt_blue }}
! magenta
*color5: {{ magenta }}
*color13: {{ alt_magenta }}
! cyan
*color6: {{ cyan }}
*color14: {{ alt_cyan }}
! white
*color7: {{ white }}
*color15: {{ alt_white }}
! underline when default
*colorUL: {% if underline %}{{ underline }}{% else %}{{ white }}{% endif %}
! vim: set ft=xdefaults:
@bchretien
Copy link

The end of the comment is missing on the first line of xresources.tpl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment