Updating the suckless builds.

This commit is contained in:
Derek Taylor 2019-02-12 12:05:25 -06:00
parent b02be49b74
commit fcdf31b890
67 changed files with 322 additions and 3023 deletions

View File

@ -70,47 +70,32 @@ URxvt.keysym.M-v: perl:clipboard:paste
URxvt*depth: 32
! DTs Modified Ocean Dark
! Dracula Xresources palette
!! COLORS
! special
URxvt*foreground: #c0c5ce
URxvt*background: [100]#1D2330
URxvt*cursorColor: #c0c5ce
URxvt*foreground: #F8F8F2
URxvt*background: [100]#282A36
URxvt*cursorColor: #F8F8F2
XTerm*foreground: #c0c5ce
XTerm*background: #1D2330
XTerm*foreground: #F8F8F2
XTerm*background: #282A36
XTerm*cursorColor: #c0c5ce
*.color0: #000000
*.color8: #4D4D4D
*.color1: #FF5555
*.color9: #FF6E67
*.color2: #50FA7B
*.color10: #5AF78E
*.color3: #F1FA8C
*.color11: #F4F99D
*.color4: #BD93F9
*.color12: #CAA9FA
*.color5: #FF79C6
*.color13: #FF92D0
*.color6: #8BE9FD
*.color14: #9AEDFE
*.color7: #BFBFBF
*.color15: #E6E6E6
! black
*.color0: #1D2330
*.color8: #4B5665
! red
*.color1: #645377
*.color9: #84598D
! green
*.color2: #AD69AF
*.color10: #7B8290
! yellow
*.color3: #B1B5C8
*.color11: #d1d7e1
! blue
*.color4: #92969d
*.color12: #4B5665
! magenta
*.color5: #645377
*.color13: #84598D
! cyan
*.color6: #AD69AF
*.color14: #7B8290
! white
*.color7: #B1B5C8
*.color15: #d1d7e1

View File

