Skip to content

Instantly share code, notes, and snippets.

@vahidabdi
Forked from gilbertw1/.Xresources
Created February 3, 2019 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vahidabdi/e914ac08d92ab920ac51f65a2a0b9860 to your computer and use it in GitHub Desktop.
Save vahidabdi/e914ac08d92ab920ac51f65a2a0b9860 to your computer and use it in GitHub Desktop.
Hyper Light Drifter Dotfiles
# Tmux settings
# Set XTerm key bindings
setw -g xterm-keys on
# Set colors
set-option -g default-terminal "screen-256color"
# Remove key timeout
set -s escape-time 0
# Set reload key to r
bind r source-file ~/.tmux.conf
# Count sessions start at 1
set -g base-index 1
# Use vim bindings
setw -g mode-keys vi
# Send key to inner sessions
bind-key b send-prefix
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# Remap split window to emacs style
bind-key / split-window
unbind-key -
bind-key - split-window -h
# Set the title bar
#set -g set-titles on
#set -g set-titles-string '#(whoami) :: #h :: #(curl ipecho.net/plain;echo)'
# Set status bar
#set -g status-utf8 on
#set -g status-bg black
#set -g status-fg white
#set -g status-interval 5
#set -g status-left-length 90
#set -g status-right-length 60
#set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]#(hostname)#[fg=white]::#[fg=yellow]#(curl ipecho.net/plain;echo)#[fg=white] "
#set -g status-justify left
#set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'
#####################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
## Status bar design
# status line
#set -g status-utf8 on
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2
# messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black
#window mode
setw -g mode-bg colour6
setw -g mode-fg colour0
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-bg green
setw -g window-status-fg black
setw -g window-status-attr reverse
# Info on left (I don't have a session display for now)
set -g status-left ''
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
set -g default-terminal "screen-256color"
# The modes {
setw -g clock-mode-colour colour135
setw -g mode-attr bold
setw -g mode-fg colour196
setw -g mode-bg colour238
# }
# The panes {
set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51
# }
# The statusbar {
set -g status-position bottom
set -g status-bg "#282828" #colour234
set -g status-fg colour137
set -g status-attr dim
set -g status-left ''
#set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]#(hostname)#[fg=white]::#[fg=yellow]#(curl ipecho.net/plain;echo)#[fg=white] "
set -g status-right '#[fg=colour250]#(whoami)#[fg=orange]@#[fg=colour50]#(hostname) #[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S'
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-fg colour81
setw -g window-status-current-bg colour238
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-fg colour138
setw -g window-status-bg colour235
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1
# }
# The messages {
set -g message-attr bold
set -g message-fg colour232
set -g message-bg colour166
# }
Config {
font = "xft:MesloLGM:size=10:bold:antialias=true"
--, bgColor = "#242424"
, bgColor = "#282a36"
, fgColor = "gray"
, position = TopW L 90
, commands = [ Run Cpu ["-L","3","-H","50","-l","gray90","-n","gray90","-h","#ff5555"] 10
, Run Memory ["-t","Mem: <usedratio>%","-H","80","-L","10","-l","gray90","-n","gray90","-h","#F25555"] 10
, Run Date "%a %b %_d %k:%M" "date" 10
, Run DynNetwork ["-t","Net: +<rx>, -<tx>","-H","200","-L","10","-h","gray90","-l","gray90","-n","gray90"] 10
, Run CoreTemp ["-t", "Temp: <core1> <core2>", "-L", "40", "-H", "75", "-l", "lightblue", "-n", "gray90", "-h", "#F25555"] 50
, Run Com "network-check.sh" [] "netcheck" 5
-- battery monitor
, Run Battery [ "--template" , "Batt: <acstatus>"
, "--Low" , "10" -- units: %
, "--High" , "80" -- units: %
, "--low" , "#ff5555"
, "--normal" , "gray90"
, "--high" , "#50fa7b"
, "--" -- battery specific options
-- discharging status
, "-o" , "<left>% (<timeleft>)"
-- AC "on" status
, "-O" , "<fc=#50fa7b>Charging</fc>"
-- charged status
, "-i" , "<fc=#50fa7b>Charged</fc>"
] 50
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | %coretemp% | %memory% | %battery% | %dynnetwork% (%netcheck%) | <fc=#ffb86c>%date%</fc>" -- #69DFFA
}
Xft.dpi: 120
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintslight
! hightlight - #268BD2
! normal - #ffffff
rofi.color-enabled: true
rofi.color-window: #282a36, #282a36, #6272a4
rofi.color-normal: #282a36, #f8f8f2, #282a36, #6272a4, #f8f8f2
rofi.color-active: #282a36, #6272a4, #282a36, #f8f8f2, #205171
rofi.color-urgent: #282a36, #f3843d, #282a36, #6272a4, #ffc39c
rofi.font: Hack Bold 13
rofi.modi: window,run,ssh
rofi.key-run: SuperL+p
rofi.terminal: urxvt
!rofi.run-shell-command: /usr/bin/termite -e '{cmd}'
rofi.ssh-client: ssh
!rofi.ssh-command: {terminal} -e "{ssh-client} {host}"
URxvt.scrollBar: false
URxvt.font: xft:Hack:size=10.5
URxvt.url-launcher: /usr/bin/firefox-developer
URxvt*loginShell: true
URxvt*fading: 25
URxvt.internalBorder: 0
URxvt.externalBorder: 0
URxvt.secondaryScreen: 1
URxvt.secondaryScroll: 0
URxvt.depth: 32
!URxvt*background: #1d1f21
! #5f656b
! #1d1f21
! #101218
!URxvt*foreground: #d1d4e0
URxvt*cursorColor: #d1d4e0
URxvt*scrollColor: #d1d4e0
URxvt*highlightColor: #252936
URxvt*highlightTextColor: #C0C5CE
! Dracula Xresources palette
*.foreground: #F8F8F2
*.background: #282A36
*.color0: #000000
*.color8: #4D4D4D
*.color1: #FF5555
*.color9: #FF6E67
*.color2: #50FA7B
*.color10: #5AF78E
*.color3: #F1FA8C
*.color11: #F4F99D
*.color4: #CAA9FA
*.color12: #CAA9FA
*.color5: #FF79C6
*.color13: #FF92D0
*.color6: #8BE9FD
*.color14: #9AEDFE
*.color7: #BFBFBF
*.color15: #E6E6E6
URxvt.perl-ext-common: default,matcher,clipboard
URxvt.iso14755: False
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.clipboard.copycmd: xsel -ib
URxvt.clipboard.pastecmd: xsel -ob
urxvt*perl-lib: /usr/lib/urxvt/perl/
urxvt*matcher.button: 1
urxvt*matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-]
! xscreensaver
xscreensaver.dateFormat:
xscreensaver.passwd.body.label:
xscreensaver.passwd.heading.label:
xscreensaver.passwd.login.label:
xscreensaver.passwd.thermometer.width: 2
xscreensaver.passwd.uname: True
xscreensaver.passwd.unlock.label:
xscreensaver.Dialog.background: #282A36
xscreensaver.Dialog.foreground: #ffffff
xscreensaver.Dialog.Button.background: #282A36
xscreensaver.Dialog.Button.foreground: #ffffff
xscreensaver.Dialog.text.background: #282A36
xscreensaver.Dialog.text.foreground: #ffffff
xscreensaver.Dialog.shadowThickness: 1
xscreensaver.Dialog.topShadowColor: #282A36
xscreensaver.Dialog.bottomShadowColor: #282A36
xscreensaver.Dialog.headingFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-*
xscreensaver.Dialog.bodyFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-*
xscreensaver.Dialog.labelFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-*
xscreensaver.Dialog.unameFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-*
xscreensaver.Dialog.buttonFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-*
xscreensaver.Dialog.dateFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-*
xscreensaver.passwd.passwdFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-*
[options]
font = Hack 11
#font = Roboto Mono Medium for Powerline 11
[colors]
# special
foreground = #c5c8c6
foreground_bold = #c5c8c6
cursor = #c5c8c6
#background = #1d1f21
#background = rgba(48,25,43, 0.90)
# hard contrast = *background: #1d2021
# background = #282828
background = rgba(40,42,54, 0.93)
# Dracula Xresources palette
foreground = #F8F8F2
#background = #282A36
color0 = #000000
color8 = #4D4D4D
color1 = #FF5555
color9 = #FF6E67
color2 = #50FA7B
color10 = #5AF78E
color3 = #F1FA8C
color11 = #F4F99D
color4 = #CAA9FA
color12 = #CAA9FA
color5 = #FF79C6
color13 = #FF92D0
color6 = #8BE9FD
color14 = #9AEDFE
color7 = #BFBFBF
color15 = #E6E6E6
import XMonad
import XMonad.Layout.Spacing
import XMonad.Layout.Gaps
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run
import XMonad.Util.EZConfig
import XMonad.Actions.CycleWS
import XMonad.Layout.Maximize
import XMonad.Layout.MultiToggle
import XMonad.Layout.NoBorders
import XMonad.Layout.MultiToggle.Instances
import XMonad.Hooks.ManageHelpers
import XMonad.Actions.UpdatePointer
import XMonad.Actions.GridSelect
import XMonad.Hooks.SetWMName
import XMonad.Util.NamedScratchpad
import XMonad.Util.WorkspaceCompare
import XMonad.Hooks.FadeInactive
import XMonad.Layout.Minimize
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.FadeWindows
import Graphics.X11.ExtraTypes.XF86
import XMonad.Layout.SimpleFloat
import XMonad.Layout.PerWorkspace (onWorkspace)
import System.IO
import Data.Monoid
import System.Exit
import Data.Maybe (Maybe, isNothing, fromJust)
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- The preferred terminal program, which is used in a binding below and by
-- certain contrib modules.
--
myTerminal = "urxvt"
-- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse= True
-- Whether clicking on a window to focus also passes the click to the window
myClickJustFocuses :: Bool
myClickJustFocuses = False
-- Width of the window border in pixels.
--
myBorderWidth = 4
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
-- ("right alt"), which does not conflict with emacs keybindings. The
-- "windows key" is usually mod4Mask.
--
myModMask = mod4Mask
-- The default number of workspaces (virtual screens) and their names.
-- By default we use numeric strings, but any string may be used as a
-- workspace name. The number of workspaces is determined by the length
-- of this list.
--
-- A tagging example:
--
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
--
--xmobarEscape = concatMap doubleLts
-- where doubleLts '<' = "<<"
-- doubleLts x = [x]
myWorkspaces = ["1: TERM","2: WEB","3: CODE","4: COMM","5: MAIL","6: ETC","7: MEDIA"] ++ map show [8..8] ++ ["NSP"]
--where
-- clickable l = [ "<action=xdotool key super+" ++ show (n) ++ ">" ++ ws ++ "</action>" |
-- (i,ws) <- zip [1..9] l,
-- let n = i ]
--where clickable l = ["<action=`xdotool key super+" ++ show (n) ++ "`>" ++ ws ++ "</action>" | (i,ws) <- zip [1..9] l, let n = i ]
-- Border colors for unfocused and focused windows, respectively.
--
myNormalBorderColor = "black"
myFocusedBorderColor = "#bd93f9" --"#3AF0D1" -- "#FF1222" --"#69DFFA" --"#E39402" #00F2FF
-- Scratch Pads
myScratchpads = [NS "zeal" "zeal" (className =? "Zeal") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)),
NS "telegram" "telegram-desktop" ((className =? "Telegram") <||> (className =? "telegram-desktop")) (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)),
NS "termscratch" "termite --class=termscratch -e ~/bin/tmux-stream-dev.sh" (className =? "termscratch") (customFloating $ W.RationalRect (1/10) (1/10) (4/5) (4/5))]
skipFloating :: (Eq a, Ord a) => W.StackSet i l a s sd -> (W.StackSet i l a s sd -> W.StackSet i l a s sd) -> W.StackSet i l a s sd
skipFloating stacks f
| isNothing curr = stacks -- short circuit if there is no currently focused window
| otherwise = skipFloatingR stacks curr f
where curr = W.peek stacks
skipFloatingR :: (Eq a, Ord a) => W.StackSet i l a s sd -> (Maybe a) -> (W.StackSet i l a s sd -> W.StackSet i l a s sd) -> W.StackSet i l a s sd
skipFloatingR stacks startWindow f
| isNothing nextWindow = stacks -- next window is nothing return current stack set
| nextWindow == startWindow = newStacks -- if next window is the starting window then return the new stack set
| M.notMember (fromJust nextWindow) (W.floating stacks) = newStacks -- if next window is not a floating window return the new stack set
| otherwise = skipFloatingR newStacks startWindow f -- the next window is a floating window so keep recursing (looking)
where newStacks = f stacks
nextWindow = W.peek newStacks
------------------------------------------------------------------------
-- Key bindings. Add, modify or remove key bindings here.
--
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- launch a terminal
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
-- launch thunar
, ((modm .|. shiftMask, xK_f ), spawn "thunar")
-- launch dmenu
, ((modm, xK_p ), spawn "rofi -show run")
-- launch gmrun
, ((modm .|. shiftMask, xK_p ), spawn "gmrun")
-- launch zeal
, ((modm, xK_z ), namedScratchpadAction myScratchpads "zeal")
-- launch telegram
, ((modm, xK_F10 ), namedScratchpadAction myScratchpads "telegram")
-- close focused window
, ((modm .|. shiftMask, xK_c ), kill)
-- Grid Select
, ((modm, xK_g ), goToSelected defaultGSConfig)
-- Rotate through the available layout algorithms
, ((modm, xK_space ), sendMessage NextLayout)
-- Reset the layouts on the current workspace to default
, ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
-- Resize viewed windows to the correct size
, ((modm, xK_n ), refresh)
-- Move focus to the next window
, ((modm, xK_Tab ), windows W.focusDown)
-- Move focus to the next window
--, ((modm, xK_j ), windows W.focusDown)
, ((modm, xK_j ), windows W.focusDown)
-- Move focus to the previous window
--, ((modm, xK_k ), windows W.focusUp )
, ((modm, xK_k ), windows W.focusUp)
-- Move focus to the master window
--, ((modm, xK_m ), windows W.focusMaster )
, ((modm, xK_m ), withFocused minimizeWindow)
, ((modm .|. shiftMask, xK_m ), sendMessage RestoreNextMinimizedWin)
-- Maximize selected window
, ((modm, xK_f ), (sendMessage $ Toggle FULL))
-- Swap the focused window and the master window
, ((modm, xK_Return), windows W.swapMaster)
-- Swap the focused window with the next window
, ((modm .|. shiftMask, xK_j ), windows W.swapDown )
-- Swap the focused window with the previous window
, ((modm .|. shiftMask, xK_k ), windows W.swapUp )
-- Shrink the master area
, ((modm, xK_h ), sendMessage Shrink)
-- Expand the master area
, ((modm, xK_l ), sendMessage Expand)
-- Push window back into tiling
, ((modm, xK_t ), withFocused $ windows . W.sink)
-- Increment the number of windows in the master area
, ((modm , xK_comma ), sendMessage (IncMasterN 1))
-- Deincrement the number of windows in the master area
, ((modm , xK_period), sendMessage (IncMasterN (-1)))
-- Switch workspaces and screens
, ((modm, xK_Right), moveTo Next (WSIs hiddenNotNSP))
, ((modm, xK_Left), moveTo Prev (WSIs hiddenNotNSP))
, ((modm .|. shiftMask, xK_Right), shiftTo Next (WSIs hiddenNotNSP))
, ((modm .|. shiftMask, xK_Left), shiftTo Prev (WSIs hiddenNotNSP))
, ((modm, xK_Down), nextScreen)
, ((modm, xK_Up), prevScreen)
, ((modm .|. shiftMask, xK_Down), shiftNextScreen)
, ((modm .|. shiftMask, xK_Up), shiftPrevScreen)
-- Toggle the status bar gap
-- Use this binding with avoidStruts from Hooks.ManageDocks.
-- See also the statusBar function from Hooks.DynamicLog.
--
-- , ((modm , xK_b ), sendMessage ToggleStruts)
-- Quit xmonad
, ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
-- Restart xmonad
, ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
-- Run xmessage with a summary of the default keybindings (useful for beginners)
, ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -"))
]
++
--
-- mod-[1..9], Switch to workspace N
-- mod-shift-[1..9], Move client to workspace N
--
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
++
--
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
--
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
hiddenNotNSP :: X (WindowSpace -> Bool)
hiddenNotNSP = do
hs <- gets $ map W.tag . W.hidden . windowset
return (\w -> (W.tag w) /= "NSP" && (W.tag w) `elem` hs)
addKeys = [ ("<XF86AudioLowerVolume>" ,spawn "pulseaudio-ctl down 10")
, ("<XF86AudioRaiseVolume>" ,spawn "pulseaudio-ctl up 10" )
, ("<XF86AudioMute>" ,spawn "pulseaudio-ctl mute" )
, ("<XF86MonBrightnessDown>" ,spawn "light -U 5" )
, ("<XF86MonBrightnessUp>" ,spawn "light -A 5" )
, ("<XF86AudioPlay>" ,spawn "play-pause-mpd.sh" )
, ("<XF86AudioPrev>" ,spawn "mpc prev" )
, ("<XF86AudioNext>" ,spawn "mpc next" )
, ("<XF86PowerOff>" ,spawn "lock.sh" )
, ("<F12>" ,namedScratchpadAction myScratchpads "termscratch")
]
------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events
--
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
-- mod-button1, Set the window to floating mode and move by dragging
[ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
>> windows W.shiftMaster))
-- mod-button2, Raise the window to the top of the stack
, ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
-- mod-button3, Set the window to floating mode and resize by dragging
, ((modm, button3), (\w -> focus w >> mouseResizeWindow w
>> windows W.shiftMaster))
-- you may also bind events to the mouse scroll wheel (button4 and button5)
]
------------------------------------------------------------------------
-- Layouts:
-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
--
-- The available layouts. Note that each layout is separated by |||,
-- which denotes layout choice.
--
myLayout = onWorkspace "7: MEDIA" simpleFloat $ smartBorders $ avoidStruts $ minimize (mkToggle (NOBORDERS ?? FULL ?? EOT) (tiled ||| Mirror tiled ||| Full))
where
-- default tiling algorithm partitions the screen into two panes
--tiled = gaps [(U,5), (R,5), (L,5), (D,5)] $ spacing 5 $ Tall nmaster delta ratio
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 1/2
-- Percent of screen to increment by when resizing panes
delta = 3/100
------------------------------------------------------------------------
-- Window rules:
-- Execute arbitrary actions and WindowSet manipulations when managing
-- a new window. You can use this to, for example, always float a
-- particular program, or have a client always appear on a particular
-- workspace.
--
-- To find the property name associated with a program, use
-- > xprop | grep WM_CLASS
-- and click on the client you're interested in.
--
-- To match on the WM_NAME, you can use 'title' in the same way that
-- 'className' and 'resource' are used below.
--
myManageHook = composeAll
[ className =? "MPlayer" --> doFloat
, resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore
, className =? "Xfce4-notifyd" --> doIgnore]
<+> (isFullscreen --> doFullFloat)
<+> manageDocks
<+> (namedScratchpadManageHook myScratchpads)
------------------------------------------------------------------------
-- Event handling
-- * EwmhDesktops users should change this to ewmhDesktopsEventHook
--
-- Defines a custom handler function for X Events. The function should
-- return (All True) if the default handler is to be run afterwards. To
-- combine event hooks use mappend or mconcat from Data.Monoid.
--
myEventHook = mempty
------------------------------------------------------------------------
-- Status bars and logging
-- Perform an arbitrary action on each internal state change or X event.
-- See the 'XMonad.Hooks.DynamicLog' extension for examples.
--
--myLogHook :: Handle -> X ()
--myLogHook h = dynamicLogWithPP $ defaultPP
-- {
-- ppCurrent = dzenColor "#9BC1B2" "#1B1D1E" . pad
-- , ppVisible = dzenColor "gray" "#1B1D1E" . pad
-- , ppHidden = dzenColor "gray" "#1B1D1E" . pad
-- , ppHiddenNoWindows = dzenColor "gray" "#1B1D1E" . pad
-- , ppUrgent = dzenColor "#F73E3E" "#1B1D1E" . pad
-- , ppCurrent = dzenColor "#9BC1B2" "#181D1E" . pad
-- , ppWsSep = " "
-- , ppSep = " | "
-- , ppLayout = dzenColor "#ebac54" "#1B1D1E" .
-- (\x -> case x of
-- "ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
-- "Mirror ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
-- "Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
-- "Simple Float" -> "~"
-- _ -> x
-- )
-- , ppTitle = (" " ++) . dzenColor "#9BC1B2" "#1B1D1E" . dzenEscape
-- , ppOutput = hPutStrLn h
-- }
-- >> updatePointer (0.75, 0.75) (0.75, 0.75)
-- >> (fadeOutLogHook $ fadeIf ((className =? "URxvt")) 0.93)
myLogHook xmproc = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppCurrent = xmobarColor "#8be9fd" "" . wrap "[" "]" -- #9BC1B2 #69DFFA
, ppTitle = xmobarColor "#ff79c6" "" . shorten 50 -- #9BC1B2 #69DFFA
, ppSort = fmap (.namedScratchpadFilterOutWorkspace) getSortByTag
}
>> updatePointer (0.75, 0.75) (0.75, 0.75)
>> (fadeOutLogHook $ fadeIf ((className =? "URxvt")) 0.90)
------------------------------------------------------------------------
-- Startup hook
-- Perform an arbitrary action each time xmonad starts or is restarted
-- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
-- per-workspace layout choices.
--
-- By default, do nothing.
myStartupHook = setWMName "LG3D"
------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this.
--
myConfig xmproc = (defaults xmproc) `additionalKeysP` addKeys
main = do
xmproc <- spawnPipe "/usr/bin/xmobar /home/gilbertw1/.xmobarrc"
xmonad $ ewmh $ myConfig xmproc
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--
-- No need to modify this.
--
defaults xmproc = def {
-- simple stuff
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
clickJustFocuses = myClickJustFocuses,
borderWidth = myBorderWidth,
modMask = myModMask,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
-- key bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
handleEventHook = myEventHook,
logHook = myLogHook xmproc,
startupHook = myStartupHook
}
-- | Finally, a copy of the default bindings in simple textual tabular format.
help :: String
help = unlines ["The default modifier key is 'alt'. Default keybindings:",
"",
"-- launching and killing programs",
"mod-Shift-Enter Launch xterminal",
"mod-p Launch dmenu",
"mod-Shift-p Launch gmrun",
"mod-Shift-c Close/kill the focused window",
"mod-Space Rotate through the available layout algorithms",
"mod-Shift-Space Reset the layouts on the current workSpace to default",
"mod-n Resize/refresh viewed windows to the correct size",
"",
"-- move focus up or down the window stack",
"mod-Tab Move focus to the next window",
"mod-Shift-Tab Move focus to the previous window",
"mod-j Move focus to the next window",
"mod-k Move focus to the previous window",
"mod-m Move focus to the master window",
"",
"-- modifying the window order",
"mod-Return Swap the focused window and the master window",
"mod-Shift-j Swap the focused window with the next window",
"mod-Shift-k Swap the focused window with the previous window",
"",
"-- resizing the master/slave ratio",
"mod-h Shrink the master area",
"mod-l Expand the master area",
"",
"-- floating layer support",
"mod-t Push window back into tiling; unfloat and re-tile it",
"",
"-- increase or decrease number of windows in the master area",
"mod-comma (mod-,) Increment the number of windows in the master area",
"mod-period (mod-.) Deincrement the number of windows in the master area",
"",
"-- quit, or restart",
"mod-Shift-q Quit xmonad",
"mod-q Restart xmonad",
"mod-[1..9] Switch to workSpace N",
"",
"-- Workspaces & screens",
"mod-Shift-[1..9] Move client to workspace N",
"mod-{w,e,r} Switch to physical/Xinerama screens 1, 2, or 3",
"mod-Shift-{w,e,r} Move client to screen 1, 2, or 3",
"",
"-- Mouse bindings: default actions bound to mouse events",
"mod-button1 Set the window to floating mode and move by dragging",
"mod-button2 Raise the window to the top of the stack",
"mod-button3 Set the window to floating mode and resize by dragging"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment