This commit is contained in:
GasparVardanyan 2022-02-28 05:02:14 +04:00
parent d6ef43cc7b
commit 3ca4a36cf8
3 changed files with 109 additions and 21 deletions

47
settheme Executable file
View file

@ -0,0 +1,47 @@
#!/bin/sh
# Themes work with:
# dwm, st, dmenu, tabbed,
# xresources, wallpapers, vim,
# dunst, zsh (experimental), ls
[ -f ~/.local/share/themes/"$1".xdefaults ] || exit -1
cp ~/.local/share/themes/"$1".xdefaults ~/.local/etc/theme
if [ -f ~/.local/share/themes/"$1".dir_colors ]
then
cp ~/.local/share/themes/"$1".dir_colors ~/.local/etc/dir_colors
else
rm ~/.local/etc/dir_colors
fi
rm -rf ~/.local/share/themes/bin
[ -d ~/.local/share/themes/"$1"-bin ] && cp -r ~/.local/share/themes/{"$1"-,}bin
xrdb ~/.Xresources
echo -e "dwm\nst\ndmenu\ntabbed" |
while read t
do
(cd ~/.local/src/$t && make clean && ./xtheme && make PREFIX=$HOME/.local install ; make clean ; cd -)
done
cat ~/.local/share/themes/"$1".xdefaults | grep -P "^\wallpaper:\s*\S*$" -m 1 &&
feh --bg-fill ~/.local/share/themes/"$1"-wallpapers/$( \
cat ~/.local/share/themes/"$1".xdefaults \
| grep -P "^wallpaper:\s*\S*$" \
| sed "s/^.*:\s//" \
)*
(
killall dunst
cd ~/.config/dunst
./xtheme
cat theme.h dunstrc.template | cpp > dunstrc
cd -
)
dunstify "Theme Changed
restart dwm" -t 3000

View file

@ -90,7 +90,7 @@
*color15: S_base3
! gaspar's modifications
// gaspar's modifications
wallpaper: cubes
vim*colorscheme: solarized
@ -108,3 +108,44 @@ dwm*selbackground: #174956 # selenized dark bg1
! dwm*selborder: S_base02
! dwm*selborder: #0a4c5c # custom color
dwm*selborder: #174956 # selenized dark bg1
/*
=== VIM INTEGRATION ===
set background=dark
let themefile = system ("echo\ -n\ \$\(xrdb\ -query\ \|\ grep\ -P\ \'\^vim\\.\?\\\*\?colorscheme:\\s\*\\S+\'\ \|\ sed\ \'s/\\s\\+/\ /\'\ \|\ cut\ -d\ \'\ \'\ -f\ 2\)")
if themefile != ''
execute 'source ~/.local/share/themes/'.themefile.'.vim'
else
color leet2
endif
=== WALLPAPER INTEGRATION ===
cat ~/.local/share/themes/"$1".xdefaults | grep -P "^\wallpaper:\s*\S*$" -m 1 &&
feh --bg-fill ~/.local/share/themes/"$1"-wallpapers/$( \
cat ~/.local/share/themes/"$1".xdefaults \
| grep -P "^wallpaper:\s*\S*$" \
| sed "s/^.*:\s//" \
)*
=== MAN INTEGRATION ===
export PATH="$HOME/.local/share/themes/bin:$HOME/.local/bin:$PATH"
=== DWM, ST INTEGRATION ===
via xtheme patches
*/
// https://ethanschoonover.com/solarized/
// https://observer.com/2015/02/meet-the-man-behind-solarized-the-most-important-color-scheme-in-computer-history/
// https://www.wired.com/story/very-mathematical-history-perfect-color-combination/

View file