@ -56,8 +56,10 @@ opacity-rule = [ "99:name *?= 'Call'",
"99:class_g = 'VirtualBox'",
"99:name *?= 'VLC'",
"99:name *?= 'Write'",
"95:class_g = 'XTerm' && !_NET_WM_STATE@:32a",
"95:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
"90:name *?= 'Lynx'",
"90:name *?= 'xmobar'",
"100:class_g = 'XTerm' && !_NET_WM_STATE@:32a",
"100:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"96:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'" ];
wintypes :

View File

@ -929,13 +929,12 @@ icon-4 = 5;
icon-5 = 6;
icon-6 = 7;
icon-7 = 8;
icon-8 = 9;
icon-9 = 10;
#icon-8 = 9;
#icon-9 = 10;
icon-default = " "
format = <label-state>
label-monitor = %name%
;label-active = %icon% %name%
label-active = %icon%
label-active-foreground = ${colors.foreground}
label-active-background = ${colors.background}

View File

@ -8,18 +8,19 @@
# A customized config.py for Qtile window manager (http://www.qtile.org)
# Modified by Derek Taylor (http://www.gitlab.com/dwt1/ )
#
# The following comments are the copyright and licensing information from the default config.
# Copyright (c) 2010 Aldo Cortesi, 2010, 2014 dequis, 2012 Randall Ma, 2012-2014 Tycho Andersen,
# 2012 Craig Barnes, 2013 horsik, 2013 Tao Sauvage
# The following comments are the copyright and licensing information from the default
# qtile config. Copyright (c) 2010 Aldo Cortesi, 2010, 2014 dequis, 2012 Randall Ma,
# 2012-2014 Tycho Andersen, 2012 Craig Barnes, 2013 horsik, 2013 Tao Sauvage
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial
# portions of the Software.
# The above copyright notice and this permission notice shall be included in all copies
# or substantial portions of the Software.
##### IMPORTS #####

View File

@ -2,9 +2,9 @@
-- install xmobar with these flags: --flags="with_alsa" --flags="with_mpd" --flags="with_xft" OR --flags="all_extensions"
-- you can find weather location codes here: http://weather.noaa.gov/index.html
Config { font = "xft:ubuntu mono:pixelsize=13:antialias=true:hinting=true"
, bgColor = "#002B36"
, fgColor = "#839496"
Config { font = "xft:UbuntuMono Nerd Font:pixelsize=14:antialias=true:hinting=true"
, bgColor = "#282A36"
, fgColor = "#F8F8F2"
, position = Top
, lowerOnStart = True
, hideOnStart = False

View File

@ -2,9 +2,9 @@
-- install xmobar with these flags: --flags="with_alsa" --flags="with_mpd" --flags="with_xft" OR --flags="all_extensions"
-- you can find weather location codes here: http://weather.noaa.gov/index.html
Config { font = "xft:ubuntu mono:pixelsize=13:antialias=true:hinting=true"
, bgColor = "#002B36"
, fgColor = "#839496"
Config { font = "xft:UbuntuMono Nerd Font:pixelsize=14:antialias=true:hinting=true"
, bgColor = "#282A36"
, fgColor = "#F8F8F2"
, position = Top
, lowerOnStart = True
, hideOnStart = False

View File

@ -2,16 +2,15 @@
-- install xmobar with these flags: --flags="with_alsa" --flags="with_mpd" --flags="with_xft" OR --flags="all_extensions"
-- you can find weather location codes here: http://weather.noaa.gov/index.html
Config { font = "xft:ubuntu mono:pixelsize=13:antialias=true:hinting=true"
, bgColor = "#002B36"
, fgColor = "#839496"
Config { font = "xft:UbuntuMono Nerd Font:pixelsize=14:antialias=true:hinting=true"
, bgColor = "#282A36"
, fgColor = "#F8F8F2"
, position = Top
, lowerOnStart = True
, hideOnStart = False
, allDesktops = True
, persistent = True
, commands = [ Run Weather "KMLU" ["-t","temp: <tempF>F"] 36000
, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
, commands = [ Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
, Run Network "enp3s0" ["-t", "net: <rx>kb|<tx>kb"] 10
, Run Cpu ["-t","cpu: <total>%","-H","50","--high","red"] 10
, Run Memory ["-t","mem: <usedratio>%"] 10
@ -20,5 +19,5 @@ Config { font = "xft:ubuntu mono:pixelsize=13:antialias=true:hinting=true"
]
, sepChar = "%"
, alignSep = "}{"
, template = "%UnsafeStdinReader% }{ <fc=#91A0BD> <fc=#859900>%cpu%</fc> : <fc=#DC322F>%memory%</fc> : <fc=#B58900>%disku%</fc> : <fc=#D33682>%enp3s0%</fc> : <fc=#6c71c4>%KMLU%</fc> : <fc=#fdf6e3>%date%</fc> </fc> "
, template = "%UnsafeStdinReader% }{ <fc=#91A0BD> <fc=#BD93F9>%cpu%</fc> : <fc=#FF6E67>%memory%</fc> : <fc=#9AEDFE>%disku%</fc> : <fc=#F4F99D>%enp3s0%</fc> : <fc=#F8F8F2>%date%</fc> </fc> "
}

8
.vimrc
View File

@ -68,14 +68,14 @@ set laststatus=2
" set t_Co=256
syntax on
set number
set relativenumber
let g:rehash256 = 1
let g:Powerline_symbols='unicode'
let g:Powerline_theme='long'
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='powerlineish'
let g:airline_theme='angr'
" Uncomment to prevent non-normal modes showing in powerline and below powerline.
set noshowmode
@ -108,7 +108,9 @@ let NERDTreeMinimalUI = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
hi LineNr ctermfg=4 ctermbg=232
hi LineNr ctermfg=4
hi CursorLineNr ctermfg=15 ctermbg=8
hi VertSplit ctermfg=8 ctermbg=0
hi Statement ctermfg=3
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

View File

@ -72,25 +72,25 @@ import XMonad.Prompt (defaultXPConfig, XPConfig(..), XPPosition(Top), Direction1
---CONFIG
----------------------------------------------------------------------------------------------
myModMask = mod4Mask -- Sets modkey to super/windows key
myTerminal = "urxvtc" -- Sets default terminal
myTerminal = "st" -- Sets default terminal
myTextEditor = "editor" -- Sets default text editor
myBorderWidth = 3 -- Sets border width for windows
myBorderWidth = 2 -- Sets border width for windows
windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace . W.current . windowset
main = do
xmproc0 <- spawnPipe "xmobar -x 0 /home/dt/.config/xmobar/xmobarrc0" -- Launches xmobar
xmproc1 <- spawnPipe "xmobar -x 1 /home/dt/.config/xmobar/xmobarrc1" -- Launches xmobar
xmproc2 <- spawnPipe "xmobar -x 2 /home/dt/.config/xmobar/xmobarrc2" -- Launches xmobar
xmproc0 <- spawnPipe "xmobar -x 0 /home/dt/.config/xmobar/xmobarrc2" -- Launch xmobar mon2
xmproc1 <- spawnPipe "xmobar -x 1 /home/dt/.config/xmobar/xmobarrc1" -- Launch xmobar mon1
xmproc2 <- spawnPipe "xmobar -x 2 /home/dt/.config/xmobar/xmobarrc0" -- Launch xmobar mon0
xmonad $ ewmh desktopConfig
{ manageHook = ( isFullscreen --> doFullFloat ) <+> manageHook defaultConfig <+> manageDocks
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = \x -> hPutStrLn xmproc0 x >> hPutStrLn xmproc1 x >> hPutStrLn xmproc2 x
, ppCurrent = xmobarColor "#859900" "" . wrap "[" "]" -- Current workspace in xmobar
, ppVisible = xmobarColor "#859900" "" . wrap "" "" -- Visible but not current workspace
, ppHidden = xmobarColor "#D33682" "" -- Hidden workspaces in xmobar
, ppHiddenNoWindows = xmobarColor "#D33682" "" -- Hidden workspaces (no windows)
, ppTitle = xmobarColor "#859900" "" . shorten 80 -- Title of active window in xmobar
, ppSep = "<fc=#839496> : </fc>" -- Separators in xmobar
, ppCurrent = xmobarColor "#50FA7B" "" . wrap "[" "]" -- Current workspace in xmobar
, ppVisible = xmobarColor "#50FA7B" "" -- Visible but not current workspace
, ppHidden = xmobarColor "#F1FA8C" "" . wrap "*" "" -- Hidden workspaces in xmobar
, ppHiddenNoWindows = xmobarColor "#FF79C6" "" -- Hidden workspaces (no windows)
, ppTitle = xmobarColor "#F8F8F2" "" . shorten 80 -- Title of active window in xmobar
, ppSep = "<fc=#9AEDFE> : </fc>" -- Separators in xmobar
, ppUrgent = xmobarColor "#C45500" "" . wrap "!" "!" -- Urgent workspace
, ppExtras = [windowCount] -- # of windows current workspace
, ppOrder = \(ws:l:t:exs) -> [ws,l]++exs++[t]
@ -101,8 +101,8 @@ main = do
, layoutHook = myLayoutHook
, workspaces = myWorkspaces
, borderWidth = myBorderWidth
, normalBorderColor = "#151515"
, focusedBorderColor = "#76581E"
, normalBorderColor = "#282A36"
, focusedBorderColor = "#C7ABCA"
} `additionalKeysP` myKeys
----------------------------------------------------------------------------------------------
@ -169,7 +169,7 @@ myKeys =
, ("M-S-<Space>", sendMessage ToggleStruts)
, ("M-d", asks (XMonad.layoutHook . config) >>= setLayout)
, ("M-<KP_Enter>", sendMessage NextLayout)
, ("M-S-f", sendMessage (T.Toggle "floatz"))
, ("M-S-f", sendMessage (T.Toggle "float"))
, ("M-S-g", sendMessage (T.Toggle "gimp"))
, ("M-S-x", sendMessage $ Toggle REFLECTX)
, ("M-S-y", sendMessage $ Toggle REFLECTY)
@ -195,7 +195,7 @@ myKeys =
-- Main Run Apps
, ("M-<Return>", spawn myTerminal)
, ("M-<KP_Insert>", spawn "rofi -show run")
, ("M-<KP_Insert>", spawn "dmenu_run -fn 'UbuntuMono Nerd Font:size=10' -nb '#282A36' -nf '#F8F8F2' -sb '#BD93F9' -sf '#282A36' -p 'dmenu:'")
-- Command Line Apps (MOD + KEYPAD 1-9)
, ("M-<KP_End>", spawn (myTerminal ++ " -e lynx -cfg=~/.lynx.cfg -lss=~/.lynx.lss http://www.distrowatch.com")) -- Keypad 1
@ -205,17 +205,17 @@ myKeys =
, ("M-<KP_Begin>", spawn (myTerminal ++ " -e neomutt")) -- Keypad 5
, ("M-<KP_Right>", spawn (myTerminal ++ " -e twitch-curses")) -- Keypad 6
, ("M-<KP_Home>", spawn (myTerminal ++ " -e sh ./scripts/haxor-news.sh")) -- Keypad 7
, ("M-<KP_Up>", spawn (myTerminal ++ " -e rainbowstream")) -- Keypad 8
, ("M-<KP_Up>", spawn (myTerminal ++ " -e toot curses")) -- Keypad 8
, ("M-<KP_Page_Up>", spawn (myTerminal ++ " -e sh ./scripts/tig-script.sh")) -- Keypad 9
-- Command Line Apps (MOD + SHIFT + KEYPAD 1-9)
, ("M-S-<KP_End>", spawn (myTerminal ++ " -e ranger")) -- Keypad 1
, ("M-S-<KP_Down>", spawn (myTerminal ++ " -e irssi")) -- Keypad 2
, ("M-S-<KP_Page_Down>", spawn (myTerminal ++ " -e mocp")) -- Keypad 3
, ("M-S-<KP_Left>", spawn (myTerminal ++ " -e ''")) -- Keypad 4
, ("M-S-<KP_End>", spawn (myTerminal ++ " -e vifm")) -- Keypad 1
, ("M-S-<KP_Down>", spawn (myTerminal ++ " -e htop")) -- Keypad 2
, ("M-S-<KP_Page_Down>", spawn (myTerminal ++ " -e cmus")) -- Keypad 3
, ("M-S-<KP_Left>", spawn (myTerminal ++ " -e irssi")) -- Keypad 4
, ("M-S-<KP_Begin>", spawn (myTerminal ++ " -e rtorrent")) -- Keypad 5
, ("M-S-<KP_Right>", spawn (myTerminal ++ " -e youtube-viewer")) -- Keypad 6
, ("M-S-<KP_Home>", spawn (myTerminal ++ " -e alsamixer")) -- Keypad 7
, ("M-S-<KP_Home>", spawn (myTerminal ++ " -e ncpamixer")) -- Keypad 7
, ("M-S-<KP_Up>", spawn (myTerminal ++ " -e calcurse")) -- Keypad 8
, ("M-S-<KP_Page_Up>", spawn (myTerminal ++ " -e vim /home/dt/.xmonad/xmonad.hs")) -- Keypad 9
@ -225,9 +225,9 @@ myKeys =
, ("M-C-<KP_Page_Down>", spawn (myTerminal ++ " -e nmon")) -- Keypad 3
, ("M-C-<KP_Left>", spawn (myTerminal ++ " -e httping -KY --draw-phase localhost")) -- Keypad 4
, ("M-C-<KP_Begin>", spawn (myTerminal ++ " -e s-tui")) -- Keypad 5
, ("M-C-<KP_Right>", spawn (myTerminal ++ " -e ''")) -- Keypad 6
, ("M-C-<KP_Home>", spawn (myTerminal ++ " -e ''")) -- Keypad 7
, ("M-C-<KP_Up>", spawn (myTerminal ++ " -e ''")) -- Keypad 8
, ("M-C-<KP_Right>", spawn (myTerminal ++ " -e pianobar")) -- Keypad 6
, ("M-C-<KP_Home>", spawn (myTerminal ++ " -e cmatrix -C cyan")) -- Keypad 7
, ("M-C-<KP_Up>", spawn (myTerminal ++ " -e joplin")) -- Keypad 8
, ("M-C-<KP_Page_Up>", spawn (myTerminal ++ " -e wopr report.xml")) -- Keypad 9
-- GUI Apps
@ -263,7 +263,7 @@ xmobarEscape = concatMap doubleLts
myWorkspaces :: [String]
myWorkspaces = clickable . (map xmobarEscape)
$ [" dev", "www", "sys", "doc", "vbox", "chat", "media", "gfx"]
$ ["dev", "www", "sys", "doc", "vbox", "chat", "media", "gfx"]
where
clickable l = [ "<action=xdotool key super+" ++ show (n) ++ ">" ++ ws ++ "</action>" |
(i,ws) <- zip [1..8] l,
@ -283,7 +283,6 @@ myManageHook = placeHook (withGaps (20,12,12,12) (smart (0.5,0.5))) <+> insertPo
myWebApps = ["firefox", "thunderbird"]
myMediaApps = ["vlc", "ncmpcpp", "weechat", "mplayer", "gimp"]
mySystApps = ["ranger", "pcmanfm", "geany", "nitrogen"]
myFloatApps = ["file-roller", "nitrogen"]
myUnfloatApps = ["gimp"]
@ -291,7 +290,7 @@ myManageHook = placeHook (withGaps (20,12,12,12) (smart (0.5,0.5))) <+> insertPo
----------------------------------------------------------------------------------------------
---LAYOUTS
----------------------------------------------------------------------------------------------
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floatz $
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats $
mkToggle (NBFULL ?? NOBORDERS ?? EOT) $ renamed [CutWordsLeft 4] $ maximize $
minimize $ boringWindows $ spacing 0 $
myDevLayout $
@ -303,23 +302,25 @@ myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts float
myMediaLayout $
myGfxLayout $
myDefaultLayout
myDefaultLayout = grid ||| threeCol ||| threeRow ||| oneBig ||| noBorders monocle ||| space ||| floatz
myDevLayout = onWorkspace (myWorkspaces !! 0) $ grid ||| threeCol ||| threeRow ||| oneBig ||| floatz
myWebLayout = onWorkspace (myWorkspaces !! 1) $ noBorders monocle ||| oneBig ||| threeCol ||| threeRow ||| grid
mySysLayout = onWorkspace (myWorkspaces !! 2) $ oneBig ||| threeCol ||| threeRow ||| grid
myDocLayout = onWorkspace (myWorkspaces !! 3) $ oneBig ||| threeCol ||| threeRow ||| grid
myVboxLayout = onWorkspace (myWorkspaces !! 4) $ noBorders monocle ||| oneBig ||| threeCol ||| threeRow ||| grid
myChatLayout = onWorkspace (myWorkspaces !! 5) $ grid ||| threeCol ||| threeRow ||| oneBig ||| floatz
myMediaLayout = onWorkspace (myWorkspaces !! 6) $ noBorders monocle ||| oneBig ||| space ||| threeRow
myGfxLayout = onWorkspace (myWorkspaces !! 7) $ T.toggleLayouts gimp $ noBorders monocle ||| floatz ||| grid
where
myDevLayout = onWorkspace (myWorkspaces !! 0) $ grid ||| threeCol ||| threeRow ||| oneBig ||| floats
myWebLayout = onWorkspace (myWorkspaces !! 1) $ noBorders monocle ||| oneBig ||| threeCol ||| threeRow ||| grid
mySysLayout = onWorkspace (myWorkspaces !! 2) $ oneBig ||| threeCol ||| threeRow ||| grid
myDocLayout = onWorkspace (myWorkspaces !! 3) $ oneBig ||| threeCol ||| threeRow ||| grid
myVboxLayout = onWorkspace (myWorkspaces !! 4) $ noBorders monocle ||| oneBig ||| threeCol ||| threeRow ||| grid
myChatLayout = onWorkspace (myWorkspaces !! 5) $ grid ||| threeCol ||| threeRow ||| oneBig ||| floats
myMediaLayout = onWorkspace (myWorkspaces !! 6) $ noBorders monocle ||| oneBig ||| space ||| threeRow
myGfxLayout = onWorkspace (myWorkspaces !! 7) $ T.toggleLayouts gimp $ noBorders monocle ||| floats ||| grid
myDefaultLayout = grid ||| threeCol ||| threeRow ||| oneBig ||| noBorders monocle ||| space ||| floats
grid = renamed [Replace "grid"] $ limitWindows 12 $ spacing 4 $ mkToggle (single MIRROR) $ Grid (16/10)
threeCol = renamed [Replace "threeCol"] $ limitWindows 3 $ ThreeCol 1 (3/100) (1/2)
threeRow = renamed [Replace "threeRow"] $ limitWindows 3 $ Mirror $ mkToggle (single MIRROR) zoomRow
oneBig = renamed [Replace "oneBig"] $ limitWindows 6 $ Mirror $ mkToggle (single MIRROR) $ mkToggle (single REFLECTX) $ mkToggle (single REFLECTY) $ OneBig (5/9) (8/12)
monocle = renamed [Replace "monocle"] $ limitWindows 20 Full
space = renamed [Replace "space"] $ limitWindows 4 $ spacing 36 $ Mirror $ mkToggle (single MIRROR) $ mkToggle (single REFLECTX) $ mkToggle (single REFLECTY) $ OneBig (2/3) (2/3)
floatz = renamed [Replace "floatz"] $ limitWindows 20 simplestFloat
floats = renamed [Replace "floats"] $ limitWindows 20 simplestFloat
gimp = renamed [Replace "gimp"] $ limitWindows 5 $ withIM 0.11 (Role "gimp-toolbox") $ reflectHoriz $ withIM 0.15 (Role "gimp-dock") Full

6
dmenu/LICENSE Normal file → Executable file
View File

@ -1,6 +1,6 @@
MIT/X Consortium License
© 2006-2014 Anselm R Garbe <anselm@garbe.us>
© 2006-2019 Anselm R Garbe <anselm@garbe.ca>
© 2006-2008 Sander van Dijk <a.h.vandijk@gmail.com>
© 2006-2007 Michał Janeczek <janeczek@gmail.com>
© 2007 Kris Maglione <jg@suckless.org>
@ -8,8 +8,8 @@ MIT/X Consortium License
© 2009 Markus Schnalke <meillo@marmaro.de>
© 2009 Evan Gates <evan.gates@gmail.com>
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
© 2014-2018 Hiltjo Posthuma <hiltjo@codemadness.org>
© 2015-2018 Quentin Rameau <quinq@fifth.space>
© 2014-2019 Hiltjo Posthuma <hiltjo@codemadness.org>
© 2015-2019 Quentin Rameau <quinq@fifth.space>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

0
dmenu/Makefile Normal file → Executable file
View File

0
dmenu/README Normal file → Executable file
View File

0
dmenu/arg.h Normal file → Executable file
View File

1
dmenu/config.def.h Normal file → Executable file
View File

@ -15,6 +15,7 @@ static const char *colors[SchemeLast][2] = {
};
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 0;
static unsigned int lineheight = 0; /* -h option; minimum height of a menu line */
/*
* Characters not considered part of a word while deleting words

7
dmenu/config.h Normal file → Executable file
View File

@ -4,17 +4,18 @@
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {
"UbuntuMono Nerd Font:size=11"
"monospace:size=10"
};
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
static const char *colors[SchemeLast][2] = {
/* fg bg */
[SchemeNorm] = { "#AD69AF", "#1D2330" },
[SchemeSel] = { "#d1d7e1", "#84598D" },
[SchemeNorm] = { "#bbbbbb", "#222222" },
[SchemeSel] = { "#eeeeee", "#005577" },
[SchemeOut] = { "#000000", "#00ffff" },
};
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 0;
static unsigned int lineheight = 22; /* -h option; minimum height of a menu line */
/*
* Characters not considered part of a word while deleting words

2
dmenu/config.mk Normal file → Executable file
View File

@ -1,5 +1,5 @@
# dmenu version
VERSION = 4.8
VERSION = 4.9
# paths
PREFIX = /usr/local

Binary file not shown.

3
dmenu/dmenu.1 Normal file → Executable file
View File

@ -50,6 +50,9 @@ dmenu matches menu items case insensitively.
.BI \-l " lines"
dmenu lists items vertically, with the given number of lines.
.TP
.BI \-h " height"
dmenu uses a menu line of at least 'height' pixels tall, but no less than 8.
.TP
.BI \-m " monitor"
dmenu is displayed on the monitor number supplied. Monitor numbers are starting
from 0.

17
dmenu/dmenu.c Normal file → Executable file
View File

@ -131,7 +131,7 @@ drawmenu(void)
{
unsigned int curpos;
struct item *item;
int x = 0, y = 0, w;
int x = 0, y = 0, fh = drw->fonts->h, w;
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, 0, 0, mw, mh, 1, 1);
@ -148,7 +148,7 @@ drawmenu(void)
curpos = TEXTW(text) - TEXTW(&text[cursor]);
if ((curpos += lrpad / 2 - 1) < w) {
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
drw_rect(drw, x + curpos, 2 + (bh-fh)/2, 2, fh - 4, 1, 0);
}
if (lines > 0) {
@ -556,6 +556,11 @@ run(void)
if (XFilterEvent(&ev, None))
continue;
switch(ev.type) {
case DestroyNotify:
if (ev.xdestroywindow.window != win)
break;
cleanup();
exit(1);
case Expose:
if (ev.xexpose.count == 0)
drw_map(drw, win, 0, 0, mw, mh);
@ -604,6 +609,7 @@ setup(void)
/* calculate menu geometry */
bh = drw->fonts->h + 2;
bh = MAX(bh,lineheight); /* make a menu line AT LEAST 'lineheight' tall */
lines = MAX(lines, 0);
mh = (lines + 1) * bh;
#ifdef XINERAMA
@ -667,7 +673,7 @@ setup(void)
XMapRaised(dpy, win);
XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
if (embed) {
XSelectInput(dpy, parentwin, FocusChangeMask);
XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask);
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
for (i = 0; i < du && dws[i] != win; ++i)
XSelectInput(dpy, dws[i], FocusChangeMask);
@ -683,6 +689,7 @@ static void
usage(void)
{
fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
" [-h height]\n"
" [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
exit(1);
}
@ -716,6 +723,10 @@ main(int argc, char *argv[])
prompt = argv[++i];
else if (!strcmp(argv[i], "-fn")) /* font or font set */
fonts[0] = argv[++i];
else if(!strcmp(argv[i], "-h")) { /* minimum height of one menu line */
lineheight = atoi(argv[++i]);
lineheight = MAX(lineheight,8); /* reasonable default in case of value too small/negative */
}
else if (!strcmp(argv[i], "-nb")) /* normal background color */
colors[SchemeNorm][ColBg] = argv[++i];
else if (!strcmp(argv[i], "-nf")) /* normal foreground color */

Binary file not shown.

0
dmenu/dmenu_path Normal file → Executable file
View File

16
dmenu/drw.c Normal file → Executable file
View File

@ -132,6 +132,19 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
die("no font specified.");
}
/* Do not allow using color fonts. This is a workaround for a BadLength
* error from Xft with color glyphs. Modelled on the Xterm workaround. See
* https://bugzilla.redhat.com/show_bug.cgi?id=1498269
* https://lists.suckless.org/dev/1701/30932.html
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
* and lots more all over the internet.
*/
FcBool iscol;
if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
XftFontClose(drw->dpy, xfont);
return NULL;
}
font = ecalloc(1, sizeof(Fnt));
font->xfont = xfont;
font->pattern = pattern;
@ -200,7 +213,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
Clr *ret;
/* need at least two colors for a scheme */
if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(Clr))))
if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
return NULL;
for (i = 0; i < clrcount; i++)
@ -337,6 +350,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
fcpattern = FcPatternDuplicate(drw->fonts->pattern);
FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
FcDefaultSubstitute(fcpattern);

0
dmenu/drw.h Normal file → Executable file
View File

Binary file not shown.

0
dmenu/stest.1 Normal file → Executable file
View File

0
dmenu/stest.c Normal file → Executable file
View File

0
dmenu/util.c Normal file → Executable file
View File

0
dmenu/util.h Normal file → Executable file
View File

View File

@ -1,6 +1,6 @@
MIT/X Consortium License
© 2006-2017 Anselm R Garbe <anselm@garbe.us>
© 2006-2019 Anselm R Garbe <anselm@garbe.ca>
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>

View File

@ -69,6 +69,8 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL };
#include "selfrestart.c"
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
@ -107,6 +109,7 @@ static Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
@ -126,4 +129,3 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};

View File

@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int horizpadbar = 2; /* horizontal padding for statusbar */
static const int vertpadbar = 0; /* vertical padding for statusbar */
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
@ -36,11 +38,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
#include "layouts.c"
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
{ "HHH", grid },
{ NULL, NULL },
};
@ -60,11 +64,15 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL };
#include "selfrestart.c"
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
{ MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
@ -77,6 +85,7 @@ static Key keys[] = {
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_g, setlayout, {.v = &layouts[3]} },
{ MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
{ MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
{ MODKEY, XK_space, setlayout, {0} },
@ -96,6 +105,7 @@ static Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
@ -115,4 +125,3 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};

15
dwm/config.def.h.rej Normal file → Executable file
View File

@ -1,24 +1,19 @@
--- config.def.h
+++ config.def.h
@@ -36,11 +36,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
+#include "layouts.c"
static const Layout layouts[] = {
/* symbol arrange function */
@@ -41,6 +41,7 @@ static const Layout layouts[] = {
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { "HHH", grid },
+ { NULL, NULL },
};
/* key definitions */
@@ -76,6 +78,7 @@ static Key keys[] = {
@@ -76,6 +77,8 @@ static Key keys[] = {
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_g, setlayout, {.v = &layouts[3]} },
+ { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
+ { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },

27
dwm/config.h Normal file → Executable file
View File

@ -1,7 +1,15 @@
/* See LICENSE file for copyright and license details. */
/* ____ _____ */
/* | _ \_ _| Derek Taylor (DistroTube) */
/* | | | || | http://www.youtube.com/c/DistroTube */
/* | |_| || | http://www.gitlab.com/dwt1/ */
/* |____/ |_| */
#include "selfrestart.c"
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int gappx = 5; /* pixel gap between clients */
static const int showbar = 1; /* 0 means no bar */
@ -10,12 +18,12 @@ static const int horizpadbar = 6; /* horizontal padding for status
static const int vertpadbar = 7; /* vertical padding for statusbar */
static const char *fonts[] = { "UbuntuMono Nerd Font:size=10" };
static const char dmenufont[] = "UbuntuMono Nerd Font:size=10";
static const char col_gray1[] = "#1D2330";
static const char col_gray2[] = "#4B5665";
static const char col_gray3[] = "#AD69AF";
static const char col_gray4[] = "#d1d7e1";
static const char col_cyan[] = "#84598D";
static const unsigned int baralpha = 0xef;
static const char col_gray1[] = "#000000";
static const char col_gray2[] = "#000000"; /* border color unfocused windows */
static const char col_gray3[] = "#96b5b4";
static const char col_gray4[] = "#c0c5ce";
static const char col_cyan[] = "#924441"; /* border color focused windows and tags */
static const unsigned int baralpha = 0xee;
static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = {
/* fg bg border */
@ -150,7 +158,8 @@ static Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
};
/* button definitions */

View File

@ -1,5 +1,5 @@
# dwm version
VERSION = 6.1
VERSION = 6.2
# Customize below to fit your system

View File

@ -135,6 +135,19 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
die("no font specified.");
}
/* Do not allow using color fonts. This is a workaround for a BadLength
* error from Xft with color glyphs. Modelled on the Xterm workaround. See
* https://bugzilla.redhat.com/show_bug.cgi?id=1498269
* https://lists.suckless.org/dev/1701/30932.html
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
* and lots more all over the internet.
*/
FcBool iscol;
if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
XftFontClose(drw->dpy, xfont);
return NULL;
}
font = ecalloc(1, sizeof(Fnt));
font->xfont = xfont;
font->pattern = pattern;
@ -204,7 +217,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], si
Clr *ret;
/* need at least two colors for a scheme */
if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(Clr))))
if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
return NULL;
for (i = 0; i < clrcount; i++)
@ -339,6 +352,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
fcpattern = FcPatternDuplicate(drw->fonts->pattern);
FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
FcDefaultSubstitute(fcpattern);

