inclement / vivarium

A dynamic tiling Wayland compositor using wlroots
GNU General Public License v3.0
367 stars 13 forks source link

Keybinds don't seem to work #46

Closed ProjectInfinity closed 3 years ago

ProjectInfinity commented 3 years ago

Hi, after #45 I was finally able to build and try this out however I noticed that keys are not being bound.

I have made sure that alacritty is installed, yet doing alt+t does not spawn a terminal. Additionally changing meta-key to "super" seems to say that super is an invalid meta key despite being listed

Options: alt, ctrl, logo/super, mod2, mod3

Do you have any suggestions?

My config is a copy of the provided config:


[global-config]
# Options: alt, ctrl, logo/super, mod2, mod3
# This key can be referenced in custom keybindings as `meta`
meta-key = "alt"

focus-follows-mouse = true

# One workspace with each name is generated automatically. Each workspace receives layouts
# as defined in the [[layout]] list below. You can configure keybindings to switch to
# workspaces by name, or to move windows between them.
workspace-names = ["main", "2", "3", "4", "5", "6", "7", "8", "9"]

# Autogenerate keybinds to switch to workspaces, specifically:
# - Bind meta-$N to switch to workspace number N, for each number key $N,
# - Bind meta-shift-$N to move the active window to workspace number N, for each number key $N
# You can also/alternatively create these bindings via custom [[keybind]]s below.
# Set this to false to disable automatic keybind generation and leave the keybinds all to you.
bind-workspaces-to-numbers = true

# Cursor button used to drag windows around (also making them floating) when meta is held
win-move-cursor-button = "left"

# Cursor button used to resize windows (also making them floating) when meta is held
win-resize-cursor-button = "right"

# Window border configuration
border-width = 2  # pixels
active-border-colour = [1.0, 0.0, 0.7, 1.0]  # rgba
inactive-border-colour = [0.6, 0.6, 0.9, 1.0]  # rgba

# Gap distance between windows
gap-width = 0  # pixels

# Desktop background colour. Note this is overridden by the [background] if set.
clear-colour = [0.73, 0.73, 0.73, 1.0]

### BACKGROUND ###
# The background options are displayed using `swaybg`. Make sure you have this installed
# if you want to use them.
[background]
colour = "#bbbbbb"
image = "/path/to/your/background.png"
mode = "fill"

### XKB-CONFIG ###
# These all accept standard xkb syntax and options, e.g. as you would pass to `setxkbmap`
# run from a shell.
[xkb-config]
# model = "pc104"
# layout = "us"
# variant = "basic"
# options = "ctrl:nocaps"

### BAR ###
# Options for configuring a bar program. The desktop bar (if any) is often used to display
# information such as current workspaces, system information, and open windows.
[bar]
command = "waybar"  # note this is a command to execute: this program must be installed to work
update-signal-number = 1

### IPC ###
# Inter-process communication settings.
[ipc]
# The filename to which Vivarium will write workspace state information whenever something changes.
# Programs can watch this file to display the workspace status.
# This is a hacky solution that will be deprecated at some point.
# workspaces-filename = "/path/to/some/file.txt"

### DEBUG ###
# Vivarium debug options included for completion. You will want to leave these false under
# normal operation.
[debug]
# Draw a graphical indicator of what shell (XDG, XWayland, Layer) is providing each window surface.
mark-views-by-shell = false

# Draw a graphical indicator of what shell (i.e. normally what monitor) is currently active.
mark-active-output = false

### LAYOUTS ###
# Configure any number of layouts. Each workspace gets an independent copy of each layout.
# The following options are available for each layout:
# - name : The layout name to display in bar programs and logs, can be anything
#          Defaults to matching the `layout` option.
# - layout : The name of the Vivarium layout function to use.
#            Run `vivarium -h` to get a list of available layout names.
# - show-borders : If true, draw borders around windows. Defaults to true.
# - ignore-excluded-regions : If true, tile windows across the full workspace regardless of
#                             space reserved for bars, system tray etc.
#
# Run `vivarium --list-config-options` to get a list of available layouts.

[[layout]]
name = "Tall"
layout = "split"

[[layout]]
name = "Fullscreen"
layout = "fullscreen"
show-borders = false

[[layout]]
name = "Fullscreen No Borders"
layout = "fullscreen"
ignore-excluded-regions = true
show-borders = false

### KEYBINDS ###
# Configure any number of keybinds. The following options are available for each one:
# - modifiers : List of strings, not compulsory, defaults to ["meta"]
# - keysym : Keysym to bind to. The keysym is the value of the key as interpreted by your keyboard layout.
#            You may not bind to both keysym and keycode in the same binding.
# - keycode : Keycode to bind to. The keycode is the numerical identifier of the hardware key.
#             It always has the same value for a given physical key regardless of your keyboard layout.
# - action : Any Vivarium action.
#            Run `vivarium -h` to show documentation of all available actions, or see examples below.
# - <action-arguments> : Arguments for the `action`, if applicable.
#                        See action documentation for available arguments.
#
# To find the keysym or keycode of a given key, use tools like `wev` or `xev`.
#
# Run `vivarium --list-config-options` to get a list of available keybind actions

