add base dir files and remove vifm files

This commit is contained in:
Tyler Starr 2020-12-12 22:45:14 -08:00
parent 22aea97345
commit 64ee89dcff
17 changed files with 392 additions and 6983 deletions

31
.bashrc Executable file
View File

@ -0,0 +1,31 @@
#
# ~/.bashrc
#
alias lol="sudo sh -c 'sysctl -w abi.vsyscall32=0'"
alias dired="emacsclient -c -nw -a '' --eval '(dired nil)'"
alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
alias update-xmonad="yay -S xmonad-git xmonad-contrib-git xmobar-git"
alias git-python='/usr/bin/git --git-dir=$HOME/devel/python/python-bits-and-bobs --work-tree=$HOME/devel/python'
alias dot='/usr/bin/git --git-dir=$HOME/.dots --work-tree=$HOME'
dot config --local status.showUntrackedFiles no
export PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin"
export GEM_HOME=$(ruby -e 'print Gem.user_dir')
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
#xsetroot -cursor_name left_ptr

View File

@ -1,4 +1,5 @@
let g:netrw_dirhistmax =10 let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =2 let g:netrw_dirhistcnt =3
let g:netrw_dirhist_3='/home/tstarr/.ncmpcpp'
let g:netrw_dirhist_2='/home/tstarr/.config' let g:netrw_dirhist_2='/home/tstarr/.config'
let g:netrw_dirhist_1='/home/tstarr/.config/ncmpcpp' let g:netrw_dirhist_1='/home/tstarr/.config/ncmpcpp'

View File

@ -1,85 +0,0 @@
" You can edit this file by hand.
" The " character at the beginning of a line comments out the line.
" Blank lines are ignored.
" The Default color scheme is used for any directory that does not have
" a specified scheme and for parts of user interface like menus. A
" color scheme set for a base directory will also
" be used for the sub directories.
" The standard ncurses colors are:
" Default = -1 = None, can be used for transparency or default color
" Black = 0
" Red = 1
" Green = 2
" Yellow = 3
" Blue = 4
" Magenta = 5
" Cyan = 6
" White = 7
" Light versions of colors are also available (set bold attribute):
" LightBlack
" LightRed
" LightGreen
" LightYellow
" LightBlue
" LightMagenta
" LightCyan
" LightWhite
" Available attributes (some of them can be combined):
" bold
" underline
" reverse or inverse
" standout
" italic (on unsupported systems becomes reverse)
" none
" Vifm supports 256 colors you can use color numbers 0-255
" (requires properly set up terminal: set your TERM environment variable
" (directly or using resources) to some color terminal name (e.g.
" xterm-256color) from /usr/lib/terminfo/; you can check current number
" of colors in your terminal with tput colors command)
" highlight group cterm=attrs ctermfg=foreground_color ctermbg=background_color
highlight clear
highlight Win cterm=none ctermfg=white ctermbg=black
highlight Directory cterm=bold ctermfg=cyan ctermbg=default
highlight Link cterm=bold ctermfg=yellow ctermbg=default
highlight BrokenLink cterm=bold ctermfg=red ctermbg=default
highlight HardLink cterm=none ctermfg=yellow ctermbg=default
highlight Socket cterm=bold ctermfg=magenta ctermbg=default
highlight Device cterm=bold ctermfg=red ctermbg=default
highlight Fifo cterm=bold ctermfg=cyan ctermbg=default
highlight Executable cterm=bold ctermfg=green ctermbg=default
highlight Selected cterm=bold ctermfg=magenta ctermbg=default
highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=default
highlight TopLine cterm=none ctermfg=black ctermbg=white
highlight TopLineSel cterm=bold ctermfg=black ctermbg=default
highlight StatusLine cterm=bold ctermfg=black ctermbg=white
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Border cterm=none ctermfg=black ctermbg=white
highlight OtherLine ctermfg=default ctermbg=default
highlight JobLine cterm=bold,reverse ctermfg=black ctermbg=white
highlight SuggestBox cterm=bold ctermfg=default ctermbg=default
highlight CmpMismatch cterm=bold ctermfg=white ctermbg=red
highlight AuxWin ctermfg=default ctermbg=default
highlight TabLine cterm=none ctermfg=white ctermbg=black
highlight TabLineSel cterm=bold,reverse ctermfg=default ctermbg=default
highlight User1 ctermfg=default ctermbg=default
highlight User2 ctermfg=default ctermbg=default
highlight User3 ctermfg=default ctermbg=default
highlight User4 ctermfg=default ctermbg=default
highlight User5 ctermfg=default ctermbg=default
highlight User6 ctermfg=default ctermbg=default
highlight User7 ctermfg=default ctermbg=default
highlight User8 ctermfg=default ctermbg=default
highlight User9 ctermfg=default ctermbg=default
highlight OtherWin ctermfg=default ctermbg=default
highlight LineNr ctermfg=default ctermbg=default
highlight OddLine ctermfg=default ctermbg=default