0
dwm/dwm-alpha-20180613-b69c870.diff Normal file → Executable file
View File

0
dwm/dwm-attachaside-20180126-db22360.diff Normal file → Executable file
View File

0
dwm/dwm-uselessgap-6.1.diff Normal file → Executable file
View File

View File

@ -740,10 +740,10 @@ dirtomon(int dir)
void
drawbar(Monitor *m)
{
int x, w, sw = 0;
int x, w, sw = 0, tw, mw, ew = 0;
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
unsigned int i, occ = 0, urg = 0, n = 0;
Client *c;
/* draw status first so it can be overdrawn by tags later */
@ -754,6 +754,8 @@ drawbar(Monitor *m)
}
for (c = m->clients; c; c = c->next) {
if (ISVISIBLE(c))
n++;
occ |= c->tags;
if (c->isurgent)
urg |= c->tags;
@ -774,15 +776,39 @@ drawbar(Monitor *m)
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
if ((w = m->ww - sw - x) > bh) {
if (m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
if (m->sel->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
} else {
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x, 0, w, bh, 1, 1);
if (n > 0) {
tw = TEXTW(m->sel->name) + lrpad;
mw = (tw >= w || n == 1) ? 0 : (w - tw) / (n - 1);
i = 0;
for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c) || c == m->sel)
continue;
tw = TEXTW(c->name);
if(tw < mw)
ew += (mw - tw);
else
i++;
}
if (i > 0)
mw += ew / i;
for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c))
continue;
tw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
if (tw > 0) /* trap special handling of 0 in drw_text */
drw_text(drw, x, 0, tw, bh, lrpad / 2, c->name, 0);
if (c->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
x += tw;
w -= tw;
}
}
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x, 0, w, bh, 1, 1);
}
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
}