[[keybind]]
keysym = "Q"
action = "terminate"

[[keybind]]
keysym = "T"
action = "do_exec"
executable = "alacritty"

[[keybind]]
modifiers = ["meta", "shift"]
keysym = "Return"
action = "do_exec"
executable = "alacritty"

[[keybind]]
keysym = "l"
action = "increment_divide"
increment = 0.05

[[keybind]]
keysym = "h"
action = "increment_divide"
increment = -0.05

[[keybind]]
keysym = "comma"
action = "increment_counter"
increment = 1

[[keybind]]
keysym = "period"
action = "increment_counter"
increment = -1

[[keybind]]
keysym = "j"
action = "next_window"

[[keybind]]
keysym = "k"
action = "prev_window"

[[keybind]]
keysym = "J"
action = "shift_active_window_down"

[[keybind]]
keysym = "K"
action = "shift_active_window_up"

[[keybind]]
keysym = "t"
action = "tile_window"

[[keybind]]
keysym = "e"
action = "right_output"

[[keybind]]
keysym = "w"
action = "left_output"

[[keybind]]
keysym = "space"
action = "next_layout"

[[keybind]]
keysym = "E"
action = "shift_active_window_to_right_output"

[[keybind]]
keysym = "W"
action = "shift_active_window_to_left_output"

[[keybind]]
keysym = "C"
action = "close_window"

[[keybind]]
keysym = "Return"
action = "make_window_main"

[[keybind]]
keysym = "R"
action = "reload_config"

[[keybind]]
keysym = "o"
action = "do_exec"
executable = "bemenu-run"

[[keybind]]
modifiers = []
keysym = "XF86AudioMute"
action = "do_shell"
command = "pactl set-sink-mute 0 toggle"

[[keybind]]
modifiers = []
keysym = "XF86AudioLowerVolume"
action = "do_shell"
command = "amixer -q sset Master 3%-"

[[keybind]]
modifiers = []
keysym = "XF86AudioRaiseVolume"
action = "do_shell"
command = "amixer -q sset Master 3%+"

### LIBINPUT CONFIG ###
# Create any number of libinput configurations. The following options are available for each libinput config:
# - device-name : A string to match libinput devices that should have your rules applied.
# - scroll-method : One of "no-scroll", "2-finger", "edge" or "scroll-button".
# - scroll-button : An integer representing the libinput button index to use for scrolling.
#                   Has no effect unless scroll-method="scroll-button".
# - middle-emulation : If true, emulate middle click events when clicking left and right simultaneously.
#                      Defaults to false.
# - left-handed : If true, switch left and right buttons. Defaults to false.
# - natural-scroll : If true, switch the scrolling direction from default style (scroll down => go down)
#                    to so-called "natural" style (scroll down => go up). Defaults to false.

[[libinput-config]]
# Example libinput-config for a popular trackball:
device-name = "Logitech USB Trackball"
scroll-method = "scroll-button"
scroll-button = 8
middle-emulation = true
left-handed = false
natural-scroll = false```
inclement commented 3 years ago

yet doing alt+t does not spawn a terminal

The keysym is actually case-sensitive, so it needs to be alt+shift+t (i.e. alt+T) to spawn the terminal. Does that work?

Additionally changing meta-key to "super" seems to say that super is an invalid meta key despite being listed

Oops, my mistake on that one - I originally was going to accept both but ended up thinking there wasn't much point. I've opened #47 to correct the doc for now.

ProjectInfinity commented 3 years ago

The keysym is actually case-sensitive, so it needs to be alt+shift+t (i.e. alt+T) to spawn the terminal. Does that work?

Yes, that seems to work! Was a bit confusing :)

Oops, my mistake on that one - I originally was going to accept both but ended up thinking there wasn't much point. I've opened #47 to correct the doc for now.

Is it hard to support super as meta key? It's common practice for a lot of DEs these days (i.e. when resizing or moving windows in stuff like GNOME/KDE etc.) and I'm sure I won't be the only one asking for it. :)

inclement commented 3 years ago

The super key should work fine (it's what I use), just "logo" is the current name for it in the config. The only real reason for that is it's what wlroots calls it. I'll rethink adding in super as a valid alias for the same key though.

ProjectInfinity commented 3 years ago

Aha ok. I wasn't aware, that makes it simple. :)

inclement commented 3 years ago

Thanks for the issue reports - they're much appreciated.