-
-
Notifications
You must be signed in to change notification settings - Fork 33
Configuring Hypr
The config is located in ~/.config/hypr/hypr.conf
.
I recommend you copy the examples/hypr.conf
, but you can also edit the autogenerated config.
By removing the line autogenerated=1
you'll remove the yellow warning.
A config is required. The WM will autogenerate one for you, or throw an error when it cannot read the file.
Get the example config from /example/hypr.conf
and paste it into ~/.config/hypr/hypr.conf
. You're done! Now you can edit it using the guidelines below.
gaps_in=int
- Gaps between windows
border_size=int
- Border size
gaps_out=int
- Gaps between monitor edges and windows
max_fps=int
- Max fps for updates of config, animations and the bar. (Recommended: 30-60)
layout=int
- Layout to use (0 - dwindling, default, 1 - master)
focus_when_hover=int
- (0/1) change focus when your cursor moves to a different window
ignore_mod=MOD
- Set an ignored mod (e.g. scroll lock or whatever) to not interfere with your keybinds.
intelligent_transients=int
- (0/1) intelligent transients make sure floated children windows are on top of their parents. (recommended 1, very useful and intuitive!)
col.active_border=hex
- Color of the active window border
col.inactive_border=hex
- Color of the inactive window border
status_command=string
- Deprecated
scratchpad_mon=int
- Self-explanatory
Warning: True animations (anim.cheap=0
) can be very laggy. Use if you have a very powerful PC and don't care about the choppiness.
Cheap animations do not look bad. They are just different, and way way smoother and easier for your PC to handle.
Start the animations section with Animations {
and end with }
in separate lines!
enabled=int
- Enable window animations (0/1)
speed=float
- Animation speed for workspaces (default: 8)
window_resize_speed=float
- Animation speed for windows (default: 8)
cheap=int
- Enable cheap animations (0/1) - HIGHLY recommended to set this to 1.
borders=int
- Enable border animations (0/1)
workspaces=int
- Enable workspace wipe animations (0/1) - not really recommended, slow and will bug with compositors.
Start the layout section with layout {
and end with }
in separate lines!
no_gaps_when_only=int
- Disables gaps and borders when there is only one window on a monitor (basically, pseudo-fullscreen, but you see the bar.) (0/1)
start the bar section with Bar {
and end with }
both in separate lines!
enabled=int
- Enable the bar (0/1)
force_no_tray=int
- (0/1) Force Hypr not to create a tray (makes other bars' trays work)
height=int
- Pixel height of the bar
monitor=int
- Monitor to place the bar on (0 = default)
mod_pad_in=int
- The padding (in px) between the modules edge and text edge
no_tray_saving=int
- Don't save the tray between reloads (0/1) recommended 1 due to a bug with tray saving that could kill your bar.
col.bg=hex
- Color of the bar's background
col.high=hex
- Default high color for the bar (used in e.g. the workspaces widget)
col.font_main=hex
- Primary text color (used for e.g. workspaces)
col.font_secondary=hex
- Secondary text color
font.main=str
- The main font to use (for the text)
font.secondary=str
- The font for the icons to use
font.size=float
- Font size. Default is 12.
Modules are created with the module=
keyword. Some examples to show you how they work:
module=right,X,0xffffffff,0xff00ff33,1000,$date +%a,\ %b\ %Y\ \ %I:%M\ %p$
module=left,,0xffffffff,0xff400080,1000,%RAM%
module=center,,0xffffffff,0xff400080,1000,%WINNAME%
Basically,
module=ALIGN,ICON,COLORTEXT,COLORBG,REFRESHMS,CONTENT
For icons, I recommend using the Nerd fonts (e.g. Iosevka Nerd) and unicode. (see here for a cheat sheet)
Content can have 2 types of tokens: %PERCENTTOKENS% and
PercentTokens are given by Hypr and an invalid one will throw an error.
CommandTokens are basically commands that Hypr will execute and return the output of.
RAM, CPU, WINNAME, WINCLASS
RAM - RAM usage (using/total)
CPU - CPU usage (percent)
WINNAME - Current window's title (e.g. github.com - where the world writes code - Firefox Nightly)
WINCLASS - Current window's class, aka. short title (e.g. Firefox)
content of workspaces
will draw a workspaces widget.
content of tray
will draw a systray widget.
There is one special module which is a separator. It's created like this:
module=pad,left,100
Where you put pad, then the alignment, and the pixel width of it.
Binds are done fairly simply. The syntax for creating a bind is as follows:
bind=MOD,KEY,DISPATCHER,COMMAND
The KEY is the XOrg key name. Check them with the xmodmap -pk
command or xev -event keyboard
.
A-Z, 0-9, RETURN, SPACE, LEFT, RIGHT, UP, DOWN, as the most common keys are guaranteed to work if input like this. Other keys are case-sensitive and must be the first result when issuing a command xmodmap -pk | grep <KEYNAME>
You can also use a number that indicates the KEYSYM code that xev
gives you. Remember that xev
gives them in HEXADECIMAL and Hypr reads in DECIMAL. (meaning you have to convert base-16 to base-10) Also, it has to be >10, because 0-9 are reserved for the keyboard keys with digits.
For moving windows and resizing them,
main_mod=str
And then hold the main_mod and left/right mouse button.
You can find example binds in the examples/hypr.conf config file.
SHIFT SUPER/MOD4 CTRL ALT/MOD1 MOD2 MOD3 MOD5
You can mix them, eg.: SHIFTSUPER
or CTRLALTSUPER
.
You can also use masks, e.g. 8
or 128
.
And of course you can leave it empty for no modifier. (e.g. bind=,A,exec,amongus
)
exec - executes a shell command - COMMAND: command to execute
killactive - kills the focused window - No params
fullscreen - fullscreens the focused window - No params
movewindow - moves the focused window - COMMAND: l/r/u/d (left/right/up/down)
movefocus - moves the focus to the window neighboring - COMMAND: l/r/u/d (left/right/up/down)
movetoworkspace - moves the focused window to a workspace - COMMAND: number (workspace ID) or just scratchpad for scratchpad
movetoworkspace - moves the focused window to next/last workspace - COMMAND: +/- (move to workspace with ID+1/ID-1)
workspace - switches your view to a workspace - COMMAND: number (workspace ID)
togglefloating - toggles the focused window's floating state - No params
splitratio - adjust the split ratio - COMMAND: +/-/float (if +/- is used, split ratio will be changed by +0.05/-0.05)
pseudo - toggles the pseudotile status of the current window - No params
scratchpad - toggle the scratchpad - no params
nextworkspace - go to the next workspace - no params
lastworkspace - go to the last workspace - no params
pin - toggle the pinned state of a floating window
There is no dispatcher for reloading Hypr. Hypr is reloaded as soon as you save your config.
There is no dispatcher for quitting Hypr. You can use (for example) pkill Hypr
with exec
to kill the x server the ghetto way.
If this doesn't work (or you are running Xorg in sudo for whatever reason), try killall Xorg
, or elevated with echo [PASSWORD] | sudo -S killall Xorg
.
There are two keywords for executing stuff, exec
and exec-once
. They look like this:
exec=xterm
exec-once=firefox https://duckduckgo.com
exec
- executes a command every time the WM is reloaded. (on start and on config change)
exec-once
- executes a command ONLY on WM startup.
You can set specific window rules, for example:
windowrule=tiling,class:krunner
Basically,
windowrule=RULE,TEST
Where rules implemented are:
tiling - set window to tiling
floating - set window to floating
monitor <int> - set launch monitor id
size <int> <int> - set launch size (for floating only)
move <int> <int> - set launch coord (for floating only, on the launch monitor)
pseudo - automatically toggle pseudo on launch
fullscreen - toggle fullscreen on launch
workspace <int> - default workspace for window
and tests are structured PROP:REGEX
, and the implemented props are
class role
which correspond to the role and class ewmh atoms.
Please note that all rules are evaluated as a window is mapped (opened) and will NOT update already existing windows.
If you want a rule to apply to ALL windows, just like in RegEx, you can do .+
to match all windows. (e.g. class:.+
)