View File

@ -749,8 +749,8 @@ drawbar(Monitor *m)
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
sw = TEXTW(stext);
drw_text(drw, m->ww - sw, 0, sw, bh, lrpad / 2, stext, 0);
}
for (c = m->clients; c; c = c->next) {
@ -1684,8 +1684,8 @@ setup(void)
drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
die("no fonts could be loaded.");
lrpad = drw->fonts->h;
bh = drw->fonts->h + 2;
lrpad = drw->fonts->h + horizpadbar;
bh = drw->fonts->h + vertpadbar;
updategeom();
/* init atoms */
utf8string = XInternAtom(dpy, "UTF8_STRING", False);

0
dwm/layouts.c Normal file → Executable file
View File

0
st/FAQ Normal file → Executable file
View File

0
st/LEGACY Normal file → Executable file
View File

0
st/LICENSE Normal file → Executable file
View File

2
st/Makefile Normal file → Executable file
View File

@ -22,7 +22,7 @@ config.h:
$(CC) $(STCFLAGS) -c $<
st.o: config.h st.h win.h
x.o: arg.h st.h win.h
x.o: arg.h config.h st.h win.h
$(OBJ): config.h config.mk

0
st/README Normal file → Executable file
View File

0
st/TODO Normal file → Executable file
View File

0
st/arg.h Normal file → Executable file
View File

2
st/config.def.h Normal file → Executable file
View File

@ -180,8 +180,8 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ TERMMOD, XK_I, iso14755, {.i = 0} },
};
/*

View File

@ -1,466 +0,0 @@
/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
static int borderpx = 2;
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: utmp option
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: " `'\"()[]{}"
*/
char *worddelimiters = " ";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600;
/* alt screens */
int allowaltscreen = 1;
/* frames per second st should at maximum draw to the screen */
static unsigned int xfps = 120;
static unsigned int actionfps = 30;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* attribute.
*/
static unsigned int blinktimeout = 800;
/*
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 0;
/* default TERM value */
char *termname = "st-256color";
/*
* spaces per tab
*
* When you are changing this value, don't forget to adapt the »it« value in
* the st.info and appropriately install the st.info in the environment where
* you use this st version.
*
* it#$tabspaces,
*
* Secondly make sure your kernel is not expanding tabs. When running `stty
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
* running following command:
*
* stty tabs
*/
unsigned int tabspaces = 8;
/* bg opacity */
unsigned int alpha = 0xcc;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"black",
"red3",
"green3",
"yellow3",
"blue2",
"magenta3",
"cyan3",
"gray90",
/* 8 bright colors */
"gray50",
"red",
"green",
"yellow",
"#5c5cff",
"magenta",
"cyan",
"white",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
"black",
};
/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 7;
unsigned int defaultbg = 257;
static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
/*
* Default shape of cursor
* 2: Block ("")
* 4: Underline ("_")
* 6: Bar ("|")
* 7: Snowman ("")
*/
static unsigned int cursorshape = 2;
/*
* Default columns and rows numbers
*/
static unsigned int cols = 80;
static unsigned int rows = 24;
/*
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7;
static unsigned int mousebg = 0;
/*
* Color used to display font attributes when fontconfig selected a font which
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11;
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* button mask string */
{ Button4, XK_ANY_MOD, "\031" },
{ Button5, XK_ANY_MOD, "\005" },
};
/* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask
#define TERMMOD (ControlMask|ShiftMask)
static Shortcut shortcuts[] = {
/* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ TERMMOD, XK_Prior, zoom, {.f = +1} },
{ TERMMOD, XK_Next, zoom, {.f = -1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ TERMMOD, XK_I, iso14755, {.i = 0} },
};
/*
* Special keys (change & recompile st.info accordingly)
*
* Mask value:
* * Use XK_ANY_MOD to match the key no matter modifiers state
* * Use XK_NO_MOD to match the key alone (no modifiers)
* appkey value:
* * 0: no value
* * > 0: keypad application mode enabled
* * = 2: term.numlock = 1
* * < 0: keypad application mode disabled
* appcursor value:
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
* crlf value
* * 0: no value
* * > 0: crlf mode is enabled
* * < 0: crlf mode is disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
* position for a key.
*/
/*
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 };
/*
* State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/*
* Override mouse-select while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forceselmod = ShiftMask;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = {
/* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
};
/*
* Selection types' masks.
* Use the same masks as usual.
* Button1Mask is always unset, to make masks match between ButtonPress.
* ButtonRelease and MotionNotify.
* If no match is found, regular selection is used.
*/
static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask,
};
/*
* Printable characters in ASCII, used to estimate the advance width
* of single wide characters.
*/
static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@ -1,29 +0,0 @@
--- config.def.h
+++ config.def.h
@@ -82,6 +82,9 @@ char *termname = "st-256color";
*/
unsigned int tabspaces = 8;
+/* bg opacity */
+unsigned int alpha = 0xcc;
+
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
@@ -109,6 +112,7 @@ static const char *colorname[] = {
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
+ "black",
};
@@ -117,7 +121,7 @@ static const char *colorname[] = {
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 7;
-unsigned int defaultbg = 0;
+unsigned int defaultbg = 257;
static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;

40
st/config.h Normal file → Executable file
View File

@ -83,35 +83,35 @@ char *termname = "st-256color";
unsigned int tabspaces = 8;
/* bg opacity */
unsigned int alpha = 0xef;
unsigned int alpha = 0xee;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"#1D2330",
"#645377",
"#AD69AF",
"#B1B5C8",
"#92969d",
"#645377",
"#AD69AF",
"#B1B5C8",
"#282A36",
"#FF5555",
"#50FA7B",
"#F1FA8C",
"#BD93F9",
"#FF79C6",
"#8BE9FD",
"#BFBFBF",
/* 8 bright colors */
"#4B5665",
"#84598D",
"#7B8290",
"#d1d7e1",
"#4B5665",
"#84598D",
"#7B8290",
"#d1d7e1",
"#4D4D4D",
"#FF6E67",
"#5AF78E",
"#F4F99D",
"#CAA9FA",
"#FF92D0",
"#9AEDFE",
"#E6E6E6",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#C0C5CE",
"#1D2330",
"#F8F8F2",
"#282A36",
};
/*
@ -178,8 +178,8 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ TERMMOD, XK_I, iso14755, {.i = 0} },
};
/*

23
st/config.mk Normal file → Executable file
View File

@ -1,5 +1,5 @@
# st version
VERSION = 0.8.1
VERSION = 0.8.2
# Customize below to fit your system
@ -10,19 +10,26 @@ MANPREFIX = $(PREFIX)/share/man
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
PKG_CONFIG = pkg-config
# includes and libs
INCS = -I. -I/usr/include -I${X11INC} \
`pkg-config --cflags fontconfig` \
`pkg-config --cflags freetype2`
`$(PKG_CONFIG) --cflags fontconfig` \
`$(PKG_CONFIG) --cflags freetype2`
LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft -lXrender\
`pkg-config --libs fontconfig` \
`pkg-config --libs freetype2`
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2`
# flags
CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS)
# OpenBSD:
#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
# `pkg-config --libs fontconfig` \
# `pkg-config --libs freetype2`
# compiler and linker
# CC = c99

View File

@ -1,28 +0,0 @@
# st version
VERSION = 0.8.1
# Customize below to fit your system
# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
# includes and libs
INCS = -I. -I/usr/include -I${X11INC} \
`pkg-config --cflags fontconfig` \
`pkg-config --cflags freetype2`
LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft -lXrender\
`pkg-config --libs fontconfig` \
`pkg-config --libs freetype2`
# flags
CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS)
# compiler and linker
# CC = c99

View File

@ -1,15 +0,0 @@
--- config.mk
+++ config.mk
@@ -11,10 +11,10 @@ X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
# includes and libs
-INCS = -I$(X11INC) \
+INCS = -I. -I/usr/include -I${X11INC} \
`pkg-config --cflags fontconfig` \
`pkg-config --cflags freetype2`
-LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
+LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft -lXrender\
`pkg-config --libs fontconfig` \
`pkg-config --libs freetype2`

0
st/st-alpha-20190116-3be4cf1.diff Normal file → Executable file
View File

4
st/st.1 Normal file → Executable file
View File

@ -159,10 +159,6 @@ Copy the selected text to the clipboard selection.
.TP
.B Ctrl-Shift-v
Paste from the clipboard selection.
.TP
.B Ctrl-Shift-i
Launch dmenu to enter a unicode codepoint and send the corresponding glyph
to st.
.SH CUSTOMIZATION
.B st
can be customized by creating a custom config.h and (re)compiling the source

68
st/st.c Normal file → Executable file
View File

@ -38,15 +38,11 @@
/* macros */
#define IS_SET(flag) ((term.mode & (flag)) != 0)
#define NUMMAXLEN(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177')
#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL)
/* constants */
#define ISO14755CMD "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null"
enum term_mode {
MODE_WRAP = 1 << 0,
MODE_INSERT = 1 << 1,
@ -256,10 +252,10 @@ xwrite(int fd, const char *s, size_t len)
void *
xmalloc(size_t len)
{
void *p = malloc(len);
void *p;
if (!p)
die("Out of memory\n");
if (!(p = malloc(len)))
die("malloc: %s\n", strerror(errno));
return p;
}
@ -268,7 +264,7 @@ void *
xrealloc(void *p, size_t len)
{
if ((p = realloc(p, len)) == NULL)
die("Out of memory\n");
die("realloc: %s\n", strerror(errno));
return p;
}
@ -277,7 +273,7 @@ char *
xstrdup(char *s)
{
if ((s = strdup(s)) == NULL)
die("Out of memory\n");
die("strdup: %s\n", strerror(errno));
return s;
}
@ -446,6 +442,7 @@ selstart(int col, int row, int snap)
selclear();
sel.mode = SEL_EMPTY;
sel.type = SEL_REGULAR;
sel.alt = IS_SET(MODE_ALTSCREEN);
sel.snap = snap;
sel.oe.x = sel.ob.x = col;
sel.oe.y = sel.ob.y = row;
@ -474,7 +471,6 @@ selextend(int col, int row, int type, int done)
oldsey = sel.ne.y;
oldtype = sel.type;
sel.alt = IS_SET(MODE_ALTSCREEN);
sel.oe.x = col;
sel.oe.y = row;
selnormalize();
@ -687,7 +683,7 @@ execsh(char *cmd, char **args)
errno = 0;
if ((pw = getpwuid(getuid())) == NULL) {
if (errno)
die("getpwuid:%s\n", strerror(errno));
die("getpwuid: %s\n", strerror(errno));
else
die("who are you?\n");
}
@ -730,13 +726,15 @@ sigchld(int a)
pid_t p;
if ((p = waitpid(pid, &stat, WNOHANG)) < 0)
die("Waiting for pid %hd failed: %s\n", pid, strerror(errno));
die("waiting for pid %hd failed: %s\n", pid, strerror(errno));
if (pid != p)
return;
if (!WIFEXITED(stat) || WEXITSTATUS(stat))
die("child finished with error '%d'\n", stat);
if (WIFEXITED(stat) && WEXITSTATUS(stat))
die("child exited with status %d\n", WEXITSTATUS(stat));
else if (WIFSIGNALED(stat))
die("child terminated due to signal %d\n", WTERMSIG(stat));
exit(0);
}
@ -781,7 +779,8 @@ ttynew(char *line, char *cmd, char *out, char **args)
if (line) {
if ((cmdfd = open(line, O_RDWR)) < 0)
die("open line failed: %s\n", strerror(errno));
die("open line '%s' failed: %s\n",
line, strerror(errno));
dup2(cmdfd, 0);
stty(args);
return cmdfd;
@ -793,7 +792,7 @@ ttynew(char *line, char *cmd, char *out, char **args)
switch (pid = fork()) {
case -1:
die("fork failed\n");
die("fork failed: %s\n", strerror(errno));
break;
case 0:
close(iofd);
@ -805,9 +804,17 @@ ttynew(char *line, char *cmd, char *out, char **args)
die("ioctl TIOCSCTTY failed: %s\n", strerror(errno));
close(s);
close(m);
#ifdef __OpenBSD__
if (pledge("stdio getpw proc exec", NULL) == -1)
die("pledge\n");
#endif
execsh(cmd, args);
break;
default:
#ifdef __OpenBSD__
if (pledge("stdio rpath tty proc", NULL) == -1)
die("pledge\n");
#endif
close(s);
cmdfd = m;
signal(SIGCHLD, sigchld);
@ -826,7 +833,7 @@ ttyread(void)
/* append read bytes to unprocessed bytes */
if ((ret = read(cmdfd, buf+buflen, LEN(buf)-buflen)) < 0)
die("Couldn't read from shell: %s\n", strerror(errno));
die("couldn't read from shell: %s\n", strerror(errno));
buflen += ret;
written = twrite(buf, buflen, 0);
@ -1447,7 +1454,8 @@ tsetattr(int *attr, int l)
} else {
fprintf(stderr,
"erresc(default): gfx attr %d unknown\n",
attr[i]), csidump();
attr[i]);
csidump();
}
break;
}
@ -1972,28 +1980,6 @@ tprinter(char *s, size_t len)
}
}
void
iso14755(const Arg *arg)
{
FILE *p;
char *us, *e, codepoint[9], uc[UTF_SIZ];
unsigned long utf32;
if (!(p = popen(ISO14755CMD, "r")))
return;
us = fgets(codepoint, sizeof(codepoint), p);
pclose(p);
if (!us || *us == '\0' || *us == '-' || strlen(us) > 7)
return;
if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX ||
(*e != '\n' && *e != '\0'))
return;
ttywrite(uc, utf8encode(utf32, uc), 1);
}
void
toggleprinter(const Arg *arg)
{
@ -2278,7 +2264,7 @@ eschandle(uchar ascii)
case 'Z': /* DECID -- Identify Terminal */
ttywrite(vtiden, strlen(vtiden), 0);
break;
case 'c': /* RIS -- Reset to inital state */
case 'c': /* RIS -- Reset to initial state */
treset();
resettitle();
xloadcols();

1
st/st.h Normal file → Executable file
View File

@ -80,7 +80,6 @@ void die(const char *, ...);
void redraw(void);
void draw(void);
void iso14755(const Arg *);
void printscreen(const Arg *);
void printsel(const Arg *);
void sendbreak(const Arg *);

View File

@ -1,124 +0,0 @@
/* See LICENSE for license details. */
#include <stdint.h>
#include <sys/types.h>
/* macros */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) < (b) ? (b) : (a))
#define LEN(a) (sizeof(a) / sizeof(a)[0])
#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d))
#define DEFAULT(a, b) (a) = (a) ? (a) : (b)
#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \
(a).bg != (b).bg)
#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \
(t1.tv_nsec-t2.tv_nsec)/1E6)
#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
#define IS_TRUECOL(x) (1 << 24 & (x))
enum glyph_attribute {
ATTR_NULL = 0,
ATTR_BOLD = 1 << 0,
ATTR_FAINT = 1 << 1,
ATTR_ITALIC = 1 << 2,
ATTR_UNDERLINE = 1 << 3,
ATTR_BLINK = 1 << 4,
ATTR_REVERSE = 1 << 5,
ATTR_INVISIBLE = 1 << 6,
ATTR_STRUCK = 1 << 7,
ATTR_WRAP = 1 << 8,
ATTR_WIDE = 1 << 9,
ATTR_WDUMMY = 1 << 10,
ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT,
};
enum selection_mode {
SEL_IDLE = 0,
SEL_EMPTY = 1,
SEL_READY = 2
};
enum selection_type {
SEL_REGULAR = 1,
SEL_RECTANGULAR = 2
};
enum selection_snap {
SNAP_WORD = 1,
SNAP_LINE = 2
};
typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef uint_least32_t Rune;
#define Glyph Glyph_
typedef struct {
Rune u; /* character code */
ushort mode; /* attribute flags */
uint32_t fg; /* foreground */
uint32_t bg; /* background */
} Glyph;
typedef Glyph *Line;
typedef union {
int i;
uint ui;
float f;
const void *v;
} Arg;
void die(const char *, ...);
void redraw(void);
void draw(void);
void iso14755(const Arg *);
void printscreen(const Arg *);
void printsel(const Arg *);
void sendbreak(const Arg *);
void toggleprinter(const Arg *);
int tattrset(int);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
void ttyhangup(void);
int ttynew(char *, char *, char *, char **);
size_t ttyread(void);
void ttyresize(int, int);
void ttywrite(const char *, size_t, int);
void resettitle(void);
void selclear(void);
void selinit(void);
void selstart(int, int, int);
void selextend(int, int, int, int);
int selected(int, int);
char *getsel(void);
size_t utf8encode(Rune, char *);
void *xmalloc(size_t);
void *xrealloc(void *, size_t);
char *xstrdup(char *);
/* config.h globals */
extern char *utmp;
extern char *stty_args;
extern char *vtiden;
extern char *worddelimiters;
extern int allowaltscreen;
extern char *termname;
extern unsigned int tabspaces;
extern unsigned int alpha;
extern unsigned int defaultfg;
extern unsigned int defaultbg;

