/hyprfloat

Primary LanguageRustMIT LicenseMIT

HYPRFLOAT

Improve your experience with floating windows!

Supports Hyprland >= 42.0

Hyprfloat is a project, presented by 4 console apps based on common library: hfopen, hftogglefloating, hfresizeactive, hfmovewindow. This project is designed to simplify control of floating windows in Hyprland with keyboard and customize their behaviour using config and console arguments

Usage examples

hfopen

hfopen

hfopen.mp4

hyprland.conf:

bind = Super Shift, Return, exec, hfopen -s 600 450 -p cursor kitty
bind = Super Shift, R, exec, hfopen -s 700 650 -p center "nautilus --new-window"
bind = Super Shift, F, exec, hfopen -d -p cursor firefox
hftogglefloating

hftogglefloating

hftogglefloating.mp4

hyprland.conf:

bind = Super Shift, Space, exec, hftogglefloating -p center
bind = Super, Space, exec, hftogglefloating -d -p cursor
hfresizeactive

hfresizeactive

hfresizeactive.mp4

hyprland.conf:

bind = Super Alt, Left , exec, hfresizeactive  -100   0    
bind = Super Alt, Down , exec, hfresizeactive   0     100     
bind = Super Alt, Up   , exec, hfresizeactive   0    -100    
bind = Super Alt, Right, exec, hfresizeactive   100   0     

hfmovewindow

hfmovewindow

hfmovewindow.mp4

hyprland.conf:

bind = Super Shift, Left , exec, hfmovewindow l    
bind = Super Shift, Down , exec, hfmovewindow d   
bind = Super Shift, Up   , exec, hfmovewindow u   
bind = Super Shift, Right, exec, hfmovewindow r   
bind = Super Shift, X, exec, hfmovewindow -p center
bind = Super Shift, C, exec, hfmovewindow -p cursor
bind = Super Shift, Z, exec, hfmovewindow -p far 

Requirements

rust/rustup
sudo

Installation

git clone https://github.com/jvc84/hyprfloat
cd hyprfloat
bash install.sh

Information

You can get this information by using flag --help or -h with any binary

Default config path: $HOME/.config/hyprfloat/hf.toml

hfopen

hfopen

Usage: hfopen [OPTIONS] <EXECUTABLE>

Arguments:
<EXECUTABLE>  Program to run (Example: "nautilus --new-window")

Options:
-f, --force                   Do not detect padding, even if 'detect_padding' option in config equals 'true'
-d, --default-size            Resize window according to config parameter 'default_size'
-o, --origin-size             Open small window and then resize it
-t, --tiled                   Open window floating, then tile
-s, --size <SIZE_X> <SIZE_Y>  Set window size by x-axis to <SIZE_X>, by y-axis to <SIZE_Y>
-a, --at <AT_X> <AT_Y>        Set window open position by x-axis to <POS_X>, by y-axis to <POS_Y>
-p, --position <POSITION>     Open window according to <POSITION> value [possible values: l, left, r, right, t, top, b, bottom, tl, top-left, tr, top-right, bl, bottom-left, br, bottom-right, cursor, center, random, far, close, opposite, any]
-c, --config <CONFIG>         Path to config file [default: /home/adex/.config/hyprfloat/hf.toml]
-h, --help                    Print help
-V, --version                 Print version
hftogglefloating

hftogglefloating

Usage: hftogglefloating [OPTIONS]

Options:
  -f, --force                   Do not detect padding, even if 'detect_padding' option in config equals 'true'
  -d, --default-size            Resize window according to config parameter 'default_size'
  -s, --size <SIZE_X> <SIZE_Y>  Set window size by x axis to <SIZE_X>, by y axis to <SIZE_Y>
  -a, --at <AT_X> <AT_Y>        Set window open position by x axis to <POS_X>, by y axis to <POS_Y>
  -p, --position <POSITION>     Open window according to <POSITION> value [possible values: l, left, r, right, t, top, b, bottom, tl, top-left, tr, top-right, bl, bottom-left, br, bottom-right, cursor, center, random, far, close, opposite, any]
  -c, --config <CONFIG>         Path to config file [default: /home/adex/.config/hyprfloat/hf.toml]
  -h, --help                    Print help
  -V, --version                 Print version
                                                
hfresizeactive # hfresizeactive
Usage: hfresizeactive [OPTIONS] <RESIZE_X> <RESIZE_Y>

Arguments:
  <RESIZE_X>  resize window by x-axis on <RESIZE_X> pixels according to config parameters
  <RESIZE_Y>  resize window by y-axis on <RESIZE_Y> pixels according to config parameters

Options:
  -f, --force            Do not detect padding, even if 'detect_padding' option in config equals 'true'
  -n, --no-invert        Do not invert resize in stick mode, even if 'invert_resize_in_stick_mode' option in config equals 'true'
  -e, --exact            Set size of floating window exactly <RESIZE_X> pixels on x-axis, <RESIZE_Y> pixels on y-axis
  -c, --config <CONFIG>  Path to config file [default: /home/adex/.config/hyprfloat/hf.toml]
  -h, --help             Print help
  -V, --version          Print version
hfmovewindow

hfmovewindow

Usage: hfmovewindow [OPTIONS] [DIRECTION]

Arguments:
  [DIRECTION]  Direction to move window to [possible values: l, r, u, d]

Options:
  -f, --force                Do not detect padding, even if 'detect_padding' option in config equals 'true'
  -p, --position <POSITION>  Open window according to <POSITION> value [possible values: l, left, r, right, t, top, b, bottom, tl, top-left, tr, top-right, bl, bottom-left, br, bottom-right, cursor, center, random, far, close, opposite, any]
  -c, --config <CONFIG>      Path to config file [default: /home/adex/.config/hyprfloat/hf.toml]
  -h, --help                 Print help
  -V, --version              Print version