diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index 1d36bec1..c65d847d 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -1,9 +1,10 @@ import System.Taffybar +import System.Taffybar.MPRIS2 +import System.Taffybar.Pager +import System.Taffybar.SimpleClock import System.Taffybar.Systray import System.Taffybar.TaffyPager -import System.Taffybar.SimpleClock -import System.Taffybar.MPRIS2 import System.Taffybar.Widgets.PollingGraph @@ -28,7 +29,16 @@ main = do , graphLabel = Just "cpu" } let clock = textClockNew Nothing "%a %b %_d %r" 1 - pager = taffyPagerNew defaultPagerConfig + pagerConfig = defaultPagerConfig + { useImages = True + , emptyWorkspace = id + , imageCount = 8 + , workspaceGap = 0 + , activeWorkspace = escape + , visibleWorkspace = escape + , workspaceBorder = False + } + pager = taffyPagerNew pagerConfig mpris = mpris2New mem = pollingGraphNew memCfg 1 memCallback cpu = pollingGraphNew cpuCfg 0.5 cpuCallback diff --git a/dotfiles/config/taffybar/taffybar.rc b/dotfiles/config/taffybar/taffybar.rc index 9e7e5a1a..67f00759 100644 --- a/dotfiles/config/taffybar/taffybar.rc +++ b/dotfiles/config/taffybar/taffybar.rc @@ -3,13 +3,47 @@ style "taffybar-default" { color["white"] = "#ffffff" color["green"] = "#00ff00" color["red"] = "#ff0000" + color["aqua"] = "#455a64" + color["yellow"] = "#fff59d" + color["gray"] = "#263238" - bg[NORMAL] = "#1c1f26" + bg[NORMAL] = @black fg[NORMAL] = @white text[NORMAL] = @white fg[PRELIGHT] = @green bg[PRELIGHT] = @black } -widget "Taffybar*" style "taffybar-default" -widget "*NotificationCloseButton" style "notification-button" +style "taffybar-active-window" = "taffybar-default" { + bg[NORMAL] = @black + fg[NORMAL] = @green +} + +style "taffybar-notification-button" = "taffybar-default" { + text[NORMAL] = @red + fg[NORMAL] = @red +} + +style "taffybar-workspace-border-active" = "taffybar-default" { + bg[NORMAL] = @aqua +} +style "taffybar-workspace-border-visible" = "taffybar-default" { + bg[NORMAL] = @gray +} +style "taffybar-workspace-border-empty" = "taffybar-default" { + bg[NORMAL] = @black +} +style "taffybar-workspace-border-hidden" = "taffybar-default" { + bg[NORMAL] = @black +} +style "taffybar-workspace-border-urgent" = "taffybar-default" { + bg[NORMAL] = @black +} + +widget "Taffybar*WindowSwitcher*label" style "taffybar-active-window" +widget "*NotificationCloseButton" style "taffybar-notification-button" +widget "*Workspace-*-active*" style "taffybar-workspace-border-active" +widget "*Workspace-*-visible*" style "taffybar-workspace-border-visible" +widget "*Workspace-*-empty*" style "taffybar-workspace-border-empty" +widget "*Workspace-*-hidden*" style "taffybar-workspace-border-hidden" +widget "*Workspace-*-urgent*" style "taffybar-workspace-border-urgent" diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 6fa56288..7eeef6e0 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -746,6 +746,8 @@ This was taken from [[http://emacs.stackexchange.com/questions/7583/transiently- (cl-defun imalison:modify-font-size (&optional (arg 10)) (interactive "p") + (unless imalison:default-font-size-pt + (imalison:set-default-font-size)) (imalison:set-font-size (+ (imalison:current-font-size) arg))) (defun imalison:font-size-incr () @@ -1409,7 +1411,7 @@ proced is an top like utility that runs inside of emacs. The following sets auto inhibit-startup-echo-area-message t) ;; This makes it so that emacs --daemon puts its files in ~/.emacs.d/server -;; (setq server-use-tcp t) +(setq server-use-tcp t) ;; Make buffer names unique. (setq uniquify-buffer-name-style 'forward) @@ -1629,6 +1631,8 @@ https://github.com/alpaker/Fill-Column-Indicator/issues/21 for more details (add-hook 'prog-mode-hook 'fci-mode))) #+END_SRC ** highlight-indent-guides +If the load-theme hook from this package starts causing trouble check for +custom-set-faces in your custom file. #+BEGIN_SRC emacs-lisp (use-package highlight-indent-guides :commands highlight-indent-guides-mode @@ -4854,8 +4858,6 @@ load-theme hook (See the heading below). (defun imalison:appearance (&optional frame) (setq font-use-system-font nil) (interactive (list nil)) - (unless (member imalison:dark-theme custom-enabled-themes) - (load-theme imalison:dark-theme t)) (spaceline-compile) (imalison:remove-fringe-and-hl-line-mode) (setq powerline-default-separator (random-choice '(butt slant wave)))) @@ -4866,6 +4868,8 @@ load-theme hook (See the heading below). (defun imalison:appearance-setup-hook (&rest args) (unless imalison:appearance-setup-done + (unless (member imalison:dark-theme custom-enabled-themes) + (load-theme imalison:dark-theme t)) (apply 'imalison:appearance args) (setq imalison:default-font-size-pt (face-attribute 'default :height)) (setq imalison:appearance-setup-done t))) diff --git a/dotfiles/lib/resources/window_class_to_fontawesome.json b/dotfiles/lib/resources/window_class_to_fontawesome.json index 1ebc432c..5b42f3d3 100755 --- a/dotfiles/lib/resources/window_class_to_fontawesome.json +++ b/dotfiles/lib/resources/window_class_to_fontawesome.json @@ -1,4 +1,5 @@ { + "keepassxc": "", "Emacs": "", "Chrome": "", "Spotify": "", diff --git a/dotfiles/xmonad/stack.yaml b/dotfiles/xmonad/stack.yaml index 1bf252c1..add6b11c 100644 --- a/dotfiles/xmonad/stack.yaml +++ b/dotfiles/xmonad/stack.yaml @@ -2,18 +2,15 @@ flags: {} extra-package-dbs: [] packages: - '.' -- location: - git: git@github.com:xmonad/X11.git - commit: 0dbcb1891de8d44b3eba1200197f994a3aafabf4 - location: git: git@github.com:IvanMalison/xmonad.git - commit: 7e9c9ccb1f47c147ad19dc420361852623bd6199 + commit: f2da028ff96698289a31a44bdbaea97c53aa01aa - location: git: git@github.com:IvanMalison/xmonad-contrib.git - commit: fb0ba737fb68a8d1a2f6e0dbe4d36c4e46ef7f56 + commit: f0feb9efd4f88b72674a165712c784ae9131197e - location: git: git@github.com:IvanMalison/taffybar.git - commit: 43195e7697d5b36f861d7febeabdd340b07edb17 + commit: 3570bdbd87a5464d7280d8750c5c153cf3dcc637 extra-deps: - X11-1.7 - X11-xft-0.3.1 diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 4d28bd29..728ae307 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -27,7 +27,6 @@ import XMonad.Actions.Minimize import XMonad.Actions.UpdatePointer import XMonad.Actions.WindowBringer import XMonad.Actions.WindowGo -import XMonad.Actions.WorkspaceNames import XMonad.Config () import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.FadeInactive @@ -57,11 +56,9 @@ import XMonad.Util.NamedScratchpad (NamedScratchpad(NS), nonFloating, namedScratchpadAction) import XMonad.Util.NamedWindows (getName) -myGetWorkspaceNameFromTag getWSName tag = - printf "%s: %s " tag (fromMaybe "(Empty)" (getWSName tag)) - main = - xmonad . docks $ def + xmonad . docks . pagerHints . ewmh $ + def { modMask = mod4Mask , terminal = "urxvt" , manageHook = myManageHook <+> manageHook def @@ -70,13 +67,11 @@ main = , normalBorderColor = "#000000" , focusedBorderColor = "#455a64" , logHook = - updatePointer (0.5, 0.5) (0, 0) +++ toggleFadeInactiveLogHook 0.9 +++ - ewmhWorkspaceNamesLogHook' myGetWorkspaceNameFromTag +++ - (myGetWorkspaceNameFromTag <$> getWorkspaceNames' >>= pagerHintsLogHookCustom) - , handleEventHook = fullscreenEventHook +++ - ewmhDesktopsEventHook +++ pagerHintsEventHook +++ - followIfNoMagicFocus +++ minimizeEventHook - , startupHook = myStartup +++ ewmhWorkspaceNamesLogHook + updatePointer (0.5, 0.5) (0, 0) +++ + toggleFadeInactiveLogHook 0.9 + , handleEventHook = + fullscreenEventHook +++ followIfNoMagicFocus +++ minimizeEventHook + , startupHook = myStartup , keys = customKeys (const []) addKeys } where @@ -141,6 +136,7 @@ emacsSelector = className =? "Emacs" transmissionSelector = fmap (isPrefixOf "Transmission") title hangoutsSelector = chromeSelectorBase <&&> fmap isHangoutsTitle title volumeSelector = className =? "Pavucontrol" +keepassSelector = className =? "keepassxc" virtualClasses = [ (hangoutsSelector, "Hangouts") @@ -154,9 +150,11 @@ hangoutsCommand = "start_hangouts.sh" spotifyCommand = "spotify" chromeCommand = "google-chrome-stable" emacsCommand = "emacsclient -c" -htopCommnad = "urxvt -e htop" +htopCommand = "urxvt -e htop" transmissionCommand = "transmission-gtk" volumeCommand = "pavucontrol" +keepassCommand = "systemctl --user restart keepassx.service" +taffybarCommand = "restart_taffybar.sh" -- Startup hook @@ -326,36 +324,6 @@ myBringWindow WindowBringerConfig { menuCommand = cmd , windows $ W.focusWindow window . bringWindow window ] --- Dynamic Workspace Renaming - -windowClassFontAwesomeFile = - fmap ( ".lib/resources/window_class_to_fontawesome.json") getHomeDirectory - -getClassRemap = - fmap (fromMaybe M.empty . decode) $ - windowClassFontAwesomeFile >>= B.readFile - -getClassRemapF = flip maybeRemap <$> getClassRemap -getWSClassNames' w = mapM getClass $ W.integrate' $ W.stack w -getWSClassNames w = io (fmap map getClassRemapF) <*> getWSClassNames' w -currentWSName ws = fromMaybe "" <$> (getWorkspaceNames' <*> pure (W.tag ws)) -desiredWSName = (intercalate "|" <$>) . getWSClassNames - -setWorkspaceNameToFocusedWindow workspace = do - currentName <- currentWSName workspace - newName <- desiredWSName workspace - when (currentName /= newName) $ setWorkspaceName (W.tag workspace) newName - -setWorkspaceNames = - gets windowset >>= mapM_ setWorkspaceNameToFocusedWindow . W.workspaces - -data WorkspaceNamesHook a = WorkspaceNamesHook deriving (Show, Read) - -instance LayoutModifier WorkspaceNamesHook Window where - hook _ = setWorkspaceNames - -workspaceNamesHook = ModifiedLayout WorkspaceNamesHook - -- Toggleable fade newtype ToggleFade a = @@ -572,10 +540,11 @@ swapMinimizeStateAfter action = -- Named Scratchpads scratchpads = - [ NS "htop" htopCommnad (title =? "htop") nonFloating + [ NS "htop" htopCommand (title =? "htop") nonFloating , NS "spotify" spotifyCommand spotifySelector nonFloating , NS "hangouts" hangoutsCommand hangoutsSelector nonFloating , NS "volume" volumeCommand volumeSelector nonFloating + , NS "keepass" keepassCommand keepassSelector nonFloating ] -- TODO: This doesnt work well with minimized windows @@ -639,6 +608,7 @@ addKeys conf@XConfig {modMask = modm} = , ((modalt, xK_v), doScratchpad "volume") , ((modalt, xK_h), doScratchpad "hangouts") , ((modalt, xK_s), doScratchpad "spotify") + , ((modalt, xK_k), doScratchpad "keepass") , ((modalt .|. controlMask, xK_h), myRaiseNextMaybe (spawn hangoutsCommand) hangoutsSelector) , ((modalt .|. controlMask, xK_s), @@ -676,6 +646,7 @@ addKeys conf@XConfig {modMask = modm} = , ((modm, xK_z), shiftToNextScreenX) , ((modm .|. shiftMask, xK_z), shiftToEmptyNextScreen) , ((modm .|. shiftMask, xK_h), shiftToEmptyAndView) + -- These need to be rebound to support boringWindows , ((modm, xK_j), focusDown) , ((modm, xK_k), focusUp) @@ -693,8 +664,7 @@ addKeys conf@XConfig {modMask = modm} = -- Non-XMonad - , ((modm .|. controlMask, xK_t), spawn - "systemctl --user restart taffybar.service") + , ((modm .|. controlMask, xK_t), spawn taffybarCommand) , ((modm, xK_v), spawn "copyq paste") , ((modm .|. controlMask, xK_s), spawn "split_out.sh") , ((mod3Mask, xK_v), spawn "copyq_rofi.sh")