# Sample configuration is as follows.
# korgwm tries to find the config in such an order:
#   /etc/korgwm/korgwm.conf
#   /usr/local/etc/korgwm/korgwm.conf
#   $HOME/.korgwmrc
#   $HOME/.config/korgwm/korgwm.conf
# For each file found it tries to alter the configuration with its content
---
## API parameters
# Set api_port = 0 to disable API server
# KORGWM_DEBUG_PORT environment variable overrides api_port if set
api_host: 127.0.0.1
api_port: 27015
# Inactivity timeout for API to close the connection
api_timeout: 5

## Generic parameters
# Window border width in pixels
border_width: 1
# Enable keyboard selection for Expose
expose_show_id: 1
# Modifier to set margins
expose_spacing: 15
# Indicates the pointer should be moved somewhere. One of: undef (~), center, and hidden
initial_pointer_position: center
# Should mouse follow the focus under certain circumstances (RTFS)
mouse_follow: 1
# If set: tag will be switched together with a window during win_move_tag(). Stay on current tag otherwise
move_follow: 1
# Do not warp mouse pointer whenever it is over any korgwm window (panel, expose, etc.)
warp_ignore_korgwm: 1
# Completely disable mouse teleportation (except window resize)
mouse_nowarp: 0
# Start own notifications server to improve urgency experience. Disable if you want to use another one
notification_server: 1
# Command which is used to set relevant screen positions on each RandR event
randr_cmd: 'korgwm_xrandr || xrandr --auto'
# Enable/disable setting the colour for root window
set_root_color: 0
# Debug level 1--9. Levels >= 7 MAY LEAK SENSITIVE INFORMATION
debug: 0

## Bar settings
# Font specification to use on the bar
font: DejaVu Sans Mono 10
# Height of the panel in pixels
panel_height: 20
# Set this to true if the panel should be hidden
panel_hide: ~
# Widgets that should be enabled for bar
panel_end:
  - battery
  - clock
  - lang
# Hide tags with no windows on the panel
hide_empty_tags: 1
# Switch to a previous tag when trying to select already active one
tag_rotate: 1
# The character which is used to show that the battery is charging
battery_charging_character: '∴'
# Format string for the battery percentage, use %% to add percent sign
battery_format: '%s'
# Enable/disable display of the battery percentage when it's full
battery_hide_charged: 1
# Format string for the clock, see strftime(3)
clock_format: ' %a %e %B %H:%M'
# Format string for the language selector
lang_format: ' %s '
# Mapping of the languages to strings on the panel
lang_names:
  '0': £
  '1': ₽
# Max length of the title before ellipsis comes into play
title_max_len: 128
# How many tags to create and their names
ws_names:
  - '1'
  - '2'
  - '3'
  - '4'
  - '5'
  - '6'
  - '7'
  - '8'
  - '9'

## Colours
# How to mark a tag in case it was appended to the active one
color_append_bg: 0x262729
color_append_fg: 0xF502C8
# Overrides color_fg when the battery is low
color_battery_low: 0xFF0000
# Regular bg colour
color_bg: 0x262729
# Window border colours: regular and focused
color_border: 0x232426
color_border_focus: 0xA3BABF
# Background colour for Expose window (slightly darker looks better)
color_expose: 0x232426
# Regular fg colour, basically for text everywhere
color_fg: 0xA3BABF
# How to mark a tag if it has urgent windows and is not active
color_urgent_bg: 0xFFFF00
color_urgent_fg: 0x464729

## Hotkeys, see API.pm for description of possible functions
hotkeys:
  XF86AudioLowerVolume: 'nop()'
  XF86AudioMute: 'nop()'
  XF86AudioRaiseVolume: 'nop()'
  XF86MonBrightnessDown: 'nop()'
  XF86MonBrightnessUp: 'nop()'
  XF86AudioPlay: 'exec(playerctl play-pause)'
  XF86AudioStop: 'exec(playerctl stop)'
  XF86AudioPrev: 'exec(playerctl previous)'
  XF86AudioNext: 'exec(playerctl next)'
  XF86WakeUp: 'nop()'
  Print: 'exec(flameshot gui)'
  alt_F4: 'win_close()'
  alt_TAB: 'focus_cycle(forward)'
  alt_shift_TAB: 'focus_cycle(backward)'
  mod_1: 'tag_select(1)'
  mod_2: 'tag_select(2)'
  mod_3: 'tag_select(3)'
  mod_4: 'tag_select(4)'
  mod_5: 'tag_select(5)'
  mod_6: 'tag_select(6)'
  mod_7: 'tag_select(7)'
  mod_8: 'tag_select(8)'
  mod_9: 'tag_select(9)'
  mod_-: 'toggle_calendar()'
  mod_=: 'exec(galculator)'
  mod_CR: 'exec(xkb-switch -s us; urxvt)'
  mod_F1: 'screen_select(1)'
  mod_F2: 'screen_select(2)'
  mod_F3: 'screen_select(3)'
  mod_F4: 'screen_select(4)'
  mod_F5: 'screen_select(5)'
  mod_F6: 'screen_select(6)'
  mod_F7: 'screen_select(7)'
  mod_F8: 'screen_select(8)'
  mod_F9: 'screen_select(9)'
  mod_TAB: 'focus_prev()'
  mod_a: 'win_toggle_always_on()'
  mod_alt_F1: 'exec(pactl set-sink-mute 0 toggle)'
  mod_alt_F2: 'exec(pactl set-sink-volume 0 -10%)'
  mod_alt_F3: 'exec(pactl set-sink-volume 0 +10%)'
  mod_alt_F5: 'exec(light -U 20)'
  mod_alt_F6: 'exec(light -A 20)'
  mod_alt_F10: 'layout_set(narrow)'
  mod_alt_F11: 'layout_set(columns)'
  mod_alt_F12: 'layout_set(grid)'
  mod_ctrl_h: 'layout_resize(h)'
  mod_ctrl_j: 'layout_resize(j)'
  mod_ctrl_k: 'layout_resize(k)'
  mod_ctrl_l: 'layout_resize(l)'
  mod_ctrl_shift_q: 'exit()'
  mod_e: 'expose()'
  mod_f: 'win_toggle_floating()'
  mod_g: 'exec(google-chrome --simulate-outdated-no-au --new-window --incognito)'
  mod_h: 'focus_move(h)'
  mod_j: 'focus_move(j)'
  mod_k: 'focus_move(k)'
  mod_l: 'focus_move(l)'
  mod_m: 'win_toggle_maximize()'
  mod_r: 'exec(xkb-switch -s us; rofi -show drun)'
  mod_s: 'mark_switch_window()'
  mod_p: 'win_toggle_pinned()'
  mod_ctrl_1: 'tag_append(1)'
  mod_ctrl_2: 'tag_append(2)'
  mod_ctrl_3: 'tag_append(3)'
  mod_ctrl_4: 'tag_append(4)'
  mod_ctrl_5: 'tag_append(5)'
  mod_ctrl_6: 'tag_append(6)'
  mod_ctrl_7: 'tag_append(7)'
  mod_ctrl_8: 'tag_append(8)'
  mod_ctrl_9: 'tag_append(9)'
  mod_shift_1: 'win_move_tag(1)'
  mod_shift_2: 'win_move_tag(2)'
  mod_shift_3: 'win_move_tag(3)'
  mod_shift_4: 'win_move_tag(4)'
  mod_shift_5: 'win_move_tag(5)'
  mod_shift_6: 'win_move_tag(6)'
  mod_shift_7: 'win_move_tag(7)'
  mod_shift_8: 'win_move_tag(8)'
  mod_shift_9: 'win_move_tag(9)'
  mod_shift_CR: 'exec(xkb-switch -s us; urxvt -name urxvt-float -g 120x32)'
  mod_shift_F1: 'win_move_screen(1)'
  mod_shift_F2: 'win_move_screen(2)'
  mod_shift_F3: 'win_move_screen(3)'
  mod_shift_F4: 'win_move_screen(4)'
  mod_shift_F5: 'win_move_screen(5)'
  mod_shift_F6: 'win_move_screen(6)'
  mod_shift_F7: 'win_move_screen(7)'
  mod_shift_F8: 'win_move_screen(8)'
  mod_shift_F9: 'win_move_screen(9)'
  mod_shift_c: 'win_close()'
  mod_shift_ctrl_l: 'exec(lock)'
  mod_shift_g: 'exec(google-chrome --simulate-outdated-no-au --new-window)'
  mod_shift_h: 'focus_swap(h)'
  mod_shift_j: 'focus_swap(j)'
  mod_shift_k: 'focus_swap(k)'
  mod_shift_l: 'focus_swap(l)'
  mod_shift_s: 'mark_window()'
  mod_shift_w: 'exec(firefox --new-instance)'
  mod_w: 'exec(firefox --new-instance --private-window)'

