# Path: pwm/rules.py
# class Rule:
#     def __init__(self, prop, value, floating=False, workspace=None):
#         self.prop = prop
#         self.value = value.lower()
#         self.floating = floating
#         self.workspace = workspace


import pwm.commands as cmd
import pwm.widgets as widgets
from pwm.rules import Rule

    ("Control-Mod4-h", cmd.resize((-0.02, 0))),
    ("Control-Mod4-j", cmd.resize((0, 0.02))),
    ("Control-Mod4-k", cmd.resize((0, -0.02))),
    ("Control-Mod4-l", cmd.resize((0.02, 0))),

    ("XF86AudioRaiseVolume", cmd.spawn("amixer -q set Master 2dB+ unmute")),
    ("XF86AudioLowerVolume", cmd.spawn("amixer -q set Master 2dB- unmute")),
    ("XF86AudioMute", cmd.spawn("amixer -q set Master toggle")),

    ("XF86MonBrightnessUp", cmd.spawn("xbacklight -inc 10")),
    ("XF86MonBrightnessDown", cmd.spawn("xbacklight -dec 10")),
]

# Keys for every workspace.
# Note that workspace indices are zero-based.
for i in range(9):
    keys.append(("Mod4-{}".format(i+1), cmd.switch_workspace(i)))
    keys.append(("Shift-Mod4-{}".format(i+1), cmd.send_to_workspace(i)))
keys.append(("Mod4-0", cmd.switch_workspace(9)))
keys.append(("Shift-Mod4-0", cmd.send_to_workspace(9)))


# You can define rules for some windows.
# Each rule has a property and its value used to match a window.
# There are three possible properties: class, role and name.
# Use the xprop tool and look for WM_CLASS, WM_WINDOW_ROLE and _NET_WM_NAME
# (or WM_NAME), to get the correct values.
rules = [
    Rule("role", "preferences", floating=True),

# Path: pwm/rules.py
# class Rule:
#     def __init__(self, prop, value, floating=False, workspace=None):
#         self.prop = prop
#         self.value = value.lower()
#         self.floating = floating
#         self.workspace = workspace


# Path: pwm/default_config.py
import pwm.commands as cmd
import pwm.widgets as widgets
from pwm.rules import Rule


    ("Control-Mod4-h", cmd.resize((-0.02, 0))),
    ("Control-Mod4-j", cmd.resize((0, 0.02))),
    ("Control-Mod4-k", cmd.resize((0, -0.02))),
    ("Control-Mod4-l", cmd.resize((0.02, 0))),

    ("XF86AudioRaiseVolume", cmd.spawn("amixer -q set Master 2dB+ unmute")),
    ("XF86AudioLowerVolume", cmd.spawn("amixer -q set Master 2dB- unmute")),
    ("XF86AudioMute", cmd.spawn("amixer -q set Master toggle")),

    ("XF86MonBrightnessUp", cmd.spawn("xbacklight -inc 10")),
    ("XF86MonBrightnessDown", cmd.spawn("xbacklight -dec 10")),
]

# Keys for every workspace.
# Note that workspace indices are zero-based.
for i in range(9):
    keys.append(("Mod4-{}".format(i+1), cmd.switch_workspace(i)))
    keys.append(("Shift-Mod4-{}".format(i+1), cmd.send_to_workspace(i)))
keys.append(("Mod4-0", cmd.switch_workspace(9)))
keys.append(("Shift-Mod4-0", cmd.send_to_workspace(9)))


# You can define rules for some windows.
# Each rule has a property and its value used to match a window.
# There are three possible properties: class, role and name.
# Use the xprop tool and look for WM_CLASS, WM_WINDOW_ROLE and _NET_WM_NAME
# (or WM_NAME), to get the correct values.
rules = [
    Rule("role", "preferences", floating=True),

    Rule("class", "truecrypt", floating=True),