<commit_before>-- http://www.nepherte.be/step-by-step-configuration-of-xmonad/

-- Import statements
import XMonad
import XMonad.Util.Run
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName

import Control.Monad (liftM2)

import qualified Data.Map as M
import qualified XMonad.StackSet as W

import System.IO

-- Define the names of all workspaces
myWorkspaces = [ "1:web", "2:chat", "3:browse", "4:other" ]

-- Layout
myLayout = avoidStruts $ layoutHook defaultConfig

-- Windows management
myManageHook = composeAll . concat $
    [
        -- Applications that go to web
        [ className =? b --> viewShift "1:web"  | b  <- myClassWebShifts  ],
        -- Applications that go to chat
        [ title     =? c --> viewShift "2:chat" | c <- myTitleChatShifts  ],
        -- Applications to ignore
        [ resource  =? i --> doIgnore           | i  <- myResourceIgnores ]
    ]
    where
      viewShift         = doF . liftM2 (.) W.greedyView W.shift
      myClassWebShifts  = [ "Firefox", "Chromium" ]
      myTitleChatShifts = [ "gnus", "jabber" ]
      myResourceIgnores = [ "stalonetray" ]

-- Define keys to add
keysToAdd x =
    [
        -- Rebind dmenu
        ((modMask x, xK_p), spawn "~/.config/dmenu/dmenu-bind.sh"),
        -- Lock the screen
        (((modMask x .|. controlMask), xK_l), spawn "xscreensaver-command -lock"),
        -- File Browser
        (((modMask x .|. controlMask), xK_f), spawn "pcmanfm"),
        -- Web Browser
        (((modMask x .|. controlMask), xK_w), spawn "firefox"),
        -- gnus
        (((modMask x .|. controlMask), xK_m), spawn "emacs -T gnus -f gnus"),
        -- jabber
        (((modMask x .|. controlMask), xK_j), spawn "emacs -T jabber -f jabber-display-roster -f jabber-connect-all")
    ]

-- Define keys to remove
keysToRemove x =
    [
        -- Unused dmenu default binding
        (modMask x, xK_p),
        -- Unused gmrun binding
        (modMask x .|. shiftMask, xK_p)
    ]

-- Delete the keys combinations we want to remove.
strippedKeys x = foldr M.delete (keys defaultConfig x) (keysToRemove x)

-- Compose all my key combinations
myKeys x = M.union (strippedKeys x) (M.fromList (keysToAdd x))

-- Define terminal
myTerminal = "urxvt"
<commit_msg>[xmonad] Adds key bindings for audio volume.<commit_after>-- http://www.nepherte.be/step-by-step-configuration-of-xmonad/

-- Import statements
import XMonad
import XMonad.Util.Run
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName

import Control.Monad (liftM2)

import qualified Data.Map as M
import qualified XMonad.StackSet as W

import System.IO

-- Define the names of all workspaces
myWorkspaces = [ "1:web", "2:chat", "3:browse", "4:other" ]

-- Layout
myLayout = avoidStruts $ layoutHook defaultConfig

-- Windows management
myManageHook = composeAll . concat $
    [
        -- Applications that go to web
        [ className =? b --> viewShift "1:web"  | b  <- myClassWebShifts  ],
        -- Applications that go to chat
        [ title     =? c --> viewShift "2:chat" | c <- myTitleChatShifts  ],
        -- Applications to ignore
        [ resource  =? i --> doIgnore           | i  <- myResourceIgnores ]
    ]
    where
      viewShift         = doF . liftM2 (.) W.greedyView W.shift
      myClassWebShifts  = [ "Firefox", "Chromium" ]
      myTitleChatShifts = [ "gnus", "jabber" ]
      myResourceIgnores = [ "stalonetray" ]

-- Define keys to add
keysToAdd x =
    [
        -- Rebind dmenu
        ((modMask x, xK_p), spawn "~/.config/dmenu/dmenu-bind.sh"),
        -- Lock the screen
        (((modMask x .|. controlMask), xK_l), spawn "xscreensaver-command -lock"),
        -- File Browser
        (((modMask x .|. controlMask), xK_f), spawn "pcmanfm"),
        -- Web Browser
        (((modMask x .|. controlMask), xK_w), spawn "firefox"),
        -- gnus
        (((modMask x .|. controlMask), xK_m), spawn "emacs -T gnus -f gnus"),
        -- jabber
        (((modMask x .|. controlMask), xK_j), spawn "emacs -T jabber -f jabber-display-roster -f jabber-connect-all"),
        -- Audio volume
        ((0, 0x1008FF13), spawn "audio-volume up"),
        ((0, 0x1008FF11), spawn "audio-volume down")
    ]

-- Define keys to remove
keysToRemove x =
    [
        -- Unused dmenu default binding
        (modMask x, xK_p),
        -- Unused gmrun binding
        (modMask x .|. shiftMask, xK_p)
    ]

-- Delete the keys combinations we want to remove.
strippedKeys x = foldr M.delete (keys defaultConfig x) (keysToRemove x)

-- Compose all my key combinations
myKeys x = M.union (strippedKeys x) (M.fromList (keysToAdd x))

-- Define terminal
myTerminal = "urxvt"

{'fraction_non_alphanumeric': 0.13008303172237598, 'fraction_numerical': 0.006812859271875665, 'mean_word_length': 2.3969631236442517, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4465113', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1567, 'n_words': 440}