View File

@ -1,6 +0,0 @@
This directory is dedicated for user-supplied scripts/executables.
vifm modifies its PATH environment variable to let user run those
scripts without specifying full path. All subdirectories are added
as well. File in a subdirectory overrules file with the same name
in parent directories. Restart might be needed to recognize files
in newly created or renamed subdirectories.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,503 +0,0 @@
" vim: filetype=vifm :
" Sample configuration file for vifm (last updated: 9 September, 2020)
" You can edit this file by hand.
" The " character at the beginning of a line comments out the line.
" Blank lines are ignored.
" The basic format for each item is shown with an example.
" ------------------------------------------------------------------------------
" Command used to edit files in various contexts. The default is vim.
" If you would like to use another vi clone such as Elvis or Vile
" you will need to change this setting.
set vicmd=vim
" set vicmd=elvis\ -G\ termcap
" set vicmd=vile
" This makes vifm perform file operations on its own instead of relying on
" standard utilities like `cp`. While using `cp` and alike is a more universal
" solution, it's also much slower when processing large amounts of files and
" doesn't support progress measuring.
set syscalls
" Trash Directory
" The default is to move files that are deleted with dd or :d to
" the trash directory. If you change this you will not be able to move
" files by deleting them and then using p to put the file in the new location.
" I recommend not changing this until you are familiar with vifm.
" This probably shouldn't be an option.
set trash
" This is how many directories to store in the directory history.
set history=100
" Automatically resolve symbolic links on l or Enter.
set nofollowlinks
" With this option turned on you can run partially entered commands with
" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te<tab>).
" set fastrun
" Natural sort of (version) numbers within text.
set sortnumbers
" Maximum number of changes that can be undone.
set undolevels=100
" Use Vim's format of help file (has highlighting and "hyperlinks").
" If you would rather use a plain text help file set novimhelp.
set vimhelp
" If you would like to run an executable file when you
" press Enter, l or Right Arrow, set this.
set norunexec
" List of color schemes to try (picks the first one supported by the terminal)
colorscheme Default-256 Default
" Format for displaying time in file list. For example:
" TIME_STAMP_FORMAT=%m/%d-%H:%M
" See man date or man strftime for details.
set timefmt=%m/%d\ %H:%M
" Show list of matches on tab completion in command-line mode
set wildmenu
" Display completions in a form of popup with descriptions of the matches
set wildstyle=popup
" Display suggestions in normal, visual and view modes for keys, marks and
" registers (at most 5 files). In other view, when available.
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
" Ignore case in search patterns unless it contains at least one uppercase
" letter
set ignorecase
set smartcase
" Don't highlight search results automatically
set nohlsearch
" Use increment searching (search while typing)
set incsearch
" Try to leave some space from cursor to upper/lower border in lists
set scrolloff=4
" Don't do too many requests to slow file systems
if !has('win')
set slowfs=curlftpfs
endif
" Set custom status line look
set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d "
" ------------------------------------------------------------------------------
" :mark mark /full/directory/path [filename]
mark b ~/bin/
mark h ~/
" ------------------------------------------------------------------------------
" :com[mand][!] command_name action
" The following macros can be used in a command
" %a is replaced with the user arguments.
" %c the current file under the cursor.
" %C the current file under the cursor in the other directory.
" %f the current selected file, or files.
" %F the current selected file, or files in the other directory.
" %b same as %f %F.
" %d the current directory name.
" %D the other window directory name.
" %m run the command in a menu window
command! df df -h %m 2> /dev/null
command! diff vim -d %f %F
command! zip zip -r %f.zip %f
command! run !! ./%f
command! make !!make %a
command! mkcd :mkdir %a | cd %a
command! vgrep vim "+grep %a"
command! reload :write | restart full
" ------------------------------------------------------------------------------
" The file type is for the default programs to be used with
" a file extension.
" :filetype pattern1,pattern2 defaultprogram,program2
" :fileviewer pattern1,pattern2 consoleviewer
" The other programs for the file type can be accessed with the :file command
" The command macros like %f, %F, %d, %D may be used in the commands.
" The %a macro is ignored. To use a % you must put %%.
" For automated FUSE mounts, you must register an extension with :file[x]type
" in one of following formats:
"
" :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables
" %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime.
" A sample line might look like this:
" :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR
"
" :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables
" %PARAM and %DESTINATION_DIR are filled in by vifm at runtime.
" A sample line might look like this:
" :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR
" %PARAM value is filled from the first line of file (whole line).
" Example first line for SshMount filetype: root@127.0.0.1:/
"
" You can also add %CLEAR if you want to clear screen before running FUSE
" program.
" Pdf
filextype {*.pdf},<application/pdf> zathura %c %i &, apvlv %c, xpdf %c
fileviewer {*.pdf},<application/pdf> pdftotext -nopgbrk %c -
" PostScript
filextype {*.ps,*.eps,*.ps.gz},<application/postscript>
\ {View in zathura}
\ zathura %f,
\ {View in gv}
\ gv %c %i &,
" Djvu
filextype {*.djvu},<image/vnd.djvu>
\ {View in zathura}
\ zathura %f,
\ {View in apvlv}
\ apvlv %f,
" Audio
filetype {*.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus},
\<audio/*>
\ {Play using ffplay}
\ ffplay -nodisp -autoexit %c,
\ {Play using MPlayer}
\ mplayer %f,
fileviewer {*.mp3},<audio/mpeg> mp3info
fileviewer {*.flac},<audio/flac> soxi
" Video
filextype {*.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
\*.as[fx]},
\<video/*>
\ {View using ffplay}
\ ffplay -fs -autoexit %f,
\ {View using Dragon}
\ dragon %f:p,
\ {View using mplayer}
\ mplayer %f,
fileviewer {*.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
\*.as[fx]},
\<video/*>
\ ffprobe -pretty %c 2>&1
" Web
filextype {*.html,*.htm},<text/html>
\ {Open with dwb}
\ dwb %f %i &,
\ {Open with firefox}
\ firefox %f &,
\ {Open with uzbl}
\ uzbl-browser %f %i &,
filetype {*.html,*.htm},<text/html> links, lynx
" Object
filetype {*.o},<application/x-object> nm %f | less
" Man page
filetype {*.[1-8]},<text/troff> man ./%c
fileviewer {*.[1-8]},<text/troff> man ./%c | col -b
" Images
filextype {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*>
\ {View in sxiv}
\ sxiv %f,
\ {View in gpicview}
\ gpicview %c,
\ {View in shotwell}
\ shotwell,
fileviewer {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*>
\ identify %f
" OpenRaster
filextype *.ora
\ {Edit in MyPaint}
\ mypaint %f,
" Mindmap
filextype *.vym
\ {Open with VYM}
\ vym %f &,
" MD5
filetype *.md5
\ {Check MD5 hash sum}
\ md5sum -c %f %S,
" SHA1
filetype *.sha1
\ {Check SHA1 hash sum}
\ sha1sum -c %f %S,
" SHA256
filetype *.sha256
\ {Check SHA256 hash sum}
\ sha256sum -c %f %S,
" SHA512
filetype *.sha512
\ {Check SHA512 hash sum}
\ sha512sum -c %f %S,
" GPG signature
filetype {*.asc},<application/pgp-signature>
\ {Check signature}
\ !!gpg --verify %c,
" Torrent
filetype {*.torrent},<application/x-bittorrent> ktorrent %f &
fileviewer {*.torrent},<application/x-bittorrent> dumptorrent -v %c
" FuseZipMount
filetype {*.zip,*.jar,*.war,*.ear,*.oxt,*.apkg},
\<application/zip,application/java-archive>
\ {Mount with fuse-zip}
\ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
\ {View contents}
\ zip -sf %c | less,
\ {Extract here}
\ tar -xf %c,
fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
" ArchiveMount
filetype {*.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz},
\<application/x-tar>
\ {Mount with archivemount}
\ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
fileviewer *.tgz,*.tar.gz tar -tzf %c
fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
fileviewer *.tar.txz,*.txz xz --list %c
fileviewer {*.tar},<application/x-tar> tar -tf %c
" Rar2FsMount and rar archives
filetype {*.rar},<application/x-rar>
\ {Mount with rar2fs}
\ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
fileviewer {*.rar},<application/x-rar> unrar v %c
" IsoMount
filetype {*.iso},<application/x-iso9660-image>
\ {Mount with fuseiso}
\ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
" SshMount
filetype *.ssh
\ {Mount with sshfs}
\ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
" FtpMount
filetype *.ftp
\ {Mount with curlftpfs}
\ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND,
" Fuse7z and 7z archives
filetype {*.7z},<application/x-7z-compressed>
\ {Mount with fuse-7z}
\ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR,
fileviewer {*.7z},<application/x-7z-compressed> 7z l %c
" Office files
filextype {*.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx,*.ppt},
\<application/vnd.openxmlformats-officedocument.*,
\application/msword,
\application/vnd.ms-excel>
\ libreoffice %f &
fileviewer {*.doc},<application/msword> catdoc %c
fileviewer {*.docx},
\<application/
\vnd.openxmlformats-officedocument.wordprocessingml.document>
\ docx2txt.pl %f -
" TuDu files
filetype *.tudu tudu -f %c
" Qt projects
filextype *.pro qtcreator %f &
" Directories
filextype */
\ {View in thunar}
\ Thunar %f &,
" Syntax highlighting in preview
"
" Explicitly set highlight type for some extensions
"
" 256-color terminal
" fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c
" fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c
"
" 16-color terminal
" fileviewer *.c,*.h highlight -O ansi -s dante %c
"
" Or leave it for automatic detection
"
" fileviewer *[^/] pygmentize -O style=monokai -f console256 -g
" Displaying pictures in terminal
"
" fileviewer *.jpg,*.png shellpic %c
" Open all other files with default system programs (you can also remove all
" :file[x]type commands above to ensure they don't interfere with system-wide
" settings). By default all unknown files are opened with 'vi[x]cmd'
" uncommenting one of lines below will result in ignoring 'vi[x]cmd' option
" for unknown file types.
" For *nix:
" filetype * xdg-open
" For OS X:
" filetype * open
" For Windows:
" filetype * start, explorer
" ------------------------------------------------------------------------------
" What should be saved automatically between vifm sessions. Drop "savedirs"
" value if you don't want vifm to remember last visited directories for you.
set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
\phistory,fhistory,dirstack,registers,bookmarks,bmarks
" ------------------------------------------------------------------------------
" Examples of configuring both panels
" Customize view columns a bit (enable ellipsis for truncated file names)
"
" set viewcolumns=-{name}..,6{}.
" Filter-out build and temporary files
"
" filter! {*.lo,*.o,*.d,*.class,*.pyc,*.pyo,.*~}
" ------------------------------------------------------------------------------
" Sample mappings
" Start shell in current directory
nnoremap s :shell<cr>
" Display sorting dialog
nnoremap S :sort<cr>
" Toggle visibility of preview window
nnoremap w :view<cr>
vnoremap w :view<cr>gv
" Open file in existing instance of gvim
nnoremap o :!gvim --remote-tab-silent %f<cr>
" Open file in new instance of gvim
nnoremap O :!gvim %f<cr>
" Open file in the background using its default program
nnoremap gb :file &<cr>l
" Interaction with system clipboard
if has('win')
" Yank current directory path to Windows clipboard with forward slashes
nnoremap yp :!echo %"d:gs!\!/! %i | clip<cr>
" Yank path to current file to Windows clipboard with forward slashes
nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>
elseif executable('xclip')
" Yank current directory path into the clipboard
nnoremap yd :!echo %d | xclip %i<cr>
" Yank current file path into the clipboard
nnoremap yf :!echo %c:p | xclip %i<cr>
elseif executable('xsel')
" Yank current directory path into primary and selection clipboards
nnoremap yd :!echo -n %d | xsel --input --primary %i &&
\ echo -n %d | xsel --clipboard --input %i<cr>
" Yank current file path into into primary and selection clipboards
nnoremap yf :!echo -n %c:p | xsel --input --primary %i &&
\ echo -n %c:p | xsel --clipboard --input %i<cr>
endif
" Mappings for faster renaming
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
" Open console in current directory
nnoremap ,t :!xterm &<cr>
" Open editor to edit vifmrc and apply settings after returning to vifm
nnoremap ,c :write | edit $MYVIFMRC | restart full<cr>
" Open gvim to edit vifmrc
nnoremap ,C :!gvim --remote-tab-silent $MYVIFMRC &<cr>
" Toggle wrap setting on ,w key
nnoremap ,w :set wrap!<cr>
" Example of standard two-panel file managers mappings
nnoremap <f3> :!less %f<cr>
nnoremap <f4> :edit<cr>
nnoremap <f5> :copy<cr>
nnoremap <f6> :move<cr>
nnoremap <f7> :mkdir<space>
nnoremap <f8> :delete<cr>
" Midnight commander alike mappings
" Open current directory in the other pane
nnoremap <a-i> :sync<cr>
" Open directory under cursor in the other pane
nnoremap <a-o> :sync %c<cr>
" Swap panes
nnoremap <c-u> <c-w>x
" ------------------------------------------------------------------------------
" Various customization examples
" Use ag (the silver searcher) instead of grep
"
" set grepprg='ag --line-numbers %i %a %s'
" Add additional place to look for executables
"
" let $PATH = $HOME.'/bin/fuse:'.$PATH
" Block particular shortcut
"
" nnoremap <left> <nop>
" Export IPC name of current instance as environment variable and use it to
" communicate with the instance later.
"
" It can be used in some shell script that gets run from inside vifm, for
" example, like this:
" vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'"
"
" let $VIFM_SERVER_NAME = v:servername

