Skip to content

Commit

Permalink
kde
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitinspace committed Jul 30, 2020
1 parent dc412f9 commit cd4df45
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 156 deletions.
31 changes: 7 additions & 24 deletions bootstrap/cfg.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ set ROOT (type -q git && git rev-parse --show-toplevel 2>/dev/null || pwd)

# Sets up X configuration.
function cfg_x
# link startup configuration
set links .xinitrc .Xmodmap .Xresources
for link in $links
ln -sf $ROOT/resources/$link $HOME/$link || return 1
end

# link X configuration
sudo mkdir -p /etc/X11/xorg.conf.d/ || return 1
set confs 20-amdgpu.conf 40-fonts.conf
Expand All @@ -20,14 +14,14 @@ function cfg_x
end
end

# Configures elogind to allow rootless X.
#
# This won't enable rootless X because xorg-server package
# should be built from sources with elogind support:
# ./xbps-src pkg xorg-server -o elogind
function cfg_rootlessx
# Configures additional system services.
function cfg_services
sudo ln -s /etc/sv/dbus /var/service/
sudo ln -s /etc/sv/elogind /var/service/
sudo ln -s /etc/sv/NetworkManager /var/service/
sudo ln -s /etc/sv/sddm /var/service/

sudo rm /var/service/dhcpcd
end

# Sets up user's configuration.
Expand Down Expand Up @@ -60,16 +54,6 @@ function cfg_wal
wal --theme horizon
end

# Installs cursor theme.
function cfg_cursors
if test -d $HOME/.icons
rm -rf $HOME/.icons
end

mkdir -p $HOME/.icons || return 1
unzip -q $ROOT/resources/capitaine-cursors-light.zip -d $HOME/.icons || return 1
end

# Installs fonts from resources.
function cfg_fonts
set -l path /usr/share/fonts/JetBrainsMono
Expand All @@ -89,9 +73,8 @@ end
# Configures everything.
function main
cfg_x || return 1
cfg_rootlessx || return 1
cfg_services || return 1
cfg_configs || return 1
cfg_cursors || return 1
cfg_fonts || return 1
cfg_wal || return 1
end
Expand Down
49 changes: 13 additions & 36 deletions bootstrap/deps.fish
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,34 @@ end
function install_xorg
pkg_install \
xorg-minimal \
xrdb \
xmodmap \
xrandr \
xsetroot \
xf86-video-amdgpu \
xf86-input-libinput \
noto-fonts-ttf \
noto-fonts-ttf-extra \
noto-fonts-cjk \
noto-fonts-emoji \
font-awesome5 \
mesa \
mesa-vdpau
end

# Installs elogind and dbus with elogind support.
function install_rootlessx
function install_de
pkg_install \
kde5 \
kde5-baseapps \
elogind \
dbus-elogind
dbus-elogind \
NetworkManager
end

# Installs packages required for graphical session.
function install_wm
pkg_install \
bspwm \
picom \
sxhkd
end

# Installs packages to make graphical session more useful.
function install_wm_util
pkg_install \
dunst \
polybar \
rofi \
tdrop
end

# Installs terminal and related packages.
function install_term
# Installs fish shell and related packages.
function install_shell
pkg_install \
fish-shell \
kitty \
pywal
python3 \
python3-pip

sudo pip install pywal
end

# Installs developer related tools.
Expand All @@ -75,9 +58,6 @@ end
# Installs media related packages.
function install_media
pkg_install \
feh \
mpv \
zathura \
alsa-utils \
apulse \
alsa-plugins-pulseaudio \
Expand All @@ -87,7 +67,6 @@ end
# Installs text editors.
function install_editors
pkg_install \
emacs-x11 \
neovim
end

Expand All @@ -104,10 +83,8 @@ end
# Installs everything.
function main
install_xorg && \
install_rootlessx \
install_wm && \
install_wm_util && \
install_term && \
install_de \
install_shell && \
install_dev && \
install_media && \
install_editors && \
Expand Down
108 changes: 59 additions & 49 deletions config/fontconfig/fonts.conf
Original file line number Diff line number Diff line change
@@ -1,61 +1,71 @@
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!--
<!--
Accept deprecated 'mono' alias, replacing it with 'monospace'
-->
<match target="pattern">
<test qual="any" name="family"><string>mono</string></test>
<edit name="family" mode="assign"><string>monospace</string></edit>
</match>

<!--
<match target="pattern">
<test qual="any" name="family">
<string>mono</string>
</test>
<edit name="family" mode="assign">
<string>monospace</string>
</edit>
</match>
<!--
Names not including any well known alias are given 'sans-serif'
-->
<match target="pattern">
<test qual="all" name="family" compare="not_eq"><string>sans-serif</string></test>
<test qual="all" name="family" compare="not_eq"><string>serif</string></test>
<test qual="all" name="family" compare="not_eq"><string>monospace</string></test>
<edit name="family" mode="append_last"><string>sans-serif</string></edit>
</match>

