Skip to content

Commit

Permalink
Merge pull request #13 from JLErvin/devel
Browse files Browse the repository at this point in the history
Fixed symlink issue
  • Loading branch information
JLErvin authored Dec 28, 2018
2 parents 1a9f997 + d69d588 commit 46b5a77
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 20 deletions.
1 change: 0 additions & 1 deletion example/sxhkdrc

This file was deleted.

67 changes: 67 additions & 0 deletions example/sxhkdrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# wm independent hotkeys
#

# terminal emulator
super + Return
urxvt

# program launcher
super + d
dmenu_run

# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd

#
# berry hotkeys
#

super + {h, j, k, l}
berryc window_move {-50 0, 0 50, 0 -50, 50 0}

super + shift + {h, j, k, l}
berryc window_resize {-50 0, 0 50, 0 -50, 50 0}

super + {0-9}
berryc switch_workspace {0-9}

super + shift + {0-9}
berryc send_to_workspace {0-9}

super + m
berryc window_monocle

super + f
berryc fullscreen

super + p
berryc snap_right

super + o
berryc snap_left

super + o
berryc snap_left

super + n
berryc toggle_decorations

super + Tab
berryc cycle_focus

super + q
berryc window_close

super + c
berryc window_center

alt + !button1
berryc pointer_move 1

alt + @button1
berryc pointer_move 2

~button1
berryc pointer_move 0 0
27 changes: 8 additions & 19 deletions wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "ipc.h"

#define MAX(a, b) ((a > b) ? (a) : (b))
#define MIN(a, b) ((a < b) ? (a) : (b))

struct monitor
{
Expand Down Expand Up @@ -972,34 +971,24 @@ move_relative(struct client *c, int x, int y)
int dx, dy, mon;
mon = ws_m_list[c->ws];

/* If the right side of the window is past the right-most
* side of the associated monitor
*/
/* Lock on the right side of the screen */
if (c->x + c->w + x > m_list[mon].w + m_list[mon].x)
dx = m_list[mon].w + m_list[mon].x - c->w;
/* Lock on the left side of the screen */
else if (c->x + x < m_list[mon].x)
dx = m_list[mon].x;
else
dx = c->x + x;

/* If the bottom side of the window is below the bottom of
* the associate monitor
*/
/* Lock on the bottom of the screen */
if (c->y + c->h + y > m_list[mon].h + m_list[mon].y)
dy = m_list[mon].h + m_list[mon].y - c->h;
/* Lock on the top of the screen */
else if (c->y + y < m_list[mon].y + conf.top_gap)
dy = m_list[mon].y;
else
dy = c->y + y;

/* If the left side of the window is past the left-most
* side of the associated monitor
*/
if (c->x + x < m_list[mon].x)
dx = m_list[mon].x;

/* If the top side of the window is above the top of
* the associated monitor
*/
if (c->y + y < m_list[mon].y + conf.top_gap)
dy = m_list[mon].y;

move_absolute(c, dx, dy);
}
else
Expand Down

0 comments on commit 46b5a77

Please sign in to comment.