diff options
author | Tom Willemse | 2016-07-17 22:03:09 +0200 |
---|---|---|
committer | Tom Willemse | 2016-07-17 22:03:09 +0200 |
commit | d62e0a6db01b0d853b080d2c09b6453a9ecaed85 (patch) | |
tree | 8f79e3e1bd49f411a10add2749c69841da8c77a3 /herbstluftwm/.config | |
parent | 51d133b556b190362d97b99606978a2a98917cde (diff) | |
download | new-dotfiles-d62e0a6db01b0d853b080d2c09b6453a9ecaed85.tar.gz new-dotfiles-d62e0a6db01b0d853b080d2c09b6453a9ecaed85.zip |
Add some helper functions
Diffstat (limited to 'herbstluftwm/.config')
-rwxr-xr-x | herbstluftwm/.config/herbstluftwm/autostart | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/herbstluftwm/.config/herbstluftwm/autostart b/herbstluftwm/.config/herbstluftwm/autostart index d0cc91a..0ffd2e0 100755 --- a/herbstluftwm/.config/herbstluftwm/autostart +++ b/herbstluftwm/.config/herbstluftwm/autostart @@ -1,9 +1,28 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash -# this is a simple config for herbstluftwm +## Helper functions: -hc() { - herbstclient "$@" +# This simple function saves a lot of keystrokes when editing this +# configuration. Instead of typing "herbstluftwm" everywhere, I can +# just type "hc". This is part of the default configuration. +function hc() { herbstclient "$@" } + +# This function picks a random wallpaper from a list collection. +function random-wallpaper() { + find ~/pictures/wallpapers -type f \ + -wholename '*/3840x1080/*' -o -wholename '*/patterns/*' \ + | shuf -n 1 +} + +# This function adds an attribute to a herbstluftwm tag that tells it +# which monitor it should appear on, in case I care. Usually I want +# Emacs and my terminal to always appear on my primary monitor, and +# Conkeror/Firefox on my secondary, I don't like it when they get +# switched. +function lock-tag-to-monitor() { + herbstclient chain \ + , new_attr string tags.by-name."$1".my-monitor \ + , set_attr tags.by-name."$1".my-monitor "$2" } hc emit_hook reload @@ -155,7 +174,6 @@ hc unlock herbstclient set tree_style '╾│ ├└╼─┐' -# do multi monitor setup here, e.g.: -# hc set_monitors 1280x1024+0+0 1280x1024+1280+0 -# or simply: -# hc detect_monitors +## Monitors +# I have two monitors, each with a resolution of 1920x1080. +hc set_monitors 1920x1080+0+0 1920x1080+1920+0 |