@ -19,9 +19,9 @@
" ---------------------------------------------------------------------
" OPTIONS:
" ---------------------------------------------------------------------
" See the "solarized.txt" help file included with this colorscheme (in the
" "doc" subdirectory) for information on options, usage, the Toggle Background
" function and more. If you have already installed Solarized, this is available
" See the "solarized.txt" help file included with this colorscheme (in the
" "doc" subdirectory) for information on options, usage, the Toggle Background
" function and more. If you have already installed Solarized, this is available
" from the Solarized menu and command line as ":help solarized"
"
" ---------------------------------------------------------------------
@ -36,7 +36,7 @@
" and unarchive the file.
" 2. Move `solarized.vim` to your `.vim/colors` directory.
" 3. Move each of the files in each subdirectories to the corresponding .vim
" subdirectory (e.g. autoload/togglebg.vim goes into your .vim/autoload
" subdirectory (e.g. autoload/togglebg.vim goes into your .vim/autoload
" directory as .vim/autoload/togglebg.vim).
"
" RECOMMENDED PATHOGEN INSTALLATION OPTION:
@ -131,7 +131,7 @@
"
" }}}
" Environment Specific Overrides "{{{
" Allow or disallow certain features based on current terminal emulator or
" Allow or disallow certain features based on current terminal emulator or
" environment.
" Terminals that support italics
@ -159,8 +159,8 @@ endif
" }}}
" Default option values"{{{
" ---------------------------------------------------------------------
" s:options_list is used to autogenerate a list of all non-default options
" using "call SolarizedOptions()" or with the "Generate .vimrc commands"
" s:options_list is used to autogenerate a list of all non-default options
" using "call SolarizedOptions()" or with the "Generate .vimrc commands"
" Solarized menu option. See the "Menus" section below for the function itself.
let s:options_list=[
\'" this block of commands has been autogenerated by solarized.vim and',
@ -484,8 +484,8 @@ exe "let s:fmt_ital = ' ".s:vmode."=NONE".s:i. " term=NONE".s:i."'"
exe "let s:fmt_stnd = ' ".s:vmode."=NONE".s:s. " term=NONE".s:s."'"
exe "let s:fmt_revr = ' ".s:vmode."=NONE".s:r. " term=NONE".s:r."'"
exe "let s:fmt_revb = ' ".s:vmode."=NONE".s:r.s:b. " term=NONE".s:r.s:b."'"
" revbb (reverse bold for bright colors) is only set to actual bold in low
" color terminals (t_co=8, such as OS X Terminal.app) and should only be used
" revbb (reverse bold for bright colors) is only set to actual bold in low
" color terminals (t_co=8, such as OS X Terminal.app) and should only be used
" with colors 8-15.
exe "let s:fmt_revbb = ' ".s:vmode."=NONE".s:r.s:bb. " term=NONE".s:r.s:bb."'"
exe "let s:fmt_revbbu = ' ".s:vmode."=NONE".s:r.s:bb.s:u." term=NONE".s:r.s:bb.s:u."'"
@ -729,7 +729,7 @@ hi! link diffLine Identifier
"exe "hi! gitDiffAdded"
"exe "hi! gitDiffRemoved"
"gitcommit
"exe "hi! gitcommitSummary"
"exe "hi! gitcommitSummary"
exe "hi! gitcommitComment" .s:fmt_ital .s:fg_base01 .s:bg_none
hi! link gitcommitUntracked gitcommitComment
hi! link gitcommitDiscarded gitcommitComment
@ -972,19 +972,19 @@ hi! link pandocMetadataTitle pandocMetadata
"}}}
" Utility autocommand "{{{
" ---------------------------------------------------------------------
" In cases where Solarized is initialized inside a terminal vim session and
" then transferred to a gui session via the command `:gui`, the gui vim process
" does not re-read the colorscheme (or .vimrc for that matter) so any `has_gui`
" In cases where Solarized is initialized inside a terminal vim session and
" then transferred to a gui session via the command `:gui`, the gui vim process
" does not re-read the colorscheme (or .vimrc for that matter) so any `has_gui`
" related code that sets gui specific values isn't executed.
"
" Currently, Solarized sets only the cterm or gui values for the colorscheme
" depending on gui or terminal mode. It's possible that, if the following
" autocommand method is deemed excessively poor form, that approach will be
" Currently, Solarized sets only the cterm or gui values for the colorscheme
" depending on gui or terminal mode. It's possible that, if the following
" autocommand method is deemed excessively poor form, that approach will be
" used again and the autocommand below will be dropped.
"
" However it seems relatively benign in this case to include the autocommand
" here. It fires only in cases where vim is transferring from terminal to gui
" mode (detected with the script scope s:vmode variable). It also allows for
" However it seems relatively benign in this case to include the autocommand
" here. It fires only in cases where vim is transferring from terminal to gui
" mode (detected with the script scope s:vmode variable). It also allows for
" other potential terminal customizations that might make gui mode suboptimal.
"
autocmd GUIEnter * if (s:vmode != "gui") | exe "colorscheme " . g:colors_name | endif
@ -998,7 +998,7 @@ function! s:SolarizedHiTrail()
syn match solarizedTrailingSpace "\s*$"
exe "hi! solarizedTrailingSpace " .s:fmt_undr .s:fg_red .s:bg_none .s:sp_red
endif
endfunction
endfunction
augroup SolarizedHiTrail
autocmd!
if g:solarized_hitrail==1