<!--
<match target="pattern">
<test qual="all" name="family" compare="not_eq">
<string>sans-serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>monospace</string>
</test>
<edit name="family" mode="append_last">
<string>sans-serif</string>
</edit>
</match>
<!--
Default Japanese font
-->
<match>
<test compare="contains" name="lang">
<string>ja</string>
</test>
<edit mode="prepend" name="family">
<string>Noto Sans CJK JP</string>
</edit>
</match>

<!--
<match>
<test name="lang" compare="contains">
<string>ja</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans CJK JP</string>
</edit>
</match>
<!--
Default font
-->
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
</prefer>
</alias>
<alias>
<family>sans</family>
<prefer>
<family>Noto Sans</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
</prefer>
</alias>
<alias>
<family>sans</family>
<prefer>
<family>Noto Sans</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono</family>
</prefer>
</alias>
<dir>~/.fonts</dir>
</fontconfig>
36 changes: 24 additions & 12 deletions config/nvim/autoload/plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function! s:define_commands()
endif
if has('win32')
\ && &shellslash
\ && (&shell =~# 'cmd\.exe' || &shell =~# 'powershell\.exe')
\ && (&shell =~# 'cmd\(\.exe\)\?$' || &shell =~# 'powershell\(\.exe\)\?$')
return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.')
endif
if !has('nvim')
Expand Down Expand Up @@ -419,7 +419,7 @@ if s:is_win
let batchfile = s:plug_tempname().'.bat'
call writefile(s:wrap_cmds(a:cmd), batchfile)
let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0})
if &shell =~# 'powershell\.exe'
if &shell =~# 'powershell\(\.exe\)\?$'
let cmd = '& ' . cmd
endif
return [batchfile, cmd]
Expand Down Expand Up @@ -890,9 +890,9 @@ function! s:chsh(swap)
set shell=sh
endif
if a:swap
if &shell =~# 'powershell\.exe' || &shell =~# 'pwsh$'
if &shell =~# 'powershell\(\.exe\)\?$' || &shell =~# 'pwsh$'
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s'
elseif &shell =~# 'sh' || &shell =~# 'cmd\.exe'
elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$'
set shellredir=>%s\ 2>&1
endif
endif
Expand Down Expand Up @@ -2128,9 +2128,9 @@ function! plug#shellescape(arg, ...)
let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {}
let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh')
let script = get(opts, 'script', 1)
if shell =~# 'cmd\.exe'
if shell =~# 'cmd\(\.exe\)\?$'
return s:shellesc_cmd(a:arg, script)
elseif shell =~# 'powershell\.exe' || shell =~# 'pwsh$'
elseif shell =~# 'powershell\(\.exe\)\?$' || shell =~# 'pwsh$'
return s:shellesc_ps1(a:arg)
endif
return s:shellesc_sh(a:arg)
Expand Down Expand Up @@ -2182,7 +2182,7 @@ function! s:system(cmd, ...)
return system(a:cmd)
endif
let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})'))
if &shell =~# 'powershell\.exe'
if &shell =~# 'powershell\(\.exe\)\?$'
let cmd = '& ' . cmd
endif
else
Expand Down Expand Up @@ -2271,7 +2271,7 @@ endfunction

function! s:rm_rf(dir)
if isdirectory(a:dir)
call s:system(s:is_win
return s:system(s:is_win
\ ? 'rmdir /S /Q '.plug#shellescape(a:dir)
\ : ['rm', '-rf', a:dir])
endif
Expand Down Expand Up @@ -2355,6 +2355,7 @@ endfunction
function! s:delete(range, force)
let [l1, l2] = a:range
let force = a:force
let err_count = 0
while l1 <= l2
let line = getline(l1)
if line =~ '^- ' && isdirectory(line[2:])
Expand All @@ -2363,11 +2364,22 @@ function! s:delete(range, force)
let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1)
let force = force || answer > 1
if answer
call s:rm_rf(line[2:])
let err = s:rm_rf(line[2:])
setlocal modifiable
call setline(l1, '~'.line[1:])
let s:clean_count += 1
call setline(4, printf('Removed %d directories.', s:clean_count))
if empty(err)
call setline(l1, '~'.line[1:])
let s:clean_count += 1
else
delete _
call append(l1 - 1, s:format_message('x', line[1:], err))
let l2 += len(s:lines(err))
let err_count += 1
endif
let msg = printf('Removed %d directories.', s:clean_count)
if err_count > 0
let msg .= printf(' Failed to remove %d directories.', err_count)
endif
call setline(4, msg)
setlocal nomodifiable
endif
endif
Expand Down
Loading

0 comments on commit cd4df45

Please sign in to comment.