diff --git a/mocp/.moc/config b/mocp/.moc/config index cfaedcb..d9e42f3 100644 --- a/mocp/.moc/config +++ b/mocp/.moc/config @@ -1 +1,2 @@ Theme = archwiki +SoundDriver = PULSEAUDIO:JACK:ALSA:OSS diff --git a/mocp/.moc/last_directory b/mocp/.moc/last_directory index 5898c05..92f726e 100644 --- a/mocp/.moc/last_directory +++ b/mocp/.moc/last_directory @@ -1 +1 @@ -/home/sakhmatd/mnt/atom/Music/New \ No newline at end of file +/home/sakhmatd/Music/Rance_III/MID/Unison/WAV \ No newline at end of file diff --git a/pkglist.x86_64.txt b/pkglist.x86_64.txt new file mode 100644 index 0000000..733bf84 --- /dev/null +++ b/pkglist.x86_64.txt @@ -0,0 +1 @@ +acl alsa-lib alsa-topology-conf alsa-ucm-conf alsa-utils amd-ucode arch-install-scripts archinstall archlinux-keyring attr audit b43-fwcutter base bash bc bcachefs-tools bind binutils bluez-libs bolt brltty broadcom-wl brotli btrfs-progs bzip2 ca-certificates ca-certificates-mozilla ca-certificates-utils ccid cifs-utils clonezilla cloud-init coreutils cryptsetup curl darkhttpd db5.3 dbus dbus-broker dbus-broker-units dbus-units ddrescue device-mapper dhcpcd diffutils ding-libs dmidecode dmraid dnsmasq dnssec-anchors dosfstools drbl duktape e2fsprogs ecryptfs-utils edk2-shell efibootmgr efivar ell espeak-ng espeakup ethtool exfatprogs expat f2fs-tools fatresize file filesystem findutils flac flex foot-terminfo fsarchiver fuse-common fuse2 fuse3 gawk gcc-libs gdbm gettext glib2 glibc gmp gnulib-l10n gnupg gnutls gpart gpgme gpm gptfdisk grep grml-zsh-config groff grub gssproxy gzip hdparm hicolor-icon-theme hidapi hwdata hyperv iana-etc icu intel-ucode iproute2 iptables iputils irssi iw iwd jansson jemalloc jfsutils json-c kbd keyutils kitty-terminfo kmod krb5 lame lbzip2 ldns leancrypto less lftp libaio libarchive libassuan libasyncns libbpf libbsd libcap libcap-ng libcbor libdnet libedit libelf libevent libffi libfido2 libgcrypt libgpg-error libgudev libice libidn2 libimobiledevice libimobiledevice-glue libinih libjpeg-turbo libksba libldap liblouis libmaxminddb libmbim libmd libmm-glib libmnl libmspack libnetfilter_conntrack libnewt libnfnetlink libnftnl libnghttp2 libnghttp3 libnl libnsl libnvme libogg libotr libp11-kit libpcap libpipeline libplist libproxy libpsl libpulse libqmi libqrtr-glib libsamplerate libsasl libseccomp libsecret libsigc++ libsm libsndfile libsodium libsonic libspeechd libssh2 libsysprof-capture libtasn1 libtatsu libtirpc libtool libunistring liburcu liburing libusb libusb-compat libusbmuxd libutempter libuv libverto libvorbis libwbclient libx11 libxau libxcb libxcrypt libxdmcp libxext libxml2 libxmu libxslt libxss libxt libyaml licenses linux linux-api-headers linux-atm linux-firmware linux-firmware-amdgpu linux-firmware-atheros linux-firmware-broadcom linux-firmware-cirrus linux-firmware-intel linux-firmware-marvell linux-firmware-mediatek linux-firmware-nvidia linux-firmware-other linux-firmware-radeon linux-firmware-realtek linux-firmware-whence livecd-sounds lmdb lrzip lsb-release lsscsi lua lvm2 lynx lz4 lzo lzop m4 man-db man-pages mc mdadm memtest86+ memtest86+-efi mkinitcpio mkinitcpio-archiso mkinitcpio-busybox mkinitcpio-nfs-utils mmc-utils mobile-broadband-provider-info modemmanager mpdecimal mpfr mpg123 mtools nano nbd ncurses ndisc6 net-tools nettle nfs-utils nfsidmap nftables nilfs-utils nmap npth nspr nss ntfs-3g numactl nvme-cli oath-toolkit open-iscsi open-isns open-vm-tools openbsd-netcat openconnect openpgp-card-tools openssh openssl openvpn opus p11-kit pacman pacman-mirrorlist pam pambase partclone parted partimage pbzip2 pcaudiolib pciutils pcre pcre2 pcsclite perl pigz pinentry pixz pkcs11-helper polkit popt ppp pptpclient procps-ng psmisc pv python python-annotated-types python-attrs python-cffi python-charset-normalizer python-configobj python-cryptography python-idna python-jinja python-jsonpatch python-jsonpointer python-jsonschema python-jsonschema-specifications python-markdown-it-py python-markupsafe python-mdurl python-netifaces python-oauthlib python-platformdirs python-pycparser python-pydantic python-pydantic-core python-pygments python-pyparted python-pyserial python-referencing python-requests python-rich python-rpds-py python-textual python-typing-inspection python-typing_extensions python-urllib3 python-yaml qemu-guest-agent readline refind reflector rpcbind rsync rxvt-unicode-terminfo screen sdparm sed sequoia-sq sg3_utils shadow slang smartmontools sof-firmware sqlite squashfs-tools sshfs stoken sudo sysfsutils syslinux systemd systemd-libs systemd-resolvconf systemd-sysvcompat talloc tar tcl tcpdump terminus-font testdisk thin-provisioning-tools tmux tpm2-tools tpm2-tss tzdata udftools uriparser usb_modeswitch usbmuxd usbutils util-linux util-linux-libs vim vim-runtime virtualbox-guest-utils-nox vpnc which wireless-regdb wireless_tools wpa_supplicant wvdial wvstreams xcb-proto xdg-utils xfsprogs xl2tpd xmlsec xorg-xprop xorg-xset xorgproto xxhash xz zlib zsh zstd diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index a6a4349..11d62ef 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -23,10 +23,14 @@ bind -n M-Down select-pane -D set -g status-justify left set -g status-fg white -set -g status-bg blue +#set -g status-bg blue +set -g status-bg colour73 set -g status-interval 2 # Vim stuff set-option -sg escape-time 10 set-option -g default-terminal "screen-256color" set-option -sa terminal-overrides ',xterm-256color:RGB' + +# Update these variables when attaching to a session +set-option -g update-environment "DISPLAY WAYLAND_DISPLAY SWAYSOCK HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP" diff --git a/vimplugins/.vim/autoload/plug.vim b/vimplugins/.vim/autoload/plug.vim index bfafbfb..bc02f03 100644 --- a/vimplugins/.vim/autoload/plug.vim +++ b/vimplugins/.vim/autoload/plug.vim @@ -99,7 +99,13 @@ let s:mac_gui = has('gui_macvim') && has('gui_running') let s:is_win = has('win32') let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) let s:vim8 = has('patch-8.0.0039') && exists('*job_start') -let s:me = resolve(expand(':p')) +if s:is_win && &shellslash + set noshellslash + let s:me = resolve(expand(':p')) + set shellslash +else + let s:me = resolve(expand(':p')) +endif let s:base_spec = { 'branch': 'master', 'frozen': 0 } let s:TYPE = { \ 'string': type(''), @@ -110,10 +116,42 @@ let s:TYPE = { let s:loaded = get(s:, 'loaded', {}) let s:triggers = get(s:, 'triggers', {}) +if s:is_win + function! s:plug_call(fn, ...) + let shellslash = &shellslash + try + set noshellslash + return call(a:fn, a:000) + finally + let &shellslash = shellslash + endtry + endfunction +else + function! s:plug_call(fn, ...) + return call(a:fn, a:000) + endfunction +endif + +function! s:plug_getcwd() + return s:plug_call('getcwd') +endfunction + +function! s:plug_fnamemodify(fname, mods) + return s:plug_call('fnamemodify', a:fname, a:mods) +endfunction + +function! s:plug_expand(fmt) + return s:plug_call('expand', a:fmt, 1) +endfunction + +function! s:plug_tempname() + return s:plug_call('tempname') +endfunction + function! plug#begin(...) if a:0 > 0 let s:plug_home_org = a:1 - let home = s:path(fnamemodify(expand(a:1), ':p')) + let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) elseif exists('g:plug_home') let home = s:path(g:plug_home) elseif !empty(&rtp) @@ -121,7 +159,7 @@ function! plug#begin(...) else return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') endif - if fnamemodify(home, ':t') ==# 'plugin' && fnamemodify(home, ':h') ==# s:first_rtp + if s:plug_fnamemodify(home, ':t') ==# 'plugin' && s:plug_fnamemodify(home, ':h') ==# s:first_rtp return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') endif @@ -139,6 +177,16 @@ function! s:define_commands() if !executable('git') return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') endif + if has('win32') + \ && &shellslash + \ && (&shell =~# 'cmd\.exe' || &shell =~# 'powershell\.exe') + return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') + endif + if !has('nvim') + \ && (has('win32') || has('win32unix')) + \ && !has('multi_byte') + return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.') + endif command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(0, []) command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(0, []) command! -nargs=0 -bar -bang PlugClean call s:clean(0) @@ -203,7 +251,7 @@ endfunction function! plug#end() if !exists('g:plugs') - return s:err('Call plug#begin() first') + return s:err('plug#end() called without calling plug#begin() first') endif if exists('#PlugLOD') @@ -324,7 +372,7 @@ endfunction function! s:git_version_requirement(...) if !exists('s:git_version') - let s:git_version = map(split(split(s:system('git --version'))[2], '\.'), 'str2nr(v:val)') + let s:git_version = map(split(split(s:system(['git', '--version']))[2], '\.'), 'str2nr(v:val)') endif return s:version_requirement(s:git_version, a:000) endfunction @@ -334,11 +382,11 @@ function! s:progress_opt(base) \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' endfunction -if s:is_win - function! s:rtp(spec) - return s:path(a:spec.dir . get(a:spec, 'rtp', '')) - endfunction +function! s:rtp(spec) + return s:path(a:spec.dir . get(a:spec, 'rtp', '')) +endfunction +if s:is_win function! s:path(path) return s:trim(substitute(a:path, '/', '\', 'g')) endfunction @@ -350,11 +398,33 @@ if s:is_win function! s:is_local_plug(repo) return a:repo =~? '^[a-z]:\|^[%~]' endfunction -else - function! s:rtp(spec) - return s:dirpath(a:spec.dir . get(a:spec, 'rtp', '')) + + " Copied from fzf + function! s:wrap_cmds(cmds) + let cmds = [ + \ '@echo off', + \ 'setlocal enabledelayedexpansion'] + \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) + \ + ['endlocal'] + if has('iconv') + if !exists('s:codepage') + let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) + endif + return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage)) + endif + return map(cmds, 'v:val."\r"') endfunction + function! s:batchfile(cmd) + 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' + let cmd = '& ' . cmd + endif + return [batchfile, cmd] + endfunction +else function! s:path(path) return s:trim(a:path) endfunction @@ -554,7 +624,7 @@ function! plug#(repo, ...) try let repo = s:trim(a:repo) let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec - let name = get(opts, 'as', fnamemodify(repo, ':t:s?\.git$??')) + let name = get(opts, 'as', s:plug_fnamemodify(repo, ':t:s?\.git$??')) let spec = extend(s:infer_properties(name, repo), opts) if !has_key(g:plugs, name) call add(g:plugs_order, name) @@ -574,7 +644,7 @@ function! s:parse_options(arg) elseif type == s:TYPE.dict call extend(opts, a:arg) if has_key(opts, 'dir') - let opts.dir = s:dirpath(expand(opts.dir)) + let opts.dir = s:dirpath(s:plug_expand(opts.dir)) endif else throw 'Invalid argument type (expected: string or dictionary)' @@ -585,7 +655,7 @@ endfunction function! s:infer_properties(name, repo) let repo = a:repo if s:is_local_plug(repo) - return { 'dir': s:dirpath(expand(repo)) } + return { 'dir': s:dirpath(s:plug_expand(repo)) } else if repo =~ ':' let uri = repo @@ -738,7 +808,7 @@ function! s:finish_bindings() endfunction function! s:prepare(...) - if empty(getcwd()) + if empty(s:plug_getcwd()) throw 'Invalid current working directory. Cannot proceed.' endif @@ -794,31 +864,35 @@ endfunction function! s:chsh(swap) let prev = [&shell, &shellcmdflag, &shellredir] - if s:is_win - set shell=cmd.exe shellcmdflag=/c shellredir=>%s\ 2>&1 - elseif a:swap - set shell=sh shellredir=>%s\ 2>&1 + if !s:is_win + set shell=sh + endif + if a:swap + if &shell =~# 'powershell\.exe' || &shell =~# 'pwsh$' + let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s' + elseif &shell =~# 'sh' || &shell =~# 'cmd\.exe' + set shellredir=>%s\ 2>&1 + endif endif return prev endfunction function! s:bang(cmd, ...) + let batchfile = '' try let [sh, shellcmdflag, shrd] = s:chsh(a:0) " FIXME: Escaping is incomplete. We could use shellescape with eval, " but it won't work on Windows. let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd if s:is_win - let batchfile = tempname().'.bat' - call writefile(["@echo off\r", cmd . "\r"], batchfile) - let cmd = s:shellesc(batchfile) + let [batchfile, cmd] = s:batchfile(cmd) endif let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') execute "normal! :execute g:_plug_bang\\" finally unlet g:_plug_bang let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win + if s:is_win && filereadable(batchfile) call delete(batchfile) endif endtry @@ -831,7 +905,7 @@ function! s:regress_bar() endfunction function! s:is_updated(dir) - return !empty(s:system_chomp('git log --pretty=format:"%h" "HEAD...HEAD@{1}"', a:dir)) + return !empty(s:system_chomp(['git', 'log', '--pretty=format:%h', 'HEAD...HEAD@{1}'], a:dir)) endfunction function! s:do(pull, force, todo) @@ -894,10 +968,10 @@ endfunction function! s:checkout(spec) let sha = a:spec.commit - let output = s:system('git rev-parse HEAD', a:spec.dir) + let output = s:system(['git', 'rev-parse', 'HEAD'], a:spec.dir) if !v:shell_error && !s:hash_match(sha, s:lines(output)[0]) let output = s:system( - \ 'git fetch --depth 999999 && git checkout '.s:esc(sha).' --', a:spec.dir) + \ 'git fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) endif return output endfunction @@ -1012,11 +1086,16 @@ function! s:update_impl(pull, force, args) abort normal! 2G silent! redraw - let s:clone_opt = get(g:, 'plug_shallow', 1) ? - \ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : '' + let s:clone_opt = [] + if get(g:, 'plug_shallow', 1) + call extend(s:clone_opt, ['--depth', '1']) + if s:git_version_requirement(1, 7, 10) + call add(s:clone_opt, '--no-single-branch') + endif + endif - if has('win32unix') - let s:clone_opt .= ' -c core.eol=lf -c core.autocrlf=input' + if has('win32unix') || has('wsl') + call extend(s:clone_opt, ['-c', 'core.eol=lf', '-c', 'core.autocrlf=input']) endif let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' @@ -1094,7 +1173,7 @@ function! s:update_finish() elseif has_key(spec, 'tag') let tag = spec.tag if tag =~ '\*' - let tags = s:lines(s:system('git tag --list '.s:shellesc(tag).' --sort -version:refname 2>&1', spec.dir)) + let tags = s:lines(s:system('git tag --list '.plug#shellescape(tag).' --sort -version:refname 2>&1', spec.dir)) if !v:shell_error && !empty(tags) let tag = tags[0] call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) @@ -1102,12 +1181,12 @@ function! s:update_finish() endif endif call s:log4(name, 'Checking out '.tag) - let out = s:system('git checkout -q '.s:esc(tag).' -- 2>&1', spec.dir) + let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir) else - let branch = s:esc(get(spec, 'branch', 'master')) - call s:log4(name, 'Merging origin/'.branch) - let out = s:system('git checkout -q '.branch.' -- 2>&1' - \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only origin/'.branch.' 2>&1')), spec.dir) + let branch = get(spec, 'branch', 'master') + call s:log4(name, 'Merging origin/'.s:esc(branch)) + let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1' + \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir) endif if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) @@ -1151,7 +1230,7 @@ function! s:job_abort() silent! call job_stop(j.jobid) endif if j.new - call s:system('rm -rf ' . s:shellesc(g:plugs[name].dir)) + call s:rm_rf(g:plugs[name].dir) endif endfor let s:jobs = {} @@ -1197,29 +1276,27 @@ function! s:job_cb(fn, job, ch, data) endfunction function! s:nvim_cb(job_id, data, event) dict abort - return a:event == 'stdout' ? + return (a:event == 'stdout' || a:event == 'stderr') ? \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : \ s:job_cb('s:job_exit_cb', self, 0, a:data) endfunction function! s:spawn(name, cmd, opts) let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], - \ 'batchfile': (s:is_win && (s:nvim || s:vim8)) ? tempname().'.bat' : '', \ 'new': get(a:opts, 'new', 0) } let s:jobs[a:name] = job - let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd - if !empty(job.batchfile) - call writefile(["@echo off\r", cmd . "\r"], job.batchfile) - let cmd = s:shellesc(job.batchfile) - endif - let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], cmd) if s:nvim + if has_key(a:opts, 'dir') + let job.cwd = a:opts.dir + endif + let argv = a:cmd call extend(job, { \ 'on_stdout': function('s:nvim_cb'), + \ 'on_stderr': function('s:nvim_cb'), \ 'on_exit': function('s:nvim_cb'), \ }) - let jid = jobstart(argv, job) + let jid = s:plug_call('jobstart', argv, job) if jid > 0 let job.jobid = jid else @@ -1229,9 +1306,16 @@ function! s:spawn(name, cmd, opts) \ 'Invalid arguments (or job table is full)'] endif elseif s:vim8 + let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"script": 0})')) + if has_key(a:opts, 'dir') + let cmd = s:with_cd(cmd, a:opts.dir, 0) + endif + let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] let jid = job_start(s:is_win ? join(argv, ' ') : argv, { \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), + \ 'err_cb': function('s:job_cb', ['s:job_out_cb', job]), \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), + \ 'err_mode': 'raw', \ 'out_mode': 'raw' \}) if job_status(jid) == 'run' @@ -1242,7 +1326,7 @@ function! s:spawn(name, cmd, opts) let job.lines = ['Failed to start job'] endif else - let job.lines = s:lines(call('s:system', [cmd])) + let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd])) let job.error = v:shell_error != 0 let job.running = 0 endif @@ -1262,9 +1346,6 @@ function! s:reap(name) call s:log(bullet, a:name, empty(result) ? 'OK' : result) call s:bar() - if has_key(job, 'batchfile') && !empty(job.batchfile) - call delete(job.batchfile) - endif call remove(s:jobs, a:name) endfunction @@ -1279,9 +1360,10 @@ function! s:bar() endfunction function! s:logpos(name) - for i in range(4, line('$')) + let max = line('$') + for i in range(4, max > 4 ? max : 4) if getline(i) =~# '^[-+x*] '.a:name.':' - for j in range(i + 1, line('$')) + for j in range(i + 1, max > 5 ? max : 5) if getline(j) !~ '^ ' return [i, j - 1] endif @@ -1341,8 +1423,14 @@ while 1 " Without TCO, Vim stack is bound to explode let [error, _] = s:git_validate(spec, 0) if empty(error) if pull - let fetch_opt = (has_tag && !empty(globpath(spec.dir, '.git/shallow'))) ? '--depth 99999999' : '' - call s:spawn(name, printf('git fetch %s %s 2>&1', fetch_opt, prog), { 'dir': spec.dir }) + let cmd = ['git', 'fetch'] + if has_tag && !empty(globpath(spec.dir, '.git/shallow')) + call extend(cmd, ['--depth', '99999999']) + endif + if !empty(prog) + call add(cmd, prog) + endif + call s:spawn(name, cmd, { 'dir': spec.dir }) else let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } endif @@ -1350,12 +1438,14 @@ while 1 " Without TCO, Vim stack is bound to explode let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } endif else - call s:spawn(name, - \ printf('git clone %s %s %s %s 2>&1', - \ has_tag ? '' : s:clone_opt, - \ prog, - \ s:shellesc(spec.uri), - \ s:shellesc(s:trim(spec.dir))), { 'new': 1 }) + let cmd = ['git', 'clone'] + if !has_tag + call extend(cmd, s:clone_opt) + endif + if !empty(prog) + call add(cmd, prog) + endif + call s:spawn(name, extend(cmd, [spec.uri, s:trim(spec.dir)]), { 'new': 1 }) endif if !s:jobs[name].running @@ -1392,7 +1482,7 @@ G_NVIM = vim.eval("has('nvim')") == '1' G_PULL = vim.eval('s:update.pull') == '1' G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) -G_CLONE_OPT = vim.eval('s:clone_opt') +G_CLONE_OPT = ' '.join(vim.eval('s:clone_opt')) G_PROGRESS = vim.eval('s:progress_opt(1)') G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) G_STOP = thr.Event() @@ -1929,7 +2019,7 @@ function! s:update_ruby() end } if VIM::evaluate('s:mac_gui') == 1 - clone_opt = VIM::evaluate('s:clone_opt') + clone_opt = VIM::evaluate('s:clone_opt').join(' ') progress = VIM::evaluate('s:progress_opt(1)') nthr.times do mtx.synchronize do @@ -1982,19 +2072,45 @@ function! s:update_ruby() EOF endfunction -function! s:shellesc_cmd(arg) - let escaped = substitute(a:arg, '[&|<>()@^]', '^&', 'g') - let escaped = substitute(escaped, '%', '%%', 'g') - let escaped = substitute(escaped, '"', '\\^&', 'g') - let escaped = substitute(escaped, '\(\\\+\)\(\\^\)', '\1\1\2', 'g') - return '^"'.substitute(escaped, '\(\\\+\)$', '\1\1', '').'^"' +function! s:shellesc_cmd(arg, script) + let escaped = substitute('"'.a:arg.'"', '[&|<>()@^!"]', '^&', 'g') + return substitute(escaped, '%', (a:script ? '%' : '^') . '&', 'g') endfunction -function! s:shellesc(arg) - if &shell =~# 'cmd.exe$' - return s:shellesc_cmd(a:arg) +function! s:shellesc_ps1(arg) + return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'" +endfunction + +function! s:shellesc_sh(arg) + return "'".substitute(a:arg, "'", "'\\\\''", 'g')."'" +endfunction + +" Escape the shell argument based on the shell. +" Vim and Neovim's shellescape() are insufficient. +" 1. shellslash determines whether to use single/double quotes. +" Double-quote escaping is fragile for cmd.exe. +" 2. It does not work for powershell. +" 3. It does not work for *sh shells if the command is executed +" via cmd.exe (ie. cmd.exe /c sh -c command command_args) +" 4. It does not support batchfile syntax. +" +" Accepts an optional dictionary with the following keys: +" - shell: same as Vim/Neovim 'shell' option. +" If unset, fallback to 'cmd.exe' on Windows or 'sh'. +" - script: If truthy and shell is cmd.exe, escape for batchfile syntax. +function! plug#shellescape(arg, ...) + if a:arg =~# '^[A-Za-z0-9_/:.-]\+$' + return a:arg endif - return shellescape(a: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' + return s:shellesc_cmd(a:arg, script) + elseif shell =~# 'powershell\.exe' || shell =~# 'pwsh$' + return s:shellesc_ps1(a:arg) + endif + return s:shellesc_sh(a:arg) endfunction function! s:glob_dir(path) @@ -2026,23 +2142,39 @@ function! s:format_message(bullet, name, message) endif endfunction -function! s:with_cd(cmd, dir) - return printf('cd%s %s && %s', s:is_win ? ' /d' : '', s:shellesc(a:dir), a:cmd) +function! s:with_cd(cmd, dir, ...) + let script = a:0 > 0 ? a:1 : 1 + return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd) endfunction function! s:system(cmd, ...) + let batchfile = '' try let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd - if s:is_win - let batchfile = tempname().'.bat' - call writefile(["@echo off\r", cmd . "\r"], batchfile) - let cmd = s:shellesc(batchfile) + if type(a:cmd) == s:TYPE.list + " Neovim's system() supports list argument to bypass the shell + " but it cannot set the working directory for the command. + " Assume that the command does not rely on the shell. + if has('nvim') && a:0 == 0 + return system(a:cmd) + endif + let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})')) + if &shell =~# 'powershell\.exe' + let cmd = '& ' . cmd + endif + else + let cmd = a:cmd + endif + if a:0 > 0 + let cmd = s:with_cd(cmd, a:1, type(a:cmd) != s:TYPE.list) + endif + if s:is_win && type(a:cmd) != s:TYPE.list + let [batchfile, cmd] = s:batchfile(cmd) endif return system(cmd) finally let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win + if s:is_win && filereadable(batchfile) call delete(batchfile) endif endtry @@ -2089,9 +2221,10 @@ function! s:git_validate(spec, check_branch) \ branch, a:spec.branch) endif if empty(err) - let [ahead, behind] = split(s:lastline(s:system(printf( - \ 'git rev-list --count --left-right HEAD...origin/%s', - \ a:spec.branch), a:spec.dir)), '\t') + let [ahead, behind] = split(s:lastline(s:system([ + \ 'git', 'rev-list', '--count', '--left-right', + \ printf('HEAD...origin/%s', a:spec.branch) + \ ], a:spec.dir)), '\t') if !v:shell_error && ahead if behind " Only mention PlugClean if diverged, otherwise it's likely to be @@ -2115,7 +2248,9 @@ endfunction function! s:rm_rf(dir) if isdirectory(a:dir) - call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir)) + call s:system(s:is_win + \ ? 'rmdir /S /Q '.plug#shellescape(a:dir) + \ : ['rm', '-rf', a:dir]) endif endfunction @@ -2147,7 +2282,7 @@ function! s:clean(force) let allowed = {} for dir in dirs - let allowed[s:dirpath(fnamemodify(dir, ':h:h'))] = 1 + let allowed[s:dirpath(s:plug_fnamemodify(dir, ':h:h'))] = 1 let allowed[dir] = 1 for child in s:glob_dir(dir) let allowed[child] = 1 @@ -2220,11 +2355,11 @@ endfunction function! s:upgrade() echo 'Downloading the latest version of vim-plug' redraw - let tmp = tempname() + let tmp = s:plug_tempname() let new = tmp . '/plug.vim' try - let out = s:system(printf('git clone --depth 1 %s %s', s:shellesc(s:plug_src), s:shellesc(tmp))) + let out = s:system(['git', 'clone', '--depth', '1', s:plug_src, tmp]) if v:shell_error return s:err('Error upgrading vim-plug: '. out) endif @@ -2365,18 +2500,17 @@ function! s:preview_commit() wincmd P endif setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable + let batchfile = '' try let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = 'cd '.s:shellesc(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha + let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha if s:is_win - let batchfile = tempname().'.bat' - call writefile(["@echo off\r", cmd . "\r"], batchfile) - let cmd = batchfile + let [batchfile, cmd] = s:batchfile(cmd) endif execute 'silent %!' cmd finally let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win + if s:is_win && filereadable(batchfile) call delete(batchfile) endif endtry @@ -2420,9 +2554,13 @@ function! s:diff() call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') for [k, v] in plugs let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..' - let cmd = 'git log --graph --color=never '.join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 's:shellesc(v:val)')) + let cmd = ['git', 'log', '--graph', '--color=never'] + if s:git_version_requirement(2, 10, 0) + call add(cmd, '--no-show-signature') + endif + call extend(cmd, ['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range]) if has_key(v, 'rtp') - let cmd .= ' -- '.s:shellesc(v.rtp) + call extend(cmd, ['--', v.rtp]) endif let diff = s:system_chomp(cmd, v.dir) if !empty(diff) @@ -2470,7 +2608,7 @@ function! s:revert() return endif - call s:system('git reset --hard HEAD@{1} && git checkout '.s:esc(g:plugs[name].branch).' --', g:plugs[name].dir) + call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir) setlocal modifiable normal! "_dap setlocal nomodifiable @@ -2490,7 +2628,7 @@ function! s:snapshot(force, ...) abort let names = sort(keys(filter(copy(g:plugs), \'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)'))) for name in reverse(names) - let sha = s:system_chomp('git rev-parse --short HEAD', g:plugs[name].dir) + let sha = s:system_chomp(['git', 'rev-parse', '--short', 'HEAD'], g:plugs[name].dir) if !empty(sha) call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) redraw @@ -2498,7 +2636,7 @@ function! s:snapshot(force, ...) abort endfor if a:0 > 0 - let fn = expand(a:1) + let fn = s:plug_expand(a:1) if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) return endif diff --git a/vimplugins/.vim/plugged/ale b/vimplugins/.vim/plugged/ale index db6b1b5..82f734a 160000 --- a/vimplugins/.vim/plugged/ale +++ b/vimplugins/.vim/plugged/ale @@ -1 +1 @@ -Subproject commit db6b1b5ecc17558f87f55b159f90ebf36677b6b3 +Subproject commit 82f734a7c286d8705c9a6e2879b4173fe18a6356 diff --git a/vimplugins/.vim/plugged/deoplete.nvim b/vimplugins/.vim/plugged/deoplete.nvim index ff09a7a..bbec852 160000 --- a/vimplugins/.vim/plugged/deoplete.nvim +++ b/vimplugins/.vim/plugged/deoplete.nvim @@ -1 +1 @@ -Subproject commit ff09a7ab58e5271053c59825895d607316657023 +Subproject commit bbec852adee45a1500fa817a3c17889dc328cad0 diff --git a/vimplugins/.vim/plugged/fzf b/vimplugins/.vim/plugged/fzf index dceb5d0..dea206b 160000 --- a/vimplugins/.vim/plugged/fzf +++ b/vimplugins/.vim/plugged/fzf @@ -1 +1 @@ -Subproject commit dceb5d09cdb0d3158a3f79e59eb3c16ffe242d6b +Subproject commit dea206b023a695b75540f642a0b19a3ba1e38eec diff --git a/vimplugins/.vim/plugged/fzf.vim b/vimplugins/.vim/plugged/fzf.vim index bce6588..f86ef1b 160000 --- a/vimplugins/.vim/plugged/fzf.vim +++ b/vimplugins/.vim/plugged/fzf.vim @@ -1 +1 @@ -Subproject commit bce6588d2422df75ca0091edac48aa9f87f163e5 +Subproject commit f86ef1bce602713fe0b5b68f4bdca8c6943ecb59 diff --git a/vimplugins/.vim/plugged/lightline.vim b/vimplugins/.vim/plugged/lightline.vim index 53bd327..b8976d2 160000 --- a/vimplugins/.vim/plugged/lightline.vim +++ b/vimplugins/.vim/plugged/lightline.vim @@ -1 +1 @@ -Subproject commit 53bd3279da783cd5c1b1fafb4ff31077e81b6333 +Subproject commit b8976d2e549b417e5d1c1594fb9034b749976cc0 diff --git a/vimplugins/.vim/plugged/nerdtree b/vimplugins/.vim/plugged/nerdtree index fec3e57..29a321d 160000 --- a/vimplugins/.vim/plugged/nerdtree +++ b/vimplugins/.vim/plugged/nerdtree @@ -1 +1 @@ -Subproject commit fec3e57ad23e4c268d07181d6afb858925b647a1 +Subproject commit 29a321d061032df5b2ec347b6b4b778f665305a6 diff --git a/vimplugins/.vim/plugged/nvim-yarp b/vimplugins/.vim/plugged/nvim-yarp index 81caad8..b710bf4 160000 --- a/vimplugins/.vim/plugged/nvim-yarp +++ b/vimplugins/.vim/plugged/nvim-yarp @@ -1 +1 @@ -Subproject commit 81caad80107abb9c2f5159e02e2cd95876370bec +Subproject commit b710bf4daccb603a423754794fb446e5fbb59576 diff --git a/vimplugins/.vim/plugged/vim-commentary b/vimplugins/.vim/plugged/vim-commentary index 62b68ae..f8238d7 160000 --- a/vimplugins/.vim/plugged/vim-commentary +++ b/vimplugins/.vim/plugged/vim-commentary @@ -1 +1 @@ -Subproject commit 62b68aecec2de531bc3978bfb9c07d3b6759ce0e +Subproject commit f8238d70f873969fb41bf6a6b07ca63a4c0b82b1 diff --git a/vimplugins/.vim/plugged/vim-eunuch b/vimplugins/.vim/plugged/vim-eunuch index a35d8ff..33e875b 160000 --- a/vimplugins/.vim/plugged/vim-eunuch +++ b/vimplugins/.vim/plugged/vim-eunuch @@ -1 +1 @@ -Subproject commit a35d8ffe59e1ff7408bce67ce3301d3b04c7f7b6 +Subproject commit 33e875b31c8b811a0a47908884a5e2339106bbe8 diff --git a/vimplugins/.vim/plugged/vim-gitgutter b/vimplugins/.vim/plugged/vim-gitgutter index af20a9f..5f6048d 160000 --- a/vimplugins/.vim/plugged/vim-gitgutter +++ b/vimplugins/.vim/plugged/vim-gitgutter @@ -1 +1 @@ -Subproject commit af20a9fcfff9b5277fc8482e802c4dec291ea589 +Subproject commit 5f6048da13ed8dee3bd5e453036e1f50e4ed7045 diff --git a/vimplugins/.vim/plugged/vim-hug-neovim-rpc b/vimplugins/.vim/plugged/vim-hug-neovim-rpc index 6532ace..701ecbb 160000 --- a/vimplugins/.vim/plugged/vim-hug-neovim-rpc +++ b/vimplugins/.vim/plugged/vim-hug-neovim-rpc @@ -1 +1 @@ -Subproject commit 6532acee7a06b2420160279fdd397b9d8e5f1e8a +Subproject commit 701ecbb0a1f904c0b44c6beaafef35e1de998a94 diff --git a/vimplugins/.vim/plugged/vim-multiple-cursors b/vimplugins/.vim/plugged/vim-multiple-cursors index 6ab4dc7..701e92d 160000 --- a/vimplugins/.vim/plugged/vim-multiple-cursors +++ b/vimplugins/.vim/plugged/vim-multiple-cursors @@ -1 +1 @@ -Subproject commit 6ab4dc7dd012e23adee74ef4596ad3e9659a20c7 +Subproject commit 701e92dd4cfd1b0f511e83a96d52bc590c0218dd diff --git a/vimplugins/.vim/plugged/vim-surround b/vimplugins/.vim/plugged/vim-surround index fab8621..f51a26d 160000 --- a/vimplugins/.vim/plugged/vim-surround +++ b/vimplugins/.vim/plugged/vim-surround @@ -1 +1 @@ -Subproject commit fab8621670f71637e9960003af28365129b1dfd0 +Subproject commit f51a26d3710629d031806305b6c8727189cd1935 diff --git a/wayland/.config/foot/foot.ini b/wayland/.config/foot/foot.ini new file mode 100644 index 0000000..7274fd9 --- /dev/null +++ b/wayland/.config/foot/foot.ini @@ -0,0 +1,100 @@ +# foot.ini - Imitation of custom st config.h + +[main] +# shell: static char shell[] = "/usr/local/bin/zsh"; +#shell=/usr/local/bin/zsh + +# font: static char font[] = "Input Mono:pixelsize=19..."; +font=Input Mono:pixelsize=19 + +# borderpx = 2 +pad=2x2 center + +# termname[] = "xterm-256color" +term=xterm-256color + +[scrollback] +# histsize 2000 +lines=2000 + +[cursor] +# cursorshape = 2 (Block) +style=block + +# blinktimeout = 800 (Set to yes for blinking) +blink=no + +[colors] +# defaultfg = 7 (gray90 / #e5e5e5) +# defaultbg = 0 (black / #000000) +#foreground=e5e5e5 +foreground=e5e5e5 +#background=000000 +background=253b40 + +# Cursor colors (Fixed: moved here and typo corrected) +# defaultrcs (text inside cursor) -> #555555 +# defaultcs (cursor background) -> #cccccc +#cursor-foreground=555555 +#cursor-background=cccccc + +## Normal/Regular Colors (0-7) from X11 names +# black +regular0=000000 +# red3 +regular1=cd0000 +# green3 +regular2=00cd00 +# yellow3 +regular3=cdcd00 +# blue2 +regular4=4169e1 +# magenta3 +regular5=cd00cd +# cyan3 +regular6=00cdcd +# gray90 +regular7=e5e5e5 + +## Bright Colors (8-15) +# gray50 +bright0=7f7f7f +# red +bright1=ff0000 +# green +bright2=00ff00 +# yellow +bright3=ffff00 +# #5c5cff (Custom from config.h) +bright4=5c5cff +# magenta +bright5=ff00ff +# cyan +bright6=00ffff +# white +bright7=ffffff + +[key-bindings] +# scrollback-up-page: Shift+Page_Up +scrollback-up-page=Shift+Page_Up + +# scrollback-down-page: Shift+Page_Down +scrollback-down-page=Shift+Page_Down + +# clipcopy: ControlMask|ShiftMask + C +clipboard-copy=Control+Shift+c + +# clippaste: ControlMask|ShiftMask + V OR Mod1(Alt)|ShiftMask + Insert +clipboard-paste=Control+Shift+v Mod1+Shift+Insert + +# selpaste (Primary Selection): ShiftMask + Insert +primary-paste=Shift+Insert + +# xzoom (Zoom In): Mod1(Alt)|ShiftMask + Prior (PageUp) +font-increase=Mod1+Shift+Page_Up + +# xzoom (Zoom Out): Mod1(Alt)|ShiftMask + Next (PageDown) +font-decrease=Mod1+Shift+Page_Down + +# xzoomreset: Mod1(Alt)|ShiftMask + Home +font-reset=Mod1+Shift+Home diff --git a/wayland/.config/foot/foot.ini.old b/wayland/.config/foot/foot.ini.old new file mode 100644 index 0000000..fe9bc18 --- /dev/null +++ b/wayland/.config/foot/foot.ini.old @@ -0,0 +1,288 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode +# title=foot +# locked-title=no + +font=Input Mono:size=18 +# font-bold= +# font-italic= +# font-bold-italic= +# font-size-adjustment=0.5 +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# underline-thickness= +# strikeout-thickness= +# box-drawings-uses-font-glyphs=no +#dpi-aware=yes +# gamma-correct-blending=no + +#initial-color-theme=3 +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +# pad=0x0 center-when-maximized-and-fullscreen +# resize-by-cells=yes +# resize-keep-grid=yes +# resize-delay-ms=100 + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers= +# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) +# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) + +# uppercase-regex-insert=yes + +[environment] +# name=value + +[security] +# osc52=enabled # disabled|copy-enabled|paste-enabled|enabled + +[bell] +system=no +# urgent=no +# notify=no +# visual=no +# command= +# command-focused=no + +[desktop-notifications] +# command=notify-send --wait --app-name ${app-id} --icon ${app-id} --category ${category} --urgency ${urgency} --expire-time ${expire-time} --hint STRING:image-path:${icon} --hint BOOLEAN:suppress-sound:${muted} --hint STRING:sound-name:${sound-name} --replace-id ${replace-id} ${action-argument} --print-id -- ${title} ${body} +# command-action-argument=--action ${action-name}=${action-label} +# close="" +# inhibit-when-focused=yes + + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format="" + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +# osc8-underline=url-mode +# regex=(((https?://|mailto:|ftp://|file:|ssh:|ssh://|git://|tel:|magnet:|ipfs://|ipns://|gemini://|gopher://|news:)|www\.)([0-9a-zA-Z:/?#@!$&*+,;=.~_%^\-]+|\([]\["0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\)|\[[\(\)"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\]|"[]\[\(\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*"|'[]\[\(\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\-]*')+([0-9a-zA-Z/#@$&*+=~_%^\-]|\([]\["0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\)|\[[\(\)"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\]|"[]\[\(\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*"|'[]\[\(\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\-]*')) + +# You can define your own regex's, by adding a section called +# 'regex:' with a 'regex' and 'launch' key. These can then be tied +# to a key-binding. See foot.ini(5) for details + +# [regex:your-fancy-name] +# regex= +# launch= ${match} +# +# [key-bindings] +# regex-launch=[your-fancy-name] Control+Shift+q +# regex-copy=[your-fancy-name] Control+Alt+Shift+q + +[cursor] +# style=block +# blink=no +# blink-rate=500 +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[touch] +# long-press-delay=400 + +[colors] +# alpha=1.0 +# alpha-mode=default # Can be `default`, `matching` or `all` +background=000000 +foreground=cccccc +# flash=7f7f00 +# flash-alpha=0.5 + +# cursor= + +## Normal/regular colors (color palette 0-7) +# regular0=242424 # black +# regular1=f62b5a # red +# regular2=47b413 # green +# regular3=e3c401 # yellow +# regular4=24acd4 # blue +# regular5=f2affd # magenta +# regular6=13c299 # cyan +# regular7=e6e6e6 # white + +## Bright colors (color palette 8-15) +# bright0=616161 # bright black +# bright1=ff4d51 # bright red +# bright2=35d450 # bright green +# bright3=e9e836 # bright yellow +# bright4=5dc5f8 # bright blue +# bright5=feabf2 # bright magenta +# bright6=24dfc4 # bright cyan +# bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim-blend-towards=black +# dim0= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Sixel colors +# sixel0 = 000000 +# sixel1 = 3333cc +# sixel2 = cc2121 +# sixel3 = 33cc33 +# sixel4 = cc33cc +# sixel5 = 33cccc +# sixel6 = cccc33 +# sixel7 = 878787 +# sixel8 = 424242 +# sixel9 = 545499 +# sixel10 = 994242 +# sixel11 = 549954 +# sixel12 = 995499 +# sixel13 = 549999 +# sixel14 = 999954 +# sixel15 = cccccc + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= # black-on-yellow +# scrollback-indicator= # black-on-bright-blue +# search-box-no-match= # black-on-red +# search-box-match= # black-on-yellow +# urls= + +[colors2] +# Alternative color theme, see man page foot.ini(5) +# Same builtin defaults as [color], except for: +# dim-blend-towards=white + +[csd] +# preferred=server +# size=26 +# font= +# color= +# hide-when-maximized=no +# double-click-to-maximize=yes +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up Shift+KP_Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down Shift+KP_Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard +# show-urls-launch=Control+Shift+o +# show-urls-copy=none +# show-urls-persistent=none +# prompt-prev=Control+Shift+z +# prompt-next=Control+Shift+x +# unicode-input=Control+Shift+u +# color-theme-switch-1=none +# color-theme-switch-2=none +# color-theme-toggle=none +# noop=none +# quit=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return KP_Enter +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# delete-to-start=Control+u +# delete-to-end=Control+k +# extend-char=Shift+Right +# extend-to-word-boundary=Control+w Control+Shift+Right +# extend-to-next-whitespace=Control+Shift+w +# extend-line-down=Shift+Down +# extend-backward-char=Shift+Left +# extend-backward-to-word-boundary=Control+Shift+Left +# extend-backward-to-next-whitespace=none +# extend-line-up=Shift+Up +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert +# unicode-input=none +# scrollback-up-page=Shift+Page_Up Shift+KP_Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down Shift+KP_Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# scrollback-up-mouse=BTN_WHEEL_BACK +# scrollback-down-mouse=BTN_WHEEL_FORWARD +# font-increase=Control+BTN_WHEEL_BACK +# font-decrease=Control+BTN_WHEEL_FORWARD +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-quote = BTN_LEFT-3 +# select-row=BTN_LEFT-4 + +# vim: ft=dosini diff --git a/wayland/.config/hypr/hyprland.conf b/wayland/.config/hypr/hyprland.conf new file mode 100644 index 0000000..298cb95 --- /dev/null +++ b/wayland/.config/hypr/hyprland.conf @@ -0,0 +1,207 @@ +################################ +# Modifier +################################ + +$mod = SUPER + +################################ +# Core behavior +################################ + +general { + layout = master + gaps_in = 0 + gaps_out = 0 + border_size = 0 + no_border_on_floating = true + + col.inactive_border = rgb(444444) + col.active_border = rgb(005577) +} + +master { + new_status = master + mfact = 0.55 + orientation = left + slave_count_for_center_master = 0 + inherit_fullscreen = true +} + +monitor = eDP-1, 1920x1200@60, 0x0, 1 + +# Force all non-floating windows to spawn 'maximized' (Monocle mode) +# 'fullscreenstate 1' maximizes the window (keeping the bar visible) +# 'fullscreenstate 0' for the client keeps it behaving normally internally +windowrulev2 = fullscreenstate 1 0, class:^.*$, floating:0 + +################################ +# Input +################################ + +input { + kb_layout = us,ru,us + kb_variant = colemak,, + follow_mouse = 0 +} + +################################ +# Visuals completely disabled +################################ + +animations { + enabled = false +} + +decoration { + rounding = 0 +} + +misc { + disable_hyprland_logo = true + disable_splash_rendering = true + force_default_wallpaper = 0 + focus_on_activate = true + new_window_takes_over_fullscreen = 2 +} + +################################ +# Workspaces +################################ + +workspace = 1, default:true +workspace = 2 +workspace = 3 +workspace = 4 +workspace = 5 +workspace = 6 +workspace = 7 +workspace = 8 +workspace = 9 + +################################ +# Environment (fonts & menu colors) +################################ + +env = XCURSOR_THEME,Chicago95_Emerald +env = XCURSOR_SIZE,20 +exec-once = hyprctl setcursor Chicago95_Emerald 20 +env = QT_QPA_PLATFORMTHEME,qt5ct +env = QT_QPA_PLATFORM,wayland + +################################ +# Keybindings – core +################################ + +bind = $mod SHIFT, RETURN, exec, foot +bind = $mod, P, exec, ~/.local/bin/bemenu +bind = $mod SHIFT, C, killactive +bind = $mod, F, fullscreen +bind = $mod, T, togglefloating +bind = $mod SHIFT, Q, exit + +################################ +# Focus movement +################################ + +# Toggle Monocle (Maximize) for the active window +bind = $mod, M, fullscreen, 1 + +# Cycle focus (dwm style) +# cycling automatically brings the focused window to the top of the "monocle" stack +bind = $mod, J, layoutmsg, cyclenext +bind = $mod, K, layoutmsg, cycleprev + +bind = $mod, H, movefocus, l +bind = $mod, L, movefocus, r + +bind = $mod, B, exec, pkill yambar || yambar + +################################ +# Window movement +################################ + +bind = $mod SHIFT, H, movewindow, l +bind = $mod SHIFT, L, movewindow, r +bind = $mod SHIFT, J, movewindow, d +bind = $mod SHIFT, K, movewindow, u + +################################ +# Workspaces +################################ + +bind = $mod, 1, workspace, 1 +bind = $mod, 2, workspace, 2 +bind = $mod, 3, workspace, 3 +bind = $mod, 4, workspace, 4 +bind = $mod, 5, workspace, 5 +bind = $mod, 6, workspace, 6 +bind = $mod, 7, workspace, 7 +bind = $mod, 8, workspace, 8 +bind = $mod, 9, workspace, 9 + +bind = $mod SHIFT, 1, movetoworkspacesilent, 1 +bind = $mod SHIFT, 2, movetoworkspacesilent, 2 +bind = $mod SHIFT, 3, movetoworkspacesilent, 3 +bind = $mod SHIFT, 4, movetoworkspacesilent, 4 +bind = $mod SHIFT, 5, movetoworkspacesilent, 5 +bind = $mod SHIFT, 6, movetoworkspacesilent, 6 +bind = $mod SHIFT, 7, movetoworkspacesilent, 7 +bind = $mod SHIFT, 8, movetoworkspacesilent, 8 +bind = $mod SHIFT, 9, movetoworkspacesilent, 9 + +# Mod + Shift + Comma (Throw to Left Monitor, Stay Here) +bind = $mod SHIFT, comma, movewindow, mon:l +bind = $mod SHIFT, comma, focusmonitor, +0 + +# Mod + Shift + Period (Throw to Right Monitor, Stay Here) +bind = $mod SHIFT, period, movewindow, mon:r +bind = $mod SHIFT, period, focusmonitor, +0 + +################################ +# Media / brightness / power +################################ + +bind = , XF86AudioRaiseVolume, exec, dunstMixer -i 5 +bind = , XF86AudioLowerVolume, exec, dunstMixer -d 5 +bind = , XF86AudioMute, exec, dunstMixer -t + +bind = , XF86MonBrightnessUp, exec, dunstBright set 5%+ +bind = , XF86MonBrightnessDown, exec, dunstBright set 5%- + +bind = , XF86Sleep, exec, systemctl suspend + +################################ +# Keyboard layout switching +################################ + +bind = CTRL, 1, exec, hyprctl switchxkblayout all 0 +bind = CTRL, 2, exec, hyprctl switchxkblayout all 1 +bind = CTRL, 3, exec, hyprctl switchxkblayout all 2 + +################################ +# Screenshots +################################ + +bind = , Print, exec, grim ~/Pictures/shot-$(date +%F-%T).png +bind = SHIFT, Print, exec, grim -g "$(slurp)" ~/Pictures/shot-$(date +%F-%T).png + +################################ +# Autostart +################################ + +exec-once = ~/.local/bin/hypr-version.sh +exec-once = ~/.local/bin/wallpaper-tile.sh +exec-once = ~/.local/bin/import-gsettings + +# Notifications +exec-once = mako + +# Status bar +exec-once = yambar + +# Night light +exec-once = gammastep -t 6500:3200 -l 42.2407:-83.6133 + +# Brightness baseline +exec-once = brightnessctl set 75% + diff --git a/wayland/.config/hypr/og.hyprland.conf b/wayland/.config/hypr/og.hyprland.conf new file mode 100644 index 0000000..508c411 --- /dev/null +++ b/wayland/.config/hypr/og.hyprland.conf @@ -0,0 +1,312 @@ + +# ####################################################################################### +# AUTOGENERATED HYPRLAND CONFIG. +# EDIT THIS CONFIG ACCORDING TO THE WIKI INSTRUCTIONS. +# ####################################################################################### + +autogenerated = 1 # remove this line to remove the warning + +# This is an example Hyprland config file. +# Refer to the wiki for more information. +# https://wiki.hypr.land/Configuring/ + +# Please note not all available settings / options are set here. +# For a full list, see the wiki + +# You can split this configuration into multiple files +# Create your files separately and then link them to this file like this: +# source = ~/.config/hypr/myColors.conf + + +################ +### MONITORS ### +################ + +# See https://wiki.hypr.land/Configuring/Monitors/ +monitor=,preferred,auto,auto + + +################### +### MY PROGRAMS ### +################### + +# See https://wiki.hypr.land/Configuring/Keywords/ + +# Set programs that you use +$terminal = kitty +$fileManager = dolphin +$menu = wofi --show drun + + +################# +### AUTOSTART ### +################# + +# Autostart necessary processes (like notifications daemons, status bars, etc.) +# Or execute your favorite apps at launch like this: + +# exec-once = $terminal +# exec-once = nm-applet & +# exec-once = waybar & hyprpaper & firefox + + +############################# +### ENVIRONMENT VARIABLES ### +############################# + +# See https://wiki.hypr.land/Configuring/Environment-variables/ + +env = XCURSOR_SIZE,24 +env = HYPRCURSOR_SIZE,24 + + +################### +### PERMISSIONS ### +################### + +# See https://wiki.hypr.land/Configuring/Permissions/ +# Please note permission changes here require a Hyprland restart and are not applied on-the-fly +# for security reasons + +# ecosystem { +# enforce_permissions = 1 +# } + +# permission = /usr/(bin|local/bin)/grim, screencopy, allow +# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow +# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow + + +##################### +### LOOK AND FEEL ### +##################### + +# Refer to https://wiki.hypr.land/Configuring/Variables/ + +# https://wiki.hypr.land/Configuring/Variables/#general +general { + gaps_in = 5 + gaps_out = 20 + + border_size = 2 + + # https://wiki.hypr.land/Configuring/Variables/#variable-types for info about colors + col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.inactive_border = rgba(595959aa) + + # Set to true enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = false + + # Please see https://wiki.hypr.land/Configuring/Tearing/ before you turn this on + allow_tearing = false + + layout = dwindle +} + +# https://wiki.hypr.land/Configuring/Variables/#decoration +decoration { + rounding = 10 + rounding_power = 2 + + # Change transparency of focused and unfocused windows + active_opacity = 1.0 + inactive_opacity = 1.0 + + shadow { + enabled = true + range = 4 + render_power = 3 + color = rgba(1a1a1aee) + } + + # https://wiki.hypr.land/Configuring/Variables/#blur + blur { + enabled = true + size = 3 + passes = 1 + + vibrancy = 0.1696 + } +} + +# https://wiki.hypr.land/Configuring/Variables/#animations +animations { + enabled = yes, please :) + + # Default curves, see https://wiki.hypr.land/Configuring/Animations/#curves + # NAME, X0, Y0, X1, Y1 + bezier = easeOutQuint, 0.23, 1, 0.32, 1 + bezier = easeInOutCubic, 0.65, 0.05, 0.36, 1 + bezier = linear, 0, 0, 1, 1 + bezier = almostLinear, 0.5, 0.5, 0.75, 1 + bezier = quick, 0.15, 0, 0.1, 1 + + # Default animations, see https://wiki.hypr.land/Configuring/Animations/ + # NAME, ONOFF, SPEED, CURVE, [STYLE] + animation = global, 1, 10, default + animation = border, 1, 5.39, easeOutQuint + animation = windows, 1, 4.79, easeOutQuint + animation = windowsIn, 1, 4.1, easeOutQuint, popin 87% + animation = windowsOut, 1, 1.49, linear, popin 87% + animation = fadeIn, 1, 1.73, almostLinear + animation = fadeOut, 1, 1.46, almostLinear + animation = fade, 1, 3.03, quick + animation = layers, 1, 3.81, easeOutQuint + animation = layersIn, 1, 4, easeOutQuint, fade + animation = layersOut, 1, 1.5, linear, fade + animation = fadeLayersIn, 1, 1.79, almostLinear + animation = fadeLayersOut, 1, 1.39, almostLinear + animation = workspaces, 1, 1.94, almostLinear, fade + animation = workspacesIn, 1, 1.21, almostLinear, fade + animation = workspacesOut, 1, 1.94, almostLinear, fade + animation = zoomFactor, 1, 7, quick +} + +# Ref https://wiki.hypr.land/Configuring/Workspace-Rules/ +# "Smart gaps" / "No gaps when only" +# uncomment all if you wish to use that. +# workspace = w[tv1], gapsout:0, gapsin:0 +# workspace = f[1], gapsout:0, gapsin:0 +# windowrule = bordersize 0, floating:0, onworkspace:w[tv1] +# windowrule = rounding 0, floating:0, onworkspace:w[tv1] +# windowrule = bordersize 0, floating:0, onworkspace:f[1] +# windowrule = rounding 0, floating:0, onworkspace:f[1] + +# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more +dwindle { + pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true # You probably want this +} + +# See https://wiki.hypr.land/Configuring/Master-Layout/ for more +master { + new_status = master +} + +# https://wiki.hypr.land/Configuring/Variables/#misc +misc { + force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers + disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( +} + + +############# +### INPUT ### +############# + +# https://wiki.hypr.land/Configuring/Variables/#input +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + + touchpad { + natural_scroll = false + } +} + +# See https://wiki.hypr.land/Configuring/Gestures +gesture = 3, horizontal, workspace + +# Example per-device config +# See https://wiki.hypr.land/Configuring/Keywords/#per-device-input-configs for more +device { + name = epic-mouse-v1 + sensitivity = -0.5 +} + + +################### +### KEYBINDINGS ### +################### + +# See https://wiki.hypr.land/Configuring/Keywords/ +$mainMod = SUPER # Sets "Windows" key as main modifier + +# Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more +bind = $mainMod, Q, exec, $terminal +bind = $mainMod, C, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, E, exec, $fileManager +bind = $mainMod, V, togglefloating, +bind = $mainMod, R, exec, $menu +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, J, togglesplit, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Example special workspace (scratchpad) +bind = $mainMod, S, togglespecialworkspace, magic +bind = $mainMod SHIFT, S, movetoworkspace, special:magic + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Laptop multimedia keys for volume and LCD brightness +bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ +bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+ +bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%- + +# Requires playerctl +bindl = , XF86AudioNext, exec, playerctl next +bindl = , XF86AudioPause, exec, playerctl play-pause +bindl = , XF86AudioPlay, exec, playerctl play-pause +bindl = , XF86AudioPrev, exec, playerctl previous + +############################## +### WINDOWS AND WORKSPACES ### +############################## + +# See https://wiki.hypr.land/Configuring/Window-Rules/ for more +# See https://wiki.hypr.land/Configuring/Workspace-Rules/ for workspace rules + +# Example windowrule +# windowrule = float,class:^(kitty)$,title:^(kitty)$ + +# Ignore maximize requests from apps. You'll probably like this. +windowrule = suppressevent maximize, class:.* + +# Fix some dragging issues with XWayland +windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 diff --git a/wayland/.config/yambar/config.yml b/wayland/.config/yambar/config.yml new file mode 100644 index 0000000..9e728f3 --- /dev/null +++ b/wayland/.config/yambar/config.yml @@ -0,0 +1,175 @@ +# --- COLORS & STYLES --- +_styles: + focused: &focused + foreground: eeeeeeff + + normal: &normal + foreground: bbbbbbff + +# --- BAR CONFIG --- +bar: + monitor: ${MON_NAME} + height: 20 + location: top + #background: 222222ff + background: 4B7A82FF + font: Inconsolata LGC:size=10 + + left: + - script: + path: /usr/bin/yambar-hyprland-wses + anchors: + #ws_focused: &ws_focused fba922ff + ws_focused: &ws_focused fba922ff + ws_active: &ws_active ffffffff + ws_empty: &ws_empty 000000ff + ws_other: &ws_other bbbbbbff + # you can use `{workspace_N}` here to use the workspace name + # assigned by Hyprland instead of hard-coding one here. That + # name is, as far as I can tell, always just the index of the + # workspace though, so not all that valuable. + ws_1: &ws_1 " 1" + ws_2: &ws_2 "2" + ws_3: &ws_3 "3" + ws_4: &ws_4 "4" + ws_5: &ws_5 "5" + ws_6: &ws_6 "6" + ws_7: &ws_7 "7" + ws_8: &ws_8 "8" + ws_9: &ws_9 "9" + content: + list: + spacing: 6 + items: + - map: + default: + string: { text: *ws_1, foreground: *ws_other } + conditions: + workspace_count < 2: + # if you replace all of these empty: entries with + # + # string: { text: *ws_N, foreground: *ws_empty } + # + # instead, then you'll always see the full + # workspace list. however, you'll be unable to use + # `{workspace_N}` as the workspace names in the + # anchors list above. + empty: {} + workspace_1_focused: + string: { text: *ws_1, foreground: *ws_focused } + workspace_1_active: + string: { text: *ws_1, foreground: *ws_active } + workspace_1_windows == 0: + string: { text: *ws_1, foreground: *ws_empty } + # All of the maps below are identical to the one above, + # except with N++. + - map: + default: + string: { text: *ws_2, foreground: *ws_other } + conditions: + workspace_count < 3: + empty: {} + workspace_2_focused: + string: { text: *ws_2, foreground: *ws_focused } + workspace_2_active: + string: { text: *ws_2, foreground: *ws_active } + workspace_2_windows == 0: + string: { text: *ws_2, foreground: *ws_empty } + - map: + default: + string: { text: *ws_3, foreground: *ws_other } + conditions: + workspace_count < 4: + empty: {} + workspace_3_focused: + string: { text: *ws_3, foreground: *ws_focused } + workspace_3_active: + string: { text: *ws_3, foreground: *ws_active } + workspace_3_windows == 0: + string: { text: *ws_3, foreground: *ws_empty } + - map: + default: + string: { text: *ws_4, foreground: *ws_other } + conditions: + workspace_count < 5: + empty: {} + workspace_4_focused: + string: { text: *ws_4, foreground: *ws_focused } + workspace_4_active: + string: { text: *ws_4, foreground: *ws_active } + workspace_4_windows == 0: + string: { text: *ws_4, foreground: *ws_empty } + - map: + default: + string: { text: *ws_5, foreground: *ws_other } + conditions: + workspace_count < 6: + empty: {} + workspace_5_focused: + string: { text: *ws_5, foreground: *ws_focused } + workspace_5_active: + string: { text: *ws_5, foreground: *ws_active } + workspace_5_windows == 0: + string: { text: *ws_5, foreground: *ws_empty } + - map: + default: + string: { text: *ws_6, foreground: *ws_other } + conditions: + workspace_count < 7: + empty: {} + workspace_6_focused: + string: { text: *ws_6, foreground: *ws_focused } + workspace_6_active: + string: { text: *ws_6, foreground: *ws_active } + workspace_6_windows == 0: + string: { text: *ws_6, foreground: *ws_empty } + - map: + default: + string: { text: *ws_7, foreground: *ws_other } + conditions: + workspace_count < 8: + empty: {} + workspace_7_focused: + string: { text: *ws_7, foreground: *ws_focused } + workspace_7_active: + string: { text: *ws_7, foreground: *ws_active } + workspace_7_windows == 0: + string: { text: *ws_7, foreground: *ws_empty } + - map: + default: + string: { text: *ws_8, foreground: *ws_other } + conditions: + workspace_count < 9: + empty: {} + workspace_8_focused: + string: { text: *ws_8, foreground: *ws_focused } + workspace_8_active: + string: { text: *ws_8, foreground: *ws_active } + workspace_8_windows == 0: + string: { text: *ws_8, foreground: *ws_empty } + - map: + default: + string: { text: *ws_9, foreground: *ws_other } + conditions: + workspace_count < 10: + empty: {} + workspace_9_focused: + string: { text: *ws_9, foreground: *ws_focused } + workspace_9_active: + string: { text: *ws_9, foreground: *ws_active } + workspace_9_windows == 0: + string: { text: *ws_9, foreground: *ws_empty } + + center: + - foreign-toplevel: + content: + map: + conditions: + activated: { string: { text: "{title}", foreground: ffffffff } } + ~activated: { empty: {} } + + right: + - script: + path: ~/.local/bin/hypr-status.sh + poll-interval: 2000 + content: { string: { text: " {hstatus} ", foreground: ffffffff } } diff --git a/wayland/.local/bin/bemenu b/wayland/.local/bin/bemenu new file mode 100755 index 0000000..b961b9f --- /dev/null +++ b/wayland/.local/bin/bemenu @@ -0,0 +1,12 @@ +#!/bin/sh +# Wrapper to make bemenu look like DWM dmenu +bemenu-run \ + --nb "#222222" \ + --nf "#bbbbbb" \ + --sb "#005577" \ + --sf "#eeeeee" \ + --fn "Inconsolata LGC 10" \ + -p "Run:" \ + --tf "#005577" \ + --hb "#005577" \ + --hf "#eeeeee" "$@" diff --git a/wayland/.local/bin/hypr-status.sh b/wayland/.local/bin/hypr-status.sh new file mode 100755 index 0000000..908fb33 --- /dev/null +++ b/wayland/.local/bin/hypr-status.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +# --- Gather Data --- + +# 1. Hyprland Version +if [ -r "$HOME/.cache/hyprland-version" ]; then + HYPR_VER="$(cat "$HOME/.cache/hyprland-version")" +else + HYPR_VER="hyprland" +fi + +# 2. Power Profile +if [ -r /sys/firmware/acpi/platform_profile ]; then + PROFILE="$(cut -c1-3 /sys/firmware/acpi/platform_profile)" +else + PROFILE="unk" +fi + +# 3. Load Average +LOADAVG="$(cut -d' ' -f1 /proc/loadavg)" + +# 4. Battery +if command -v upower >/dev/null 2>&1; then + BAT_DEV="$(upower -e | grep BAT | head -n1)" + if [ -n "$BAT_DEV" ]; then + BAT_PCT="$(upower -i "$BAT_DEV" | awk '/percentage/ {print $2}')" + BAT_STATE="$(upower -i "$BAT_DEV" | awk '/state/ {print $2}')" + + if [ -n "$BAT_PCT" ]; then + case "$BAT_STATE" in + charging) BAT="+$BAT_PCT" ;; + discharging|fully-charged) BAT="$BAT_PCT" ;; + *) BAT="?$BAT_PCT" ;; + esac + else + BAT="?" + fi + else + BAT="?" + fi +else + BAT="?" +fi + +# 5. Date +DATE="$(date '+%Y-%m-%d %a %H:%M')" + +# --- Output to Yambar --- + +# We use the unicode vertical bar '│' (U+2502) to be safe from parsing errors. +# We also append a newline explicitly. +printf "hstatus|string| %s │ %s │ %s │ %s │ %s\n" \ + "$HYPR_VER" "$PROFILE" "$LOADAVG" "$BAT" "$DATE" + +# FORCE FLUSH: This is likely why you saw {hstatus} before. +# Some shells buffer printf. This ensures it sends immediately. +echo "" diff --git a/wayland/.local/bin/hypr-version.sh b/wayland/.local/bin/hypr-version.sh new file mode 100755 index 0000000..4ec8de5 --- /dev/null +++ b/wayland/.local/bin/hypr-version.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +hyprctl version 2>/dev/null | head -n1 | awk '{print $1 " " $2}' > "$HOME/.cache/hyprland-version" + diff --git a/wayland/.local/bin/hypr-workspaces.sh b/wayland/.local/bin/hypr-workspaces.sh new file mode 100755 index 0000000..95536fd --- /dev/null +++ b/wayland/.local/bin/hypr-workspaces.sh @@ -0,0 +1,56 @@ +# --- SAFETY BLOCK: Auto-detect Hyprland Signature --- +# If the variable is missing (common in scripts), find the most recent Hyprland instance. +if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then + # Look into /run/user/1000/hypr/ and grab the newest directory name + HYPRLAND_INSTANCE_SIGNATURE="$(ls -1t "$XDG_RUNTIME_DIR/hypr" | head -n 1)" +fi + +# Define the socket path manually to be sure +SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" + +# 1. Determine Monitor Name +MONITOR="$1" +if [ -z "$MONITOR" ]; then + MONITOR=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name') +fi + +# Function to draw the bar +generate_workspaces() { + # Get Active ID for the SPECIFIC monitor + ACTIVE_ID=$(hyprctl monitors -j | jq -r ".[] | select(.name == \"${MONITOR}\") | .activeWorkspace.id") + + # Fallback if jq returns null + if [ -z "$ACTIVE_ID" ] || [ "$ACTIVE_ID" = "null" ]; then + ACTIVE_ID=$(hyprctl activeworkspace -j | jq -r '.id') + fi + + for i in $(seq 1 9); do + if [ "$i" -eq "$ACTIVE_ID" ] 2>/dev/null; then + echo "ws${i}_state|string|focused" + else + echo "ws${i}_state|string|normal" + fi + done + echo "" +} + +# --- MAIN EXECUTION --- + +# 1. Run once immediately to populate the bar +generate_workspaces + +# 2. Check if socket exists before running socat +if [ ! -S "$SOCKET" ]; then + # Print error to bar so you see it + echo "ws1_state|string|NoSock" + exit 1 +fi + +# 3. Listen loop (Quote the event strings to fix the syntax error) +socat -U - "UNIX-CONNECT:$SOCKET" | while read -r line; do + case "$line" in + "workspace>>"*|"focusedmon>>"*|"createworkspace>>"*|"destroyworkspace>>"*|"movewindow>>"*) + generate_workspaces + ;; + esac +done diff --git a/wayland/.local/bin/import-gsettings b/wayland/.local/bin/import-gsettings new file mode 100755 index 0000000..a9d2608 --- /dev/null +++ b/wayland/.local/bin/import-gsettings @@ -0,0 +1,16 @@ +#!/bin/sh + +# Usage: import-gsettings +config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" +if [ ! -f "$config" ]; then exit 1; fi + +gnome_schema="org.gnome.desktop.interface" +gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')" +icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')" +cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')" +font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')" + +gsettings set "$gnome_schema" gtk-theme "$gtk_theme" +gsettings set "$gnome_schema" icon-theme "$icon_theme" +gsettings set "$gnome_schema" cursor-theme "$cursor_theme" +gsettings set "$gnome_schema" font-name "$font_name" diff --git a/wayland/.local/bin/wallpaper-tile.sh b/wayland/.local/bin/wallpaper-tile.sh new file mode 100755 index 0000000..699d414 --- /dev/null +++ b/wayland/.local/bin/wallpaper-tile.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +WP_DIR="$HOME/Pictures/Wallpapers/tiles" +WP_EXT="*.png" + +WP="$(ls "$WP_DIR"/$WP_EXT 2>/dev/null | shuf -n1)" + +[ -n "$WP" ] || exit 0 + +exec swaybg -m tile -i "$WP" + diff --git a/wayland/.wl-packagelist b/wayland/.wl-packagelist new file mode 100644 index 0000000..a3de78f --- /dev/null +++ b/wayland/.wl-packagelist @@ -0,0 +1,2 @@ +yambar hyprland xdg-desktop-portal-hyprland xdg-desktop-portal wayland wayland-protocols xorg-xwayland pipewire pipewire-pulse wireplumber brightnessctl gammastep mako bemenu foot grim slurp swaybg noto-fonts noto-fonts-emoji ttf-jetbrains-mono nscde nwg-look qt5ct qt6ct redmond97-gtk-theme-git qt5-styleplugins qt6gtk2 + diff --git a/wayland/.wl-services b/wayland/.wl-services new file mode 100644 index 0000000..5387570 --- /dev/null +++ b/wayland/.wl-services @@ -0,0 +1,3 @@ +systemctl --user enable --now pipewire.service +systemctl --user enable --now pipewire-pulse.service +systemctl --user enable --now wireplumber.service diff --git a/xinitrc/.xinitrc b/xinitrc/.xinitrc index d7f2b6a..d0aaaf4 100644 --- a/xinitrc/.xinitrc +++ b/xinitrc/.xinitrc @@ -1,9 +1,12 @@ -export QT_QPA_PLATFORMTHEME=qt5ct - -# Wallpaper +~/.fehbg & xsetroot -solid "#008080" & - -xbindkeys & +setxkbmap us -variant colemak & +dunst & sdwmbar & -redshift & -exec dwm +xbacklight -set 75 & +pgrep redshift -t 6500:3200 -l 42.2407:-83.6133 &> /dev/null || redshift -t 6500:3200 -l 42.2407:-83.6133 &> /dev/null & +xbindkeys & +xsettingsd & +picom --backend glx --vsync & +exec dbus-launch dwm +#exec openbox-session diff --git a/zsh/.zshrc b/zsh/.zshrc index 0debed1..ca6a81b 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -106,3 +106,8 @@ echo # Expots, Functions and Aliases source /home/sakhmatd/.zshrc.local + +# Added by LM Studio CLI (lms) +export PATH="$PATH:/home/sakhmatd/.lmstudio/bin" +# End of LM Studio CLI section + diff --git a/zsh/.zshrc.local b/zsh/.zshrc.local index ba9f7fd..dddbb71 100644 --- a/zsh/.zshrc.local +++ b/zsh/.zshrc.local @@ -1,13 +1,28 @@ ## -*- mode: sh -*- +# Java Swing fix +export _JAVA_AWT_WM_NONREPARENTING=1 + +# ccache +export PATH="/usr/lib/ccache/bin:$PATH" export RANGER_LOAD_DEFAULT_RC=FALSE +# local bin +export PATH="/home/sakhmatd/.local/bin:$PATH" + +# rust +export PATH="/home/sakhmatd/.cargo/bin:$PATH" + ############################################################ ## Exports ############################################################ export EDITOR='vim' -export PAGER='less' -export BROWSER='qutebrowser' +export PAGER='most' +export BROWSER='floorp' + +export OPENAI_API_KEY='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' +alias unclone='umount /home/sakhmatd/mnt/*' + ############################################################ ## Functions @@ -59,6 +74,14 @@ indent_suckless() -o $2 } +nextchat() +{ + sudo docker run -d -p 3000:3000 \ + -e OPENAI_API_KEY=$OPENAI_API_KEY \ + -e CODE=temppwd \ + yidadaa/chatgpt-next-web +} + ############################################################ ## Aliases ############################################################ @@ -102,6 +125,7 @@ alias clearhistory='cat /dev/null > ~/.zsh_history && history -c && exit' alias sshfs_mount='sshfs -C -o allow_other' alias mountyadisk='sudo mount -t davfs https://webdav.yandex.ru /home/sakhmatd/mnt/yadisk' alias mountallsync='sudo mount -t davfs https://cloud.allsync.com /home/sakhmatd/mnt/allsync' +alias remote-desk='ssh remote-atom -t ssh desktop' ############################################################ # OS-Specific Modules