## Rules applied to new windows by WM_CLASS
# floating        -- should the window be tiled (by default for non-transient) or floating
# follow          -- focus new window and switch to it's screen & tag
# pinned          -- make the window always ahead of others
# screen          -- preferred screen to attach the window to (starts with 1)
# tag             -- preferred tag to attach the window to (starts with 1)
# placement       -- takes precedence over screen & tag (see description and example below)
# soft_placement  -- just like placement but used with lower priority and during special events (see handle_screens())
#
# There is no any validation, so take care using 'placement'!
# Placement is an array indexed over number of screens:
#   - ~       # element #0 means a configuration with no displays
#   - [1, 6]  # element #1 aka 1 display connected: place the window on the 6th tag of the first screen
#   - [1, 4]  # element #2 aka 2 displays connected: place the window on the first screen, 4th tag
# Placement could also be defined as an array of hashes:
#   - if_screens: 2 # the window should be placed on the 1st screen and 5th tag when there are 2 displays connected
#     screen: 1
#     tag: 5
# Value should be an undef (~) or an array of [ screen, tag ] (both starts with 1).
# Either you connect more screens than specified, or the placement is undef; the default screen and tag will be used.
rules:
  evolution:
    follow: 0
    tag: 3
  org.gnome.Evolution:
    follow: 0
    screen: 1
    tag: 3
  evolution-alarm-notify:
    floating: 1
    urgent: 1
  rofi:
    pinned: 1
  flameshot:
    floating: 1
    pinned: 1
  galculator:
    floating: 1
  mattermost:
    # see Placement above
    # 0 screens: we don't care
    # 1 screens: place it on the only screen, tag #4
    # 2 screens: place it on the second screen, tag #4
    # 3 screens: place it on the third screen, tag #4
    placement:
      - if_screens: 1
        screen: 1
        tag: 4
      - if_screens: 2
        screen: 2
        tag: 4
      - if_screens: 3
        screen: 3
        tag: 4
    follow: 1
  google-chrome:
    # see Placement above
    # During screen topology change (HDMI/DP hotplug) in case of:
    # - 2 screens connected => by default move Chrome to 2nd screen, tag #7
    # - 3 screens connected => by default move Chrome to 2nd screen, tag #7
    # "by default" means in the absense of $pref_position and 'placement' rules for the window
    soft_placement:
      - if_screens: 2
        screen: 2
        tag: 7
      - if_screens: 3
        screen: 2
        tag: 7
  urxvt-float:
    floating: 1
  xeyes:
    floating: 1

## List of WM_NAME of windows which we want to see despite unset WM_CLASS
noclass_whitelist:
  - Event Tester
  - glxgears

## List of commands to execute during startup
autostart:
  - 'exec(setxkbmap -layout us,ru -option grp:alt_shift_toggle,compose:ralt)'

# vim: set ft=yaml ts=2 sw=2 cc=119 :