View File

@ -1,9 +0,0 @@
--- st.h
+++ st.h
@@ -119,5 +119,6 @@ extern char *worddelimiters;
extern int allowaltscreen;
extern char *termname;
extern unsigned int tabspaces;
+extern unsigned int alpha;
extern unsigned int defaultfg;
extern unsigned int defaultbg;

0
st/st.info Normal file → Executable file
View File

View File

@ -1,6 +0,0 @@
while true; do
# Log stderror to a file
dwm 2> ~/.dwm.log
# No error logging
#dwm >/dev/null 2>&1
done

0
st/win.h Normal file → Executable file
View File

54
st/x.c Normal file → Executable file
View File

@ -677,6 +677,8 @@ cresize(int width, int height)
col = (win.w - 2 * borderpx) / win.cw;
row = (win.h - 2 * borderpx) / win.ch;
col = MAX(1, col);
row = MAX(1, row);
tresize(col, row);
xresize(col, row);
@ -686,8 +688,8 @@ cresize(int width, int height)
void
xresize(int col, int row)
{
win.tw = MAX(1, col * win.cw);
win.th = MAX(1, row * win.ch);
win.tw = col * win.cw;
win.th = row * win.ch;
XFreePixmap(xw.dpy, xw.buf);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
@ -736,27 +738,28 @@ xloadcols(void)
static int loaded;
Color *cp;
dc.collen = MAX(LEN(colorname), 256);
dc.col = xmalloc(dc.collen * sizeof(Color));
if (loaded) {
for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp)
XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);
} else {
dc.collen = MAX(LEN(colorname), 256);
dc.col = xmalloc(dc.collen * sizeof(Color));
}
for (i = 0; i < dc.collen; i++)
if (!xloadcolor(i, NULL, &dc.col[i])) {
if (colorname[i])
die("Could not allocate color '%s'\n", colorname[i]);
die("could not allocate color '%s'\n", colorname[i]);
else
die("Could not allocate color %d\n", i);
die("could not allocate color %d\n", i);
}
/* set alpha value of bg color */
if (USE_ARGB) {
dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE;
dc.col[defaultbg].pixel &= 0x00111111;
dc.col[defaultbg].pixel |= alpha << 24;
dc.col[defaultbg].color.alpha = alpha << 8;
dc.col[defaultbg].color.red = ((dc.col[defaultbg].color.red >> 8) * alpha / 255) << 8;
dc.col[defaultbg].color.green = ((dc.col[defaultbg].color.green >> 8) * alpha / 255) << 8;
dc.col[defaultbg].color.blue = ((dc.col[defaultbg].color.blue >> 8) * alpha / 255) << 8;
}
loaded = 1;
}
@ -811,15 +814,17 @@ xhints(void)
sizeh = XAllocSizeHints();
sizeh->flags = PSize | PResizeInc | PBaseSize;
sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize;
sizeh->height = win.h;
sizeh->width = win.w;
sizeh->height_inc = win.ch;
sizeh->width_inc = win.cw;
sizeh->base_height = 2 * borderpx;
sizeh->base_width = 2 * borderpx;
sizeh->min_height = win.ch + 2 * borderpx;
sizeh->min_width = win.cw + 2 * borderpx;
if (xw.isfixed) {
sizeh->flags |= PMaxSize | PMinSize;
sizeh->flags |= PMaxSize;
sizeh->min_width = sizeh->max_width = win.w;
sizeh->min_height = sizeh->max_height = win.h;
}
@ -892,7 +897,7 @@ xloadfont(Font *f, FcPattern *pattern)
if ((XftPatternGetInteger(f->match->pattern, "slant", 0,
&haveattr) != XftResultMatch) || haveattr < wantattr) {
f->badslant = 1;
fputs("st: font slant does not match\n", stderr);
fputs("font slant does not match\n", stderr);
}
}
@ -901,7 +906,7 @@ xloadfont(Font *f, FcPattern *pattern)
if ((XftPatternGetInteger(f->match->pattern, "weight", 0,
&haveattr) != XftResultMatch) || haveattr != wantattr) {
f->badweight = 1;
fputs("st: font weight does not match\n", stderr);
fputs("font weight does not match\n", stderr);
}
}
@ -929,14 +934,13 @@ xloadfonts(char *fontstr, double fontsize)
FcPattern *pattern;
double fontval;
if (fontstr[0] == '-') {
if (fontstr[0] == '-')
pattern = XftXlfdParse(fontstr, False, False);
} else {
else
pattern = FcNameParse((FcChar8 *)fontstr);
}
if (!pattern)
die("st: can't open font %s\n", fontstr);
die("can't open font %s\n", fontstr);
if (fontsize > 1) {
FcPatternDel(pattern, FC_PIXEL_SIZE);
@ -962,7 +966,7 @@ xloadfonts(char *fontstr, double fontsize)
}
if (xloadfont(&dc.font, pattern))
die("st: can't open font %s\n", fontstr);
die("can't open font %s\n", fontstr);
if (usedfontsize < 0) {
FcPatternGetDouble(dc.font.match->pattern,
@ -979,17 +983,17 @@ xloadfonts(char *fontstr, double fontsize)
FcPatternDel(pattern, FC_SLANT);
FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
if (xloadfont(&dc.ifont, pattern))
die("st: can't open font %s\n", fontstr);
die("can't open font %s\n", fontstr);
FcPatternDel(pattern, FC_WEIGHT);
FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
if (xloadfont(&dc.ibfont, pattern))
die("st: can't open font %s\n", fontstr);
die("can't open font %s\n", fontstr);
FcPatternDel(pattern, FC_SLANT);
FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
if (xloadfont(&dc.bfont, pattern))
die("st: can't open font %s\n", fontstr);
die("can't open font %s\n", fontstr);
FcPatternDestroy(pattern);
}
@ -1026,7 +1030,7 @@ xinit(int cols, int rows)
XColor xmousefg, xmousebg;
if (!(xw.dpy = XOpenDisplay(NULL)))
die("Can't open display\n");
die("can't open display\n");
xw.scr = XDefaultScreen(xw.dpy);
xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
if (!USE_ARGB)
@ -1065,7 +1069,7 @@ xinit(int cols, int rows)
/* font */
if (!FcInit())
die("Could not init fontconfig.\n");
die("could not init fontconfig.\n");
usedfont = (opt_font == NULL)? font : opt_font;
xloadfonts(usedfont, 0);
@ -1984,7 +1988,7 @@ main(int argc, char *argv[])
opt_embed = EARGF(usage());
break;
case 'v':
die("%s " VERSION " (c) 2010-2016 st engineers\n", argv0);
die("%s " VERSION "\n", argv0);
break;
default:
usage();

File diff suppressed because it is too large Load Diff

View File

@ -1,138 +0,0 @@
--- x.c
+++ x.c
@@ -48,6 +48,10 @@ typedef struct {
#define XK_NO_MOD 0
#define XK_SWITCH_MOD (1<<13)
+/* alpha */
+#define OPAQUE 0Xff
+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
+
/* function definitions used in config.h */
static void clipcopy(const Arg *);
static void clippaste(const Arg *);
@@ -98,6 +102,7 @@ typedef struct {
XSetWindowAttributes attrs;
int scr;
int isfixed; /* is fixed geometry? */
+ int depth; /* bit depth */
int l, t; /* left and top offset */
int gm; /* geometry mask */
} XWindow;
@@ -686,7 +691,7 @@ xresize(int col, int row)
XFreePixmap(xw.dpy, xw.buf);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
- DefaultDepth(xw.dpy, xw.scr));
+ xw.depth);
XftDrawChange(xw.draw, xw.buf);
xclear(0, 0, win.w, win.h);
@@ -746,6 +751,13 @@ xloadcols(void)
else
die("could not allocate color %d\n", i);
}
+
+ /* set alpha value of bg color */
+ if (USE_ARGB) {
+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE;
+ dc.col[defaultbg].pixel &= 0x00111111;
+ dc.col[defaultbg].pixel |= alpha << 24;
+ }
loaded = 1;
}
@@ -767,6 +779,17 @@ xsetcolorname(int x, const char *name)
return 0;
}
+void
+xtermclear(int col1, int row1, int col2, int row2)
+{
+ XftDrawRect(xw.draw,
+ &dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg],
+ borderpx + col1 * win.cw,
+ borderpx + row1 * win.ch,
+ (col2-col1+1) * win.cw,
+ (row2-row1+1) * win.ch);
+}
+
/*
* Absolute coordinates.
*/
@@ -1004,7 +1027,40 @@ xinit(int cols, int rows)
if (!(xw.dpy = XOpenDisplay(NULL)))
die("can't open display\n");
xw.scr = XDefaultScreen(xw.dpy);
- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
+ xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
+ if (!USE_ARGB)
+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
+ else {
+ XVisualInfo *vis;
+ XRenderPictFormat *fmt;
+ int nvi;
+ int i;
+
+ XVisualInfo tpl = {
+ .screen = xw.scr,
+ .depth = 32,
+ .class = TrueColor
+ };
+
+ vis = XGetVisualInfo(xw.dpy,
+ VisualScreenMask | VisualDepthMask | VisualClassMask,
+ &tpl, &nvi);
+ xw.vis = NULL;
+ for (i = 0; i < nvi; i++) {
+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
+ xw.vis = vis[i].visual;
+ break;
+ }
+ }
+
+ XFree(vis);
+
+ if (!xw.vis) {
+ fprintf(stderr, "Couldn't find ARGB visual.\n");
+ exit(1);
+ }
+ }
/* font */
if (!FcInit())
@@ -1014,7 +1070,11 @@ xinit(int cols, int rows)
xloadfonts(usedfont, 0);
/* colors */
- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
+ if (!USE_ARGB)
+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
+ else
+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr),
+ xw.vis, None);
xloadcols();
/* adjust fixed window geometry */
@@ -1037,16 +1097,15 @@ xinit(int cols, int rows)
if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
parent = XRootWindow(xw.dpy, xw.scr);
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
- win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
+ win.w, win.h, 0, xw.depth, InputOutput,
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
| CWEventMask | CWColormap, &xw.attrs);
memset(&gcvalues, 0, sizeof(gcvalues));
gcvalues.graphics_exposures = False;
- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
- &gcvalues);
- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
- DefaultDepth(xw.dpy, xw.scr));
+ xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth);
+ dc.gc = XCreateGC(xw.dpy, (USE_ARGB) ? xw.buf: parent,
+ GCGraphicsExposures, &gcvalues);
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);