25
.gitignore vendored
View File

@ -1,10 +1,22 @@
# Ignore all files # ignore all files initially
/* /*
# Include contents from .config folder ### track the files below ###
# ~/
!.gitignore
!.bashrc
!.imwheelrc
!.xinitrc
## ~/.xmonad
!/.xmonad
/.xmonad/*
!/.xmonad/xmonad.hs
## ~/.config
!/.config !/.config
/.config/* /.config/*
## Add contents from .config folder
!/.config/xmobar !/.config/xmobar
!/.config/alacritty !/.config/alacritty
!/.config/fish !/.config/fish
@ -12,16 +24,11 @@
!/.config/ncmpcpp !/.config/ncmpcpp
!/.config/nvim !/.config/nvim
!/.config/rofi !/.config/rofi
!/.config/vifm
### ~/.config/retroarch
!/.config/retroarch !/.config/retroarch
/.config/retroarch/* /.config/retroarch/*
!/.config/retroarch/retroarch.cfg !/.config/retroarch/retroarch.cfg
# But not these files...
!.gitignore

8
.imwheelrc Normal file
View File

@ -0,0 +1,8 @@
# Speed up scrolling for the document viewer
"^brave-browser$"
None, Up, Button4, 4
None, Down, Button5, 4
"^Steam$"
None, Up, Button4, 4
None, Down, Button5, 4

3
.xinitrc Normal file
View File

@ -0,0 +1,3 @@
imwheel -b 45
mpd
exec xmonad

332
.xmonad/xmonad.hs Executable file
View File

@ -0,0 +1,332 @@
-------------------------------------------------------------------
-- IMPORTS
------------------------------------------------------------------------
-- Base
import XMonad
import Data.Monoid
import System.Exit
import System.IO (hPutStrLn)
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- Hooks
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.WorkspaceHistory
import XMonad.Hooks.DynamicLog (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..))
-- Layouts
import XMonad.Layout.NoBorders
import XMonad.Layout.Gaps
import XMonad.Layout.Spacing
import XMonad.Layout.ThreeColumns
-- Utilities
import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe)
import XMonad.Util.SpawnOnce
import XMonad.Util.EZConfig
import XMonad.Util.NamedScratchpad
-- Actions
import XMonad.Actions.DynamicProjects
import XMonad.Actions.DynamicWorkspaces
-- Prompt
import XMonad.Prompt
------------------------------------------------------------------------
-- VARIABLES
------------------------------------------------------------------------
-- Terminal to use
myTerminal = "alacritty"
-- Focus follows mouse pointer
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
-- Define mod keys
myModMask = mod4Mask
altMask = mod1Mask
-- Define volume keys and commands
lowerVolumeCmd = "pulseaudio-ctl down 2"
raiseVolumeCmd = "pulseaudio-ctl up 2"
muteVolumeCmd = "pulseaudio-ctl mute"
-- Count windows
windowCount :: X (Maybe String)
windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace . W.current . windowset
-- Define workspaces
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
-- Width of window border
myBorderWidth = 2
-- Border colors
myNormalBorderColor = "#ebdbb2"
myFocusedBorderColor = "#d3869b"
-- Prompt theming
myFont = "xft:Mononoki Nerd Font:bold:size=9:antialias=true:hinting=true"
yellow = "#504945"
base03 = "#ebdbb2"
active = "#b8bb26"
prompt = 20
myPromptTheme = def
{ font = myFont
, bgColor = base03
, fgColor = active
, fgHLight = base03
, bgHLight = active
, borderColor = base03
, promptBorderWidth = 0
, height = prompt
, position = Bottom
}
warmPromptTheme = myPromptTheme
{ bgColor = yellow
, fgColor = base03
, position = Bottom
}
------------------------------------------------------------------------
-- START UP
------------------------------------------------------------------------
myStartupHook = do
spawnOnce "nitrogen --restore &"
------------------------------------------------------------------------
-- KEYBINDS
------------------------------------------------------------------------
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- launch a terminal
[ ((modm, xK_Return), spawn $ XMonad.terminal conf)
-- Launch emacs
, ((modm, xK_e), spawn "emacsclient -c")
-- Launch emacs
, ((modm .|. shiftMask, xK_e), spawn "emacsclient -e '(save-buffers-kill-emacs)'")
-- Launch emacs
, ((modm, xK_f), spawn "emacsclient -c -a '' --eval '(dired nil)'")
-- launch rofi with run
, ((modm, xK_w), spawn "rofi -show drun")
-- launch rofi with window
, ((modm .|. shiftMask, xK_w), spawn "rofi -show window")
-- mute overall volume
, ((0, 0x1008ff12), spawn muteVolumeCmd)
-- raise overall volume
, ((0, 0x1008ff13), spawn raiseVolumeCmd)
-- lower overall volume
, ((0, 0x1008ff11), spawn lowerVolumeCmd)
-- raise mpd volume
, ((modm, 0x1008ff13), spawn "mpc volume +2")
-- lower mpd volume
, ((modm, 0x1008ff11), spawn "mpc volume -2")
-- Download youtube audio from clipboard link
, ((modm, xK_y), spawn "youtube-audio-dl")
-- switch to project prompt
, ((modm, xK_p), switchProjectPrompt warmPromptTheme)
-- move window to project prompt
, ((modm .|. shiftMask, xK_p), shiftToProjectPrompt warmPromptTheme)
-- move window to project prompt
, ((modm .|. shiftMask, xK_BackSpace), removeWorkspace)
-- terminal scratchpad
, ((modm, xK_n), namedScratchpadAction myScratchPads "newsboat")
-- discord scrathpad
, ((modm, xK_d), namedScratchpadAction myScratchPads "discord-canary")
-- terminal scrathpad
, ((modm .|. shiftMask, xK_d), namedScratchpadAction myScratchPads "terminal")
-- start gamemode
, ((modm, xK_g), spawn "gamemoded -r")
-- start gamemode
, ((modm .|. shiftMask, xK_g), spawn "killall gamemoded")
-- launch firefox
, ((modm, xK_F1), spawn "brave")
-- launch discord
, ((modm, xK_F2), spawn "discord")
-- launch lutris
, ((modm, xK_F3), spawn "lutris")
-- launch steam
, ((modm, xK_F4), spawn "steam")
-- mpd go to previous track
, ((modm, xK_F9), spawn "mpc prev")
-- mpd pause/start track
, ((modm, xK_F10), spawn "mpc toggle")
-- mpd go to next track
, ((modm, xK_F11), spawn "mpc next")
-- launch vifm
, ((modm, xK_v), spawn "alacritty -e vifm")
-- close focused window
, ((modm, xK_q), kill)
-- 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)
-- flameshot gui open
, ((modm, xK_z), spawn "flameshot gui")
-- Resize viewed windows to the correct size
, ((modm .|. shiftMask, xK_z), refresh)
-- Move focus to the next window
, ((modm, xK_j), windows W.focusDown)
-- Move focus to the previous window
, ((modm, xK_k), windows W.focusUp)
-- Move focus to the master window
, ((modm, xK_m), windows W.focusMaster)
-- Swap the focused window and the master window
, ((modm, xK_c), 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)))
-- Quit xmonad
, ((modm .|. altMask, xK_q), io (exitWith ExitSuccess))
-- Restart xmonad
, ((modm .|. altMask, xK_r), spawn "xmonad --recompile; xmonad --restart")]
++
-- navigate between workspaces
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
-- ++
-- navigate between screens
-- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
-- | (key, sc) <- zip [xK_d, xK_f] [0..]
-- , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
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))]
------------------------------------------------------------------------
-- LAYOUTS
------------------------------------------------------------------------
myLayout = spacing 2 $ smartBorders (tiled ||| Mirror tiled ||| Full ||| ThreeCol 1 (3/100) (1/2))
where
-- default tiling algorithm partitions the screen into two panes
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 = 2/100
------------------------------------------------------------------------
-- SCRATCHPADS
------------------------------------------------------------------------
myScratchPads :: [NamedScratchpad]
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
, NS "newsboat" spawnNews findNews manageNews
, NS "discord-canary" spawnDiscord findDiscord manageDiscord ]
where
spawnTerm = myTerminal ++ " -t terminal"
findTerm = title =? "terminal"
manageTerm = customFloating $ W.RationalRect l t w h
where
h = 0.9
w = 0.9
t = 0.95 -h
l = 0.95 -w
spawnNews = myTerminal ++ " -t ncmpcpp -e ncmpcpp"
findNews = title =? "ncmpcpp"
manageNews = customFloating $ W.RationalRect l t w h
where
h = 0.5
w = 0.5
t = 0.25
l = 0.25
spawnDiscord = "discord-canary"
findDiscord = appName =? "discord"
manageDiscord = customFloating $ W.RationalRect l t w h
where
h = 0.9
w = 0.9
t = 0.95 -h
l = 0.95 -w
------------------------------------------------------------------------
-- DYNAMIC PROJECTS
------------------------------------------------------------------------
projects :: [Project]
projects =
[ Project { projectName = "desktopConfig"
, projectDirectory = "~/"
, projectStartHook = Just $ do spawn "alacritty -e nvim ~/.config/xmobar/xmobarrc"
spawn "alacritty -e nvim ~/.bashrc"
spawn "alacritty -e nvim ~/.xmonad/xmonad.hs"
windows W.swapDown
windows W.swapDown
windows W.swapDown
}
, Project { projectName = "pythonDev"
, projectDirectory = "~/dev/python"
, projectStartHook = Just $ do spawn "alacritty -e ~/.config/scripts/tmux-python.sh"
}
]
------------------------------------------------------------------------
-- HOOKS
------------------------------------------------------------------------
myManageHook = composeAll
-- Float fullscreen apps (mostly games)
[isDialog --> doCenterFloat,
isFullscreen --> doFullFloat,
className =? "Gimp" --> doFullFloat,
className =? "Anki" --> doFullFloat,
className =? "mpv" --> doRectFloat (W.RationalRect 0.55 0.05 0.4 0.4),
className =? "Steam" --> doFullFloat,
namedScratchpadManageHook myScratchPads]
------------------------------------------------------------------------
-- EVENTS
------------------------------------------------------------------------
myEventHook = mempty
------------------------------------------------------------------------
-- LOGGING
------------------------------------------------------------------------
myLogHook = return ()
------------------------------------------------------------------------
-- MAIN
------------------------------------------------------------------------
main = do
xmproc0 <- spawnPipe "xmobar -x 0 ~/.config/xmobar/xmobarrc"
--
xmonad $ docks $ ewmh $ dynamicProjects projects $ def
--ewmhFullscreen
{
-- Simple items
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
borderWidth = myBorderWidth,
modMask = myModMask,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
-- Key bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- Hooks, Layouts
layoutHook = avoidStruts $ myLayout,
manageHook = myManageHook,
handleEventHook = myEventHook,
logHook = workspaceHistoryHook <+> myLogHook <+> dynamicLogWithPP xmobarPP
{ ppOutput = \x -> hPutStrLn xmproc0 x
, ppCurrent = xmobarColor "#b8bb26" "" . wrap "[" "]" -- Current workspace in xmobar
, ppVisible = xmobarColor "#83a598" "" -- Visible but not current workspace
, ppHidden = xmobarColor "#83a598" "" . wrap "*" "" -- Hidden workspaces in xmobar
, ppHiddenNoWindows= \( _ ) -> "" -- Only shows visible workspaces. Useful for TreeSelect.
, ppTitle = xmobarColor "#ebdbb2" "" . shorten 60 -- Title of active window in xmobar
, ppSep = "<fc=#ebdbb2> | </fc>" -- Separators in xmobar
, ppUrgent = xmobarColor "#fb4934" "" . wrap "!" "!" -- Urgent workspace
, ppExtras = [windowCount] -- # of windows current workspace
, ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t]},
startupHook = myStartupHook
}