Removed commit history

Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
This commit is contained in:
Marko Korhonen 2019-10-26 20:05:31 +03:00
commit b1335a3628
199 changed files with 36930 additions and 0 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "dotdrop"]
path = dotdrop
url = https://github.com/deadc0de6/dotdrop.git

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Marko Korhonen
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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

12
README.md Normal file
View file

@ -0,0 +1,12 @@
# ReekyMarko's dotfiles
![screenshot of my setup](https://i.imgur.com/lz1Q4Zz.png?raw=true")
My personal dotfiles for my workstations, mostly for easy access for myself
but feel free to steal them for yourself!
I'm using [dotdrop](https://github.com/deadc0de6/dotdrop) to manage and ease deployment of my dotfiles.
## Mirrors
This repository lives at [ReekyNET Git](https://git.reekynet.com/ReekyMarko/dotfiles), but it is also mirrored to [GitLab](https://gitlab.com/ReekyMarko/dotfiles), [GitHub](https://github.com/ReekyMarko/dotfiles) and [Bitbucket](https://bitbucket.org/ReekyMarko/dotfiles).
If you have any ideas for improvements, questions or anything of this sort, you can open an issue or a pull request in either ReekyNET Git (registrations open for anyone), or any of the mirrors.

227
config-home.yaml Normal file
View file

@ -0,0 +1,227 @@
actions:
vim-plug: nvim +PlugInstall +qall
zplug: zplug install
config:
backup: true
banner: true
create: true
dotpath: home
ignoreempty: false
keepdot: true
link_dotfile_default: nolink
link_on_import: nolink
longkey: false
showdiff: false
workdir: ~/.config/dotdrop
dotfiles:
d_systemd:
dst: ~/.config/systemd/user
src: .config/systemd/user
d_mpv:
dst: ~/.config/mpv
src: .config/mpv
d_nvim_config:
actions:
- vim-plug
dst: ~/.config/nvim/conf.d
src: .config/nvim/conf.d
d_scripts:
dst: ~/Scripts
src: Scripts
d_sway:
dst: ~/.config/sway
src: .config/sway
d_ticons:
dst: ~/.local/share/TelegramDesktop/tdata/ticons
src: .local/share/TelegramDesktop/tdata/ticons
d_waybar:
dst: ~/.config/waybar
src: .config/waybar
f_abcde.conf:
dst: ~/.abcde.conf
src: .abcde.conf
f_alacritty.yml:
dst: ~/.config/alacritty/alacritty.yml
src: .config/alacritty/alacritty.yml
f_authorized_keys:
dst: ~/.ssh/authorized_keys
src: .ssh/authorized_keys
f_beets_config:
dst: ~/.config/beets/config.yaml
src: .config/beets/config.yaml
f_beets_whitelist:
dst: ~/.config/beets/whitelist
src: .config/beets/whitelist
f_bspwmrc:
dst: ~/.config/bspwm/bspwmrc
src: .config/bspwm/bspwmrc
f_coc-settings.json:
dst: ~/.config/nvim/coc-settings.json
src: .config/nvim/coc-settings.json
f_efm-langserver.yaml:
dst: ~/.config/efm-langserver/config.yaml
src: .config/efm-langserver/config.yaml
f_gitconfig:
dst: ~/.gitconfig
src: .gitconfig
f_init.vim:
dst: ~/.config/nvim/init.vim
src: .config/nvim/init.vim
f_libra_config:
dst: ~/.config/libra/config.toml
src: .config/libra/config.toml
f_mailcap:
dst: ~/.mailcap
src: .mailcap
f_makepkg.conf:
dst: ~/.config/pacman/makepkg.conf
src: .config/pacman/makepkg.conf
f_mako_config:
dst: ~/.config/mako/config
src: .config/mako/config
f_mimeo_associations.txt:
dst: ~/.config/mimeo/associations.txt
src: .config/mimeo/associations.txt
f_mpd.conf:
dst: ~/.config/mpd/mpd.conf
src: .config/mpd/mpd.conf
f_mpdris2.conf:
dst: ~/.config/mpDris2/mpDris2.conf
src: .config/mpDris2/mpDris2.conf
f_mpdscribble.conf:
dst: ~/.mpdscribble/mpdscribble.conf
src: .mpdscribble/mpdscribble.conf
f_ncmpcpp_bindings:
dst: ~/.config/ncmpcpp/bindings
src: .config/ncmpcpp/bindings
f_ranger.conf:
dst: ~/.config/ranger/rc.conf
src: .config/ranger/rc.conf
f_ranger_commands.py:
dst: ~/.config/ranger/commands.py
src: .config/ranger/commands.py
f_redshift.conf:
dst: ~/.config/redshift/redshift.conf
src: .config/redshift/redshift.conf
f_rofi-pass.conf:
dst: ~/.config/rofi-pass/config
src: .config/rofi-pass/config
f_rtv.cfg:
dst: ~/.config/rtv/rtv.cfg
src: .config/rtv/rtv.cfg
f_ssh.conf:
dst: ~/.ssh/config
src: .ssh/config
f_steam-native.desktop:
dst: ~/.local/share/applications/steam-native.desktop
src: .local/share/applications/steam-native.desktop
f_tdesktop_lang.strings:
dst: ~/.config/telegram-desktop/lang.strings
src: .config/telegram-desktop/lang.strings
f_tmux.conf:
dst: ~/.tmux.conf
src: .tmux.conf
f_yay_config.json:
dst: ~/.config/yay/config.json
src: .config/yay/config.json
f_youtube-dl_config:
dst: ~/.config/youtube-dl/config
src: .config/youtube-dl/config
f_youtube-viewer.conf:
dst: ~/.config/youtube-viewer/youtube-viewer.conf
src: .config/youtube-viewer/youtube-viewer.conf
f_zathurarc:
dst: ~/.config/zathura/zathurarc
src: .config/zathura/zathurarc
f_zprofile:
dst: ~/.zprofile
src: .zprofile
f_zshrc:
dst: ~/.zshrc
src: .zshrc
d_rofi:
src: .config/rofi
dst: ~/.config/rofi
d_zsh:
src: .config/zsh
dst: ~/.config/zsh
f_fonts.conf:
src: .config/fontconfig/fonts.conf
dst: ~/.config/fontconfig/fonts.conf
f_ignore:
src: .ignore
dst: ~/.ignore
f_nvimpager_init.vim:
src: .config/nvimpager/init.vim
dst: ~/.config/nvimpager/init.vim
profiles:
Media:
dotfiles:
- f_beets_config
- f_beets_whitelist
- f_abcde.conf
- d_mpv
- f_youtube-dl_config
- f_mpd.conf
Sway:
dotfiles:
- d_sway
- d_waybar
- d_rofi
- f_mako_config
- f_redshift.conf
- f_rofi-pass.conf
Pacman:
dotfiles:
- f_yay_config.json
- f_makepkg.conf
Mirkwood:
dotfiles:
- d_systemd
- f_tdesktop_lang.strings
- f_gitconfig
- f_mailcap
- f_zprofile
- f_mimeo_associations.txt
- f_mpdscribble.conf
- f_mpdris2.conf
- f_ranger_commands.py
- f_libra_config
- f_ncmpcpp_bindings
- f_zathurarc
- f_youtube-viewer.conf
- f_efm-langserver.yaml
- f_fonts.conf
include:
- Terminal
- Media
- Sway
- Pacman
ReekyRaspberry:
include:
- Terminal
Rivendell:
include:
- Terminal
- Media
- Pacman
Terminal:
dotfiles:
- f_nvimpager_init.vim
- f_ignore
- f_rtv.cfg
- d_zsh
- f_zshrc
- f_tmux.conf
- f_ranger.conf
- f_ssh.conf
- f_authorized_keys
- d_scripts
- d_nvim_config
- f_init.vim
- f_coc-settings.json
- f_gitconfig
- f_alacritty.yml
AnittaPC:
include:
- Terminal

139
config-root.yaml Normal file
View file

@ -0,0 +1,139 @@
config:
backup: true
banner: true
create: true
dotpath: root
ignoreempty: false
keepdot: true
link_dotfile_default: nolink
link_on_import: nolink
longkey: false
showdiff: false
workdir: ~/.config/sdotdrop
dotfiles:
f_60-uinput-permissions.rules:
dst: /etc/udev/rules.d/60-uinput-permissions.rules
src: etc/udev/rules.d/60-uinput-permissions.rules
d_bin:
dst: /usr/local/bin
src: usr/local/bin
f_99-sysctl.conf:
dst: /etc/sysctl.d/99-sysctl.conf
src: etc/sysctl.d/99-sysctl.conf
f_adb.service:
dst: /etc/systemd/system/adb.service
src: etc/systemd/system/adb.service
f_clamd.conf:
dst: /etc/clamav/clamd.conf
src: etc/clamav/clamd.conf
f_cryptissue:
dst: /etc/cryptissue
src: etc/cryptissue
f_default.pa:
dst: /etc/pulse/default.pa
src: etc/pulse/default.pa
f_detected.sh:
dst: /etc/clamav/detected.sh
src: etc/clamav/detected.sh
f_environment:
dst: /etc/environment
src: etc/environment
f_freetype2.sh:
dst: /etc/profile.d/freetype2.sh
src: etc/profile.d/freetype2.sh
f_iwd@.service:
dst: /etc/systemd/system/iwd@.service
src: etc/systemd/system/iwd@.service
f_loader.conf:
dst: /boot/loader/loader.conf
src: boot/loader/loader.conf
f_fonts.conf:
dst: /etc/fonts/local.conf
src: etc/fonts/local.conf
f_locale.conf:
dst: /etc/locale.conf
src: etc/locale.conf
f_locale.gen:
dst: /etc/locale.gen
src: etc/locale.gen
f_logind.conf:
dst: /etc/systemd/logind.conf
src: etc/systemd/logind.conf
f_bluetooth.conf:
dst: /etc/bluetooth/main.conf
src: etc/bluetooth/main.conf
f_pacman.conf:
dst: /etc/pacman.conf
src: etc/pacman.conf
f_pacserve.service.conf:
dst: /etc/pacserve/pacserve.service.conf
src: etc/pacserve/pacserve.service.conf
f_qemu.conf:
dst: /etc/libvirt/qemu.conf
src: etc/libvirt/qemu.conf
f_resolved.conf:
dst: /etc/systemd/resolved.conf
src: etc/systemd/resolved.conf
f_sshd_config:
dst: /etc/ssh/sshd_config
src: etc/ssh/sshd_config
f_timesyncd.conf:
dst: /etc/systemd/timesyncd.conf
src: etc/systemd/timesyncd.conf
f_welcomemessage.conf:
dst: /etc/welcomemessage.conf
src: etc/welcomemessage.conf
f_wifi_backend.conf:
dst: /etc/NetworkManager/conf.d/wifi_backend.conf
src: etc/NetworkManager/conf.d/wifi_backend.conf
f_override.conf:
src: etc/systemd/system/getty@tty1.service.d/override.conf
dst: /etc/systemd/system/getty@tty1.service.d/override.conf
f_rc-manager.conf:
src: etc/NetworkManager/conf.d/rc-manager.conf
dst: /etc/NetworkManager/conf.d/rc-manager.conf
profiles:
locale:
dotfiles:
- f_locale.conf
- f_locale.gen
pacman:
dotfiles:
- f_pacman.conf
- f_pacserve.service.conf
Mirkwood:
dotfiles:
- f_environment
- f_cryptissue
- f_welcomemessage.conf
- f_clamd.conf
- f_detected.sh
- d_bin
- f_adb.service
- f_bluetooth.conf
- f_resolved.conf
- f_qemu.conf
- f_default.pa
- f_iwd@.service
- f_loader.conf
- f_sshd_config
- f_logind.conf
- f_60-uinput-permissions.rules
- f_freetype2.sh
- f_fonts.conf
- f_timesyncd.conf
- f_99-sysctl.conf
- f_override.conf
- f_rc-manager.conf
include:
- locale
- pacman
Rivendell:
include:
- locale
- pacman
dotfiles:
- f_bluetooth.conf
- f_60-uinput-permissions.rules
- f_timesyncd.conf
- f_sshd_config

78
deploy.sh Executable file
View file

@ -0,0 +1,78 @@
#!/bin/bash
# Short url for this file: bit.ly/reekydots
# to run this, execute
# bash <(curl -sL bit.ly/reekydots)
# Run this to install my dotfiles on a fresh Arch Linux installation.
# This should work on any fresh Arch Linux install with an internet connection
# When asked a hostname, make sure it's already in the dotrop config,
# otherwise dotdrop won't install anything
export DOTREPO="$HOME/Git/dotfiles"
read -p "Hostname: " hostname
read -p "Install pkglist-extra? [y/n]: " extra
# install yay
sudo pacman -Syu --needed --noconfirm git wget base-devel python python-jinja python-pyaml python-docopt
cd ~
wget https://aur.archlinux.org/cgit/aur.git/snapshot/yay-bin.tar.gz
tar xfv yay-bin.tar.gz
cd yay-bin
makepkg -sic --noconfirm
cd ..
rm -r yay-bin*
yay -S --noconfirm --combinedupgrade --sudoloop --pgpfetch reflector
printf "\nUpdating mirrorlists, this might take a while"
sudo reflector --latest 200 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
# install dotfiles
mkdir ~/Git
git clone https://gitlab.com/ReekyMarko/dotfiles.git ~/Git/dotfiles
cd ~/Git/dotfiles
git submodule init
git submodule update
./dotdrop.sh -p "$hostname" install
sudo $DOTREPO/dotdrop.sh -p "$hostname" --cfg=$DOTREPO/global-config.yaml install
# setup locale
yay -S --noconfirm locale-en_xx
sudo locale-gen
# set network, timezone and hostname
sudo su -c " echo "$hostname" > /etc/hostname"
yay -S --noconfirm tzupdate
sudo timedatectl set-ntp true
sudo tzupdate
# install essentials
yay -S --needed - < pkglist
# install all other packages
if [[ "$extra" == "y" ]]; then
yay -S --noconfirm nodejs-lts-carbon
yay -S --needed - < pkglist-extra
fi
# install zplugin
mkdir ~/.zplugin
git clone https://github.com/zdharma/zplugin.git ~/.zplugin/bin
# install tmux plugin manager
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# change shell
chsh -s /bin/zsh
# enable autologin for the current user
mkdir /etc/systemd/system/getty@tty1.service.d
sudo su -c "cat <<CONFIG > /etc/systemd/system/getty@tty1.service.d/override.conf
ExecStart=
ExecStart=-/usr/bin/agetty --autologin $(who | sed 's/ .*//') --noclear %I $TERM
CONFIG"
printf "\nEverything done. Install display drivers and reboot"

1
dotdrop Submodule

@ -0,0 +1 @@
Subproject commit 8bebf7319dc02490bb82aa43b7edd3882240ab0f

21
home/.Xresources Normal file
View file

@ -0,0 +1,21 @@
! Snazzy - Converted from https://github.com/sindresorhus/iterm2-snazzy
! using https://github.com/richo/itermcolors2xdefaults
URxvt*background: #1e1f28
URxvt*foreground: #ebece6
URxvt*cursorColor: #e4e4e4
URxvt*color0: #000
URxvt*color1: #fb4245
URxvt*color2: #50fa7b
URxvt*color3: #f0fa8b
URxvt*color4: #49b9fe
URxvt*color5: #fb4cb3
URxvt*color6: #8be9fd
URxvt*color7: #ededec
URxvt*color8: #555555
URxvt*color9: #fb4245
URxvt*color10: #50fa7b
URxvt*color11: #f0fa8b
URxvt*color12: #49b9fe
URxvt*color13: #fb4cb3
URxvt*color14: #8be9fd
URxvt*color15: #ededec

89
home/.abcde.conf Normal file
View file

@ -0,0 +1,89 @@
# -----------------$HOME/.abcde.conf----------------- #
#
# A sample configuration file to convert music cds to
# FLAC using abcde version 2.7.2
#
# http://andrews-corner.org/linux/abcde/index.html
# -------------------------------------------------- #
# Encode tracks immediately after reading. Saves disk space, gives
# better reading of 'scratchy' disks and better troubleshooting of
# encoding process but slows the operation of abcde quite a bit:
LOWDISK=y
# Specify the method to use to retrieve the track information,
# the alternative is to specify 'musicbrainz':
CDDBMETHOD=cddb
# Make a local cache of cddb entries and then volunteer to use
# these entries when and if they match the cd:
CDDBCOPYLOCAL="y"
CDDBLOCALDIR="$HOME/.cddb"
CDDBLOCALRECURSIVE="y"
CDDBUSELOCAL="y"
# Specify the encoder to use for FLAC. In this case
# flac is the only choice.
FLACENCODERSYNTAX=flac
# Specify the path to the selected encoder. In most cases the encoder
# should be in your $PATH as I illustrate below, otherwise you will
# need to specify the full path. For example: /usr/bin/flac
FLAC=flac
# Specify your required encoding options here. Multiple options can
# be selected as '--best --another-option' etc.
# Overall bitrate is about 880 kbs/s with level 8.
FLACOPTS='-s -e -V -8'
# Output type for FLAC.
OUTPUTTYPE="flac"
# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac. New to abcde 2.7 is 'libcdio'.
CDROMREADERSYNTAX=cdparanoia
# Give the location of the ripping program and pass any extra options,
# if using libcdio set 'CD_PARANOIA=cd-paranoia'.
CDPARANOIA=cdparanoia
CDPARANOIAOPTS="--never-skip=40"
# Give the location of the CD identification program:
CDDISCID=cd-discid
# Give the base location here for the encoded music files.
OUTPUTDIR="$HOME/Documents/Rip"
# The default actions that abcde will take.
ACTIONS=cddb,playlist,read,encode,tag,move,clean
# Decide here how you want the tracks labelled for a standard 'single-artist',
# multi-track encode and also for a multi-track, 'various-artist' encode:
OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}'
VAOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}'
# Decide here how you want the tracks labelled for a standard 'single-artist',
# single-track encode and also for a single-track 'various-artist' encode.
# (Create a single-track encode with 'abcde -1' from the commandline.)
ONETRACKOUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}'
VAONETRACKOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}'
# Create playlists for single and various-artist encodes. I would suggest
# commenting these out for single-track encoding.
PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}.m3u'
VAPLAYLISTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}.m3u'
# This function takes out dots preceding the album name, and removes a grab
# bag of illegal characters. It allows spaces, if you do not wish spaces add
# in -e 's/ /_/g' after the first sed command.
mungefilename ()
{
echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]"
}
# What extra options?
MAXPROCS=2 # Run a few encoders simultaneously
PADTRACKS=y # Makes tracks 01 02 not 1 2
EXTRAVERBOSE=2 # Useful for debugging
COMMENT='abcde version 2.7.2' # Place a comment...
EJECTCD=y # Please eject cd when finished :-)

24347
home/.config/aacs/KEYDB.cfg Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,182 @@
window:
dimensions:
columns: 0
lines: 0
padding:
x: 30
y: 20
dynamic_padding: false
decorations: full
scrolling:
history: 10000
multiplier: 3
faux_multiplier: 3
auto_scroll: false
tabspaces: 8
font:
normal:
family: Hack Nerd Font Mono
size: 12.0
offset:
x: 0
y: 0
glyph_offset:
x: 0
y: 0
use_thin_strokes: true
draw_bold_text_with_bright_colors: true
colors:
# Default colors
primary:
# hard contrast: background = '0x1d2021'
background: '0x282828'
# soft contrast: background = '0x32302f'
foreground: '0xebdbb2'
# Normal colors
normal:
black: '0x282828'
red: '0xcc241d'
green: '0x98971a'
yellow: '0xd79921'
blue: '0x458588'
magenta: '0xb16286'
cyan: '0x689d6a'
white: '0xa89984'
# Bright colors
bright:
black: '0x928374'
red: '0xfb4934'
green: '0xb8bb26'
yellow: '0xfabd2f'
blue: '0x83a598'
magenta: '0xd3869b'
cyan: '0x8ec07c'
white: '0xebdbb2'
visual_bell:
animation: EaseOutExpo
duration: 0
color: '0xffffff'
background_opacity: 1.0
mouse_bindings:
- { mouse: Middle, action: PasteSelection }
mouse:
double_click: { threshold: 300 }
triple_click: { threshold: 300 }
hide_when_typing: false
url:
modifiers: None
selection:
semantic_escape_chars: ",│`|:\"' ()[]{}<>"
save_to_clipboard: false
dynamic_title: true
cursor:
style: Block
unfocused_hollow: true
live_config_reload: true
enable_experimental_conpty_backend: true
alt_send_esc: true
key_bindings:
- { key: Paste, action: Paste }
- { key: Copy, action: Copy }
- { key: L, mods: Control, action: ClearLogNotice }
- { key: L, mods: Control, chars: "\x0c" }
- { key: Home, chars: "\x1bOH", mode: AppCursor }
- { key: Home, chars: "\x1b[H", mode: ~AppCursor }
- { key: End, chars: "\x1bOF", mode: AppCursor }
- { key: End, chars: "\x1b[F", mode: ~AppCursor }
- { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt }
- { key: PageUp, mods: Shift, chars: "\x1b[5;2~", mode: Alt }
- { key: PageUp, mods: Control, chars: "\x1b[5;5~" }
- { key: PageUp, chars: "\x1b[5~" }
- { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt }
- { key: PageDown, mods: Shift, chars: "\x1b[6;2~", mode: Alt }
- { key: PageDown, mods: Control, chars: "\x1b[6;5~" }
- { key: PageDown, chars: "\x1b[6~" }
- { key: Tab, mods: Shift, chars: "\x1b[Z" }
- { key: Back, chars: "\x7f" }
- { key: Back, mods: Alt, chars: "\x1b\x7f" }
- { key: Insert, chars: "\x1b[2~" }
- { key: Delete, chars: "\x1b[3~" }
- { key: Left, mods: Shift, chars: "\x1b[1;2D" }
- { key: Left, mods: Control, chars: "\x1b[1;5D" }
- { key: Left, mods: Alt, chars: "\x1b[1;3D" }
- { key: Left, chars: "\x1b[D", mode: ~AppCursor }
- { key: Left, chars: "\x1bOD", mode: AppCursor }
- { key: Right, mods: Shift, chars: "\x1b[1;2C" }
- { key: Right, mods: Control, chars: "\x1b[1;5C" }
- { key: Right, mods: Alt, chars: "\x1b[1;3C" }
- { key: Right, chars: "\x1b[C", mode: ~AppCursor }
- { key: Right, chars: "\x1bOC", mode: AppCursor }
- { key: Up, mods: Shift, chars: "\x1b[1;2A" }
- { key: Up, mods: Control, chars: "\x1b[1;5A" }
- { key: Up, mods: Alt, chars: "\x1b[1;3A" }
- { key: Up, chars: "\x1b[A", mode: ~AppCursor }
- { key: Up, chars: "\x1bOA", mode: AppCursor }
- { key: Down, mods: Shift, chars: "\x1b[1;2B" }
- { key: Down, mods: Control, chars: "\x1b[1;5B" }
- { key: Down, mods: Alt, chars: "\x1b[1;3B" }
- { key: Down, chars: "\x1b[B", mode: ~AppCursor }
- { key: Down, chars: "\x1bOB", mode: AppCursor }
- { key: F1, chars: "\x1bOP" }
- { key: F2, chars: "\x1bOQ" }
- { key: F3, chars: "\x1bOR" }
- { key: F4, chars: "\x1bOS" }
- { key: F5, chars: "\x1b[15~" }
- { key: F6, chars: "\x1b[17~" }
- { key: F7, chars: "\x1b[18~" }
- { key: F8, chars: "\x1b[19~" }
- { key: F9, chars: "\x1b[20~" }
- { key: F10, chars: "\x1b[21~" }
- { key: F11, chars: "\x1b[23~" }
- { key: F12, chars: "\x1b[24~" }
- { key: F1, mods: Shift, chars: "\x1b[1;2P" }
- { key: F2, mods: Shift, chars: "\x1b[1;2Q" }
- { key: F3, mods: Shift, chars: "\x1b[1;2R" }
- { key: F4, mods: Shift, chars: "\x1b[1;2S" }
- { key: F5, mods: Shift, chars: "\x1b[15;2~" }
- { key: F6, mods: Shift, chars: "\x1b[17;2~" }
- { key: F7, mods: Shift, chars: "\x1b[18;2~" }
- { key: F8, mods: Shift, chars: "\x1b[19;2~" }
- { key: F9, mods: Shift, chars: "\x1b[20;2~" }
- { key: F10, mods: Shift, chars: "\x1b[21;2~" }
- { key: F11, mods: Shift, chars: "\x1b[23;2~" }
- { key: F12, mods: Shift, chars: "\x1b[24;2~" }
- { key: F1, mods: Control, chars: "\x1b[1;5P" }
- { key: F2, mods: Control, chars: "\x1b[1;5Q" }
- { key: F3, mods: Control, chars: "\x1b[1;5R" }
- { key: F4, mods: Control, chars: "\x1b[1;5S" }
- { key: F5, mods: Control, chars: "\x1b[15;5~" }
- { key: F6, mods: Control, chars: "\x1b[17;5~" }
- { key: F7, mods: Control, chars: "\x1b[18;5~" }
- { key: F8, mods: Control, chars: "\x1b[19;5~" }
- { key: F9, mods: Control, chars: "\x1b[20;5~" }
- { key: F10, mods: Control, chars: "\x1b[21;5~" }
- { key: F11, mods: Control, chars: "\x1b[23;5~" }
- { key: F12, mods: Control, chars: "\x1b[24;5~" }
- { key: F1, mods: Alt, chars: "\x1b[1;6P" }
- { key: F2, mods: Alt, chars: "\x1b[1;6Q" }
- { key: F3, mods: Alt, chars: "\x1b[1;6R" }
- { key: F4, mods: Alt, chars: "\x1b[1;6S" }
- { key: F5, mods: Alt, chars: "\x1b[15;6~" }
- { key: F6, mods: Alt, chars: "\x1b[17;6~" }
- { key: F7, mods: Alt, chars: "\x1b[18;6~" }
- { key: F8, mods: Alt, chars: "\x1b[19;6~" }
- { key: F9, mods: Alt, chars: "\x1b[20;6~" }
- { key: F10, mods: Alt, chars: "\x1b[21;6~" }
- { key: F11, mods: Alt, chars: "\x1b[23;6~" }
- { key: F12, mods: Alt, chars: "\x1b[24;6~" }
- { key: F1, mods: Super, chars: "\x1b[1;3P" }
- { key: F2, mods: Super, chars: "\x1b[1;3Q" }
- { key: F3, mods: Super, chars: "\x1b[1;3R" }
- { key: F4, mods: Super, chars: "\x1b[1;3S" }
- { key: F5, mods: Super, chars: "\x1b[15;3~" }
- { key: F6, mods: Super, chars: "\x1b[17;3~" }
- { key: F7, mods: Super, chars: "\x1b[18;3~" }
- { key: F8, mods: Super, chars: "\x1b[19;3~" }
- { key: F9, mods: Super, chars: "\x1b[20;3~" }
- { key: F10, mods: Super, chars: "\x1b[21;3~" }
- { key: F11, mods: Super, chars: "\x1b[23;3~" }
- { key: F12, mods: Super, chars: "\x1b[24;3~" }
- { key: NumpadEnter, chars: "\n" }

View file

@ -0,0 +1,9 @@
continue
file-allocation=falloc
log-level=warn
max-connection-per-server=4
max-concurrent-downloads=3
max-overall-download-limit=0
min-split-size=5M
enable-http-pipelining=true
rpc-secret="{{@@ env['PASS_ARIA2'] @@}}"

View file

@ -0,0 +1,45 @@
directory: ~/Music
library: ~/Music/beets.db
plugins:
- acousticbrainz
- check
- edit
- fetchart
- follow
- fuzzy
- info
- lastgenre
- lyrics
- mbcollection
- mpdupdate
- play
- replaygain
- thumbnails
- web
import:
copy: no
move: yes
link: no
lastgenre:
whitelist: ~/.config/beets/whitelist
lyrics:
fallback: ''
play:
command: mpv
mpd:
host: localhost
port: 6600
follow:
email: reekymarko@reekynet.com
password: "{{@@ env['PASS_MUSPY'] @@}}"
userid: w8njp08ude90mfzsgumjhqinnirj4g
auto: yes
replaygain:
backend: gstreamer
auto: yes
musicbrainz:
user: ReekyMarko
pass: "{{@@ env['PASS_MUSICBRAINZ'] @@}}"
mbcollection:
auto: "yes"
collection: "a4955b5c-db7f-4e27-9887-f77f820bad34"

View file

@ -0,0 +1,37 @@
avantgarde
experimental music
lofi
blues
classical
comedy
comedy music
comedy rock
humor
parody music
standup
country
country rap
country rock
rockabilly
easy listening
electronic
drum and bass
hardcore
house
techno
uk garage
dubstep
rap
folk
hip hop
countryrap
rap rock
jazz
pop
rhythm and blues
rock
hard rock
alternative rock
heavy metal
punk rock
reggae

75
home/.config/bspwm/bspwmrc Executable file
View file

@ -0,0 +1,75 @@
#! /bin/sh
# set screen timeout
xset s 300 120
xset dpms 422
# screen locker
xss-lock -n ~/Scripts/dim-screen.sh -- evenbetterlockscreen -l &
# lock screen
evenbetterlockscreen -l &
# set wallpaper
wal -R
# Start hotkey daemon
sxhkd &
bspc monitor -d web term chat mail music 6 7
bspc config border_width 0
bspc config window_gap 37
bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc rule -a TelegramDesktop desktop=^3
bspc rule -a Franz desktop=^3
bspc rule -a Thunderbird desktop=^4
bspc rule -a Zathura state=tiled
bspc rule -a Nightly:Navigator state=tiled
bspc rule -a kdeconnect-indicator state=tiled
bspc rule -a libreoffice state=tiled
bspc rule -a Screenkey manage=off
bspc config super mod4
bspc config pointer_action1 move
bspc config pointer_action2 none
bspc config pointer_action3 resize_corner
bspc config click_to_focus true
# set pywal colors
. "${HOME}/.cache/wal/colors.sh"
bspc config normal_border_color "$color1"
bspc config active_border_color "$color2"
bspc config focused_border_color "$color15"
bspc config presel_feedback_color "$color1"
# set cursor style
xsetroot -cursor_name left_ptr
# startup applications
joplin-desktop &
compton -f --config ~/.config/compton/config &
redshift &
/usr/lib/xfce4/notifyd/xfce4-notifyd &
telegram-desktop &
setxkbmap eu &
/usr/lib/kdeconnectd &
kdeconnect-indicator &
udiskie --tray &
xfce4-clipman &
/usr/bin/gnome-keyring-daemon --start --components=secrets &
~/Scripts/polybar.sh &
/usr/lib/mate-polkit/polkit-mate-authentication-agent-1 &
blueberry-tray &
nm-applet &
thunderbird &
mpDris2 &
# hide mouse cursor
unclutter -idle 1 &

View file

@ -0,0 +1,53 @@
backend = "glx";
glx-no-stencil = true;
glx-copy-from-front = false;
glx-swap-method = 1;
inactive-opacity-override = true;
# Fix tearing
vsync = "opengl-swc";
unredir-if-possible = false;
paint-on-overlay = true;
# Shadow
shadow = true; # Enabled client-side shadows on windows.
no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true; # Don't draw shadows on DND windows.
shadow-radius = 10; # The blur radius for shadows. (default 12)
shadow-offset-x = -15; # The left offset for shadows. (default -15)
shadow-offset-y = -15; # The top offset for shadows. (default -15)
shadow-opacity = 0.5;
menu-opacity = 1;
shadow-exclude = [
"class_g = 'slop'",
"n:e:Notification",
"class_g ?= 'Xfce4-notifyd'",
#"class_g ?= 'Xfce4-power-manager'"
];
opacity-rule = [
"50:class_g = 'Bspwm' && class_i = 'presel_feedback'",
"99:class_g = 'slop'"
];
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
# Fading
fading = true; # Fade windows during opacity changes.
fade-delta = 4; # The time between steps in a fade in milliseconds. (default 10).
fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028).
fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03).
no-fading-openclose = false; # Fade windows in/out when opening/closing
detect-client-opacity = true; # This prevents opacity being ignored for some apps. For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
#Window type settings
wintypes:
{
tooltip = { fade = true; shadow = false; };
menu = { shadow = false; };
dropdown_menu = { shadow = false; };
popup_menu = { shadow = false; };
};

View file

@ -0,0 +1,6 @@
languages:
markdown:
lint-command: 'yarn --cwd ~/.bin/node run markdownlint -s'
lint-stdin: true
lint-formats:
- '%f: %l: %m'

View file

@ -0,0 +1,3 @@
_JAVA_AWT_WM_NONREPARENTING=1
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
JAVA_FONTS=/usr/share/fonts/TTF

View file

@ -0,0 +1,26 @@
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Overpass</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Overpass</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Hack Nerd Font Mono</family>
</prefer>
</alias>
</fontconfig>

View file

@ -0,0 +1,3 @@
VteTerminal, vte-terminal {
padding: 40px;
}

266
home/.config/i3/config Normal file
View file

@ -0,0 +1,266 @@
# ~/.config/i3/config
client.focused #3F8AC2 #096BAA #00BAA7 #00DA8E
client.focused_inactive #333333 #5F676A #ffffff #484e50
client.unfocused #333333 #424242 #888888 #292d2e
client.urgent #C10004 #900000 #ffffff #900000
# GAPS
gaps inner 20
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
# Modes for controlling gaps
mode "$mode_gaps" {
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_inner" {
bindsym plus gaps inner current plus 5
bindsym minus gaps inner current minus 5
bindsym 0 gaps inner current set 0
bindsym Shift+plus gaps inner all plus 5
bindsym Shift+minus gaps inner all minus 5
bindsym Shift+0 gaps inner all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
bindsym plus gaps outer current plus 5
bindsym minus gaps outer current minus 5
bindsym 0 gaps outer current set 0
bindsym Shift+plus gaps outer all plus 5
bindsym Shift+minus gaps outer all minus 5
bindsym Shift+0 gaps outer all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
set $mod mod4
set $term termite
bindsym $mod+d exec --no-startup-id rofi -show-icons -show drun -config /home/reekymarko/.config/rofi/config
bindsym $mod+p exec --no-startup-id rofi-pass --last-used
bindsym $mod+Shift+p exec --no-startup-id rofi-pass --bmarks --last-used
font pango:System San Francisco Display 11
new_window 1pixel
hide_edge_borders vertical
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec --no-startup-id $term
# kill focused window
bindsym $mod+Shift+q kill
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+y split h
# split in vertical orientation
bindsym $mod+x split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
focus_follows_mouse no
# focus the child container
#bindsym $mod+d focus child
# open with clipboard contents
bindsym $mod+v exec --no-startup-id mpv --ytdl-format="bestvideo[ext=mp4][height<=?1080]+bestaudio[ext=m4a]" $(xclip -o)
bindym $mod+Shift+b exec --no-startup-id firefox-nightly $(xclip -o)
#workspace names
set $workspace1 "1: Start "
set $workspace2 "2"
set $workspace3 "3"
set $workspace4 "4"
set $workspace5 "5"
set $workspace6 "6"
set $workspace7 "7"
set $workspace8 "8: Mail "
set $workspace9 "9: Messaging "
set $workspace10 "10: Music "
# switch to workspace
bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10
# classes
for_window [class="TelegramDesktop"] move to workspace $workspace9
for_window [class="Thunderbird"] move to workspace $workspace8
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec --no-startup-id i3-msg exit
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
set $bg-color #263238
set $inactive-bg-color #263238
set $text-color #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color #E53935
# window colors
# border background text indicator
client.focused $bg-color $bg-color $text-color #00ff00
client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
client.urgent $urgent-bg-color $urgent-bg-color $text-color #00ff00
# pulseaudio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -D pulse sset Master 5%+ # increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -D pulse sset Master 5%- # decrease sound volume
bindsym XF86AudioMute exec --no-startup-id amixer -D pulse set Master 1+ toggle # mute sound
# sreen brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 5 # increase screen brightness
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 5 # decrease screen brightness
# screenshot and screencast
bindsym Print exec --no-startup-id "maim -u -s -l -c 0.157,0.333,0.466,0.4 | xclip -selection clipboard -t image/png && canberra-gtk-play -i camera-shutter"
bindsym $mod+Print exec --no-startup-id ~/scripts/record-screen.sh
# mpd controls
bindsym XF86AudioNext exec --no-startup-id mpc next
bindsym XF86AudioPrev exec --no-startup-id mpc prev
bindsym XF86AudioPlay exec --no-startup-id mpc toggle
bindsym XF86AudioStop exec --no-startup-id mpc clear
# connect bluetooth headset
bindsym $mod+c exec --no-startup-id bluetoothctl connect 17:08:01:0D:09:33
# connect bluetooth speaker
bindsym $mod+Shift+c exec --no-startup-id bluetoothctl connect 27:59:BE:CE:45:42
# lock screen
bindsym Control+Shift+l exec --no-startup-id evenbetterlockscreen -l
# open browser
bindsym $mod+b exec --no-startup-id firefox-nightly
{%@@ if profile == "ReekyPC" @@%}
# desktop only
exec_always --no-startup-id ~/scripts/desktop_screenlayout.sh
{%@@ endif @@%}
# autostart applications
exec_always --no-startup-id ~/Scripts/polybar.sh
exec --no-startup-id redshift
exec --no-startup-id unclutter
exec --no-startup-id nm-applet
exec --no-startup-id compton -f --config ~/.config/compton/compton.conf
exec --no-startup-id LANG=en_DK.UTF-8 telegram-desktop
exec --no-startup-id setxkbmap eu
exec --no-startup-id blueberry-tray
exec --no-startup-id mpDris2
exec --no-startup-id /usr/lib/kdeconnectd
exec --no-startup-id kdeconnect-indicator
exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd
exec --no-startup-id udiskie --tray
exec --no-startup-id pamac-tray
exec --no-startup-id xfce4-clipman
exec --no-startup-id thunderbird
exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=secrets
exec --no-startup-id evenbetterlockscreen -w
exec --no-startup-id evenbetterlockscreen -l

View file

@ -0,0 +1,132 @@
# ~/.config/i3/config
set $mod mod4
set $term alacritty
bindsym $mod+d exec --no-startup-id rofi -show-icons -show drun -config /home/reekymarko/.config/rofi/config
font pango:System San Francisco Display 11
new_window 1pixel
hide_edge_borders vertical
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec --no-startup-id $term
# kill focused window
bindsym $mod+w kill
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+y split h
# split in vertical orientation
bindsym $mod+x split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
focus_follows_mouse no
# focus the child container
#bindsym $mod+d focus child
# open with clipboard contents
bindsym $mod+v exec --no-startup-id mpv --ytdl-format="bestvideo[ext=mp4][height<=?1080]+bestaudio[ext=m4a]" $(xclip -o)
bindym $mod+Shift+b exec --no-startup-id firefox-nightly $(xclip -o)
#workspace names
set $workspace1 "1: Start "
set $workspace2 "2"
set $workspace3 "3"
set $workspace4 "4"
set $workspace5 "5"
set $workspace6 "6"
set $workspace7 "7"
set $workspace8 "8: Mail "
set $workspace9 "9: Messaging "
set $workspace10 "10: Music "
# switch to workspace
bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec --no-startup-id i3-msg exit
# pulseaudio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -D pulse sset Master 5%+ # increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -D pulse sset Master 5%- # decrease sound volume
bindsym XF86AudioMute exec --no-startup-id amixer -D pulse set Master 1+ toggle # mute sound
# open browser
bindsym $mod+b exec --no-startup-id firefox-nightly
# window rules
for_window [class="Steam"] move to workspace $workspace2
# autostart applications
exec --no-startup-id setxkbmap eu
exec --no-startup-id steam-native
exec --no-startup-id kodi

28
home/.config/khal/config Normal file
View file

@ -0,0 +1,28 @@
[calendars]
[[birthdays]]
path = ~/.calendars/contact_birthdays
type = calendar
color = light green
readonly = True
[[school]]
path = ~/.calendars/school
type = calendar
color = light green
[[personal]]
path = ~/.calendars/personal
type = calendar
color = light green
[[card_local]]
path = ~/.contacts/*
type = discover
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
longdateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdatetimeformat = %Y-%m-%d %H:%M

View file

@ -0,0 +1,28 @@
# example configuration file for khard version >= 0.11.0
# place it under $HOME/.config/khard/khard.conf
[addressbooks]
[[contacts]]
path = ~/.contacts
[general]
debug = no
default_action = list
editor = vim
merge_editor = vimdiff
[contact table]
# display names by first or last name: first_name / last_name
display = first_name
# group by address book: yes / no
group_by_addressbook = no
# reverse table ordering: yes / no
reverse = no
# append nicknames to name column: yes / no
show_nicknames = no
# show uid table column: yes / no
show_uids = yes
# sort by first or last name: first_name / last_name
sort = last_name
# localize dates: yes / no
localize_dates = yes

View file

@ -0,0 +1,2 @@
MPDAddress = "127.0.0.1:6600"
ListenbrainzToken = "{{@@ env['PASS_LISTENBRAINZ'] @@}}"

6
home/.config/mako/config Normal file
View file

@ -0,0 +1,6 @@
background-color=#282828
text-color=#EBDBB2
border-color=#F7B125
icons=1
default-timeout=5000
max-visible=6

View file

@ -0,0 +1,41 @@
mpvq %U
^https?://invidio.us/.*
mpvq %U
^https?://(m.)?(www.)?youtube.com/watch\?.*v=
mpvq %U
^https?://(www.)?youtube.com/playlist\?.*list=
mpvq %U
^https?://(www.)?youtu.be/
mpvq %U
^https?://(www.)?(m.)?twitch.tv/
mpvq %U
^https?://(?:[a-z0-9\-]+\.)+[a-z]{2,6}(?:/[^/#?]+)+\.(?:mp4|mkv|webm|avi|3gp|gif|gifv)
mpvq %U
^https?://www.facebook.com/.*/videos/
mpvq %U
^https?://gfycat.com/.*
mpvq %U
^https?://vimeo.com/.*
mpvq %U
^https?://v.redd.it/.*
imgurviewer %U
^https?://(www.)?imgur.com/a/
imgurviewer %U
^https?://(www.)?imgur.com/gallery/
imageviewer %U
^https?://(?:[a-z0-9\-]+\.)+[a-z]{2,6}(?:/[^/#?]+)+\.(?:jpg|jpeg|png|svg)
zathura %U
^https?://(?:[a-z0-9\-]+\.)+[a-z]{2,6}(?:/[^/#?]+)+\.(?:pdf)

View file

@ -0,0 +1,14 @@
#[Connection]
#host = localhost
#port = 6600
#password = {{@@ env['PASS_MPD'] @@}}
#[Library]
#music_dir = ~/Music
#cover_regex = ^(album|cover|\.?folder|front).*\.(gif|jpeg|jpg|png)$
[Bling]
#mmkeys = True
notify = False
#Urgency of the notification: 0 for low, 1 for medium and 2 for high.
#notify_urgency = 0

20
home/.config/mpd/mpd.conf Normal file
View file

@ -0,0 +1,20 @@
music_directory "~/Music"
playlist_directory "~/Music/Playlists"
db_file "~/.mpd/database"
log_file "~/.mpd/log"
pid_file "~/.mpd/pid"
state_file "~/.mpd/state"
sticker_file "~/.mpd/sticker.sql"
input {
plugin "curl"
}
audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
audio_output {
type "pulse"
name "pulse audio"
}

View file

@ -0,0 +1,11 @@
Alt+LEFT add video-pan-x -0.1
Alt+h add video-pan-x -0.1
Alt+DOWN add video-pan-y +0.1
Alt+j add video-pan-y +0.1
Alt+UP add video-pan-y -0.1
Alt+k add video-pan-y -0.1
Alt+RIGHT add video-pan-x +0.1
Alt+l add video-pan-x +0.1

124
home/.config/mpv/mpv.conf Normal file
View file

@ -0,0 +1,124 @@
#############
# Video #
#############
# Hardware decoding
vo=gpu
hwdec=vaapi
hwdec-codecs=all
{%@@ if profile == "Mirkwood" @@%}
gpu-context=wayland
{%@@ elif profile == "Rivendell" @@%}
ao=alsa
{%@@ endif @@%}
# Interpolation
#profile=gpu-hq
#scale=ewa_lanczossharp
#cscale=ewa_lanczossharp
#dscale=mitchell
#video-sync=display-resample
#interpolation=yes
#tscale=box
#tscale-window=sphinx
#tscale-radius=1.0
#tscale-clamp=0.0
#############
# Audio #
#############
pulse-buffer=50 # using a large buffer causes seeking issues
audio-pitch-correction=yes # automatically insert scaletempo when playing with higher speed
#############
# Plugins/misc #
#############
# Mpris plugin
script=/usr/lib/mpv/mpris.so
# Acestream plugin
script=/usr/lib/mpv/mpv-acestream.lua
# Start ipc server
input-ipc-server=/tmp/mpvsocket
# set youtube-dl max res to 1080
ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]
#############
# Languages #
#############
slang=eng,en,enUS,en-US,fi,fiFI,fi-FI # automatically select these subtitles (decreasing priority)
alang=eng,en,enUS,en-US,fi,fiFI,fi-FI # automatically select these audio tracks (decreasing priority)
ytdl-raw-options=sub-lang="en,eng,enUS,en-US,fi,fiFI,fi-FI"
#############
# Subtitles #
#############
no-sub # subtitles off on startup
demuxer-mkv-subtitle-preroll # try to correctly show embedded subs when seeking
sub-auto=fuzzy # external subs don't have to match the file name exactly to autoload
sub-file-paths=ass:srt:sub:subs:subtitles # search for external subs in the listed subdirectories
embeddedfonts=yes # use embedded fonts for SSA/ASS subs
sub-ass-force-style=Kerning=yes # allows you to override style parameters of ASS scripts
# the following options only apply to subtitles without own styling (i.e. not ASS but e.g. SRT)
sub-font="Overpass"
sub-font-size=45
sub-color="#FFFFFFFF"
sub-border-color="#FF262626"
sub-border-size=3.2
sub-shadow-offset=1
sub-shadow-color="#33000000"
sub-spacing=0.5
#############
# OSD / OSC #
#############
osd-font="Overpass"
osd-font-size=30
osd-color="#ffffffff" # ARGB format
osd-border-color="#ff151515" # ARGB format
osd-bar-align-y=0 # progress bar y alignment (-1 top, 0 centered, 1 bottom)
osd-border-size=2 # size for osd text and progress bar
osd-shadow-offset=1 # pixel width for osd text and progress bar
osd-bar-w=60 # width of " " "
osd-shadow-color="#11000000"
osd-fractions
###################################
# Protocol Specific Configuration #
###################################
[protocol.https]
cache=yes
user-agent='Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0'
[protocol.http]
cache=yes
user-agent='Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0'
[extension.gif]
cache=no
no-pause
loop-file=yes
[extension.gifv]
cache=no
no-pause
loop-file=yes
# Profile for 4k videos
[4k]
ytdl-format="bestvideo[height<=2160]+bestaudio/best[height<=2160]"
[best]
ytdl-format="bestvideo+bestaudio"
# Use vulkan and hwdec
[vulkan]
gpu-api=vulkan
gpu-context=waylandvk
hwdec=vaapi-copy

View file

@ -0,0 +1 @@
hidetimeout=2000

View file

@ -0,0 +1,30 @@
-- default keybinding: b
-- add the following to your input.conf to change the default keybinding:
-- keyname script_binding auto_load_subs
local utils = require 'mp.utils'
function display_error()
mp.msg.warn("Subtitle download failed: ")
mp.osd_message("Subtitle download failed")
end
function load_sub_fn()
path = mp.get_property("path")
srt_path = string.gsub(path, "%.%w+$", ".srt")
t = { args = { "subliminal", "download", "-s", "-f", "-l", "en", path } }
mp.osd_message("Searching subtitle")
res = utils.subprocess(t)
if res.error == nil then
if mp.commandv("sub_add", srt_path) then
mp.msg.warn("Subtitle download succeeded")
mp.osd_message("Subtitle '" .. srt_path .. "' download succeeded")
else
display_error()
end
else
display_error()
end
end
mp.add_key_binding("b", "auto_load_subs", load_sub_fn)

View file

@ -0,0 +1,367 @@
local assdraw = require 'mp.assdraw'
local W = 0
local H = 0
-- 2D array of size W*H that's addressed via gField[x][y]. Each entry is a
-- table, with the following fields:
-- is_mine: true or false
-- area_mines: mine count in the 3x3 surrounding area
-- is_covered: true or false, for visibility
-- flag: flag put by user, one of FLAG_*
local gField = nil
local FLAG_NONE = "" -- not flagged
local FLAG_MINE = "" -- "⚐" -- flagged as containing mine
local FLAG_MAYBE_MINE = "!" -- flagged as maybe containing mine
local FLAG_MAYBE_SAFE = "?" -- flagged as maybe empty
local STATUS_PLAYING = "playing"
local STATUS_WON = "won"
local STATUS_LOST = "lost"
local gStatus = nil
local gMines = 0
local gX = 0
local gY = 0
local gNeedRefresh = false
local gHidden = true
local gTransparent = false
local PRESETS = {
-- taken from kmines
{ name = "easy", w = 9, h = 9, mines = 10 },
{ name = "medium", w = 16, h = 16, mines = 40 },
{ name = "hard", w = 30, h = 16, mines = 99 },
}
local gCurrentPreset = 2
function init_field()
local preset = PRESETS[gCurrentPreset]
gStatus = STATUS_PLAYING
gField = {}
W = preset.w
H = preset.h
gMines = math.min(preset.mines, W * H - 1)
gX = 1
gY = 1
for x = 1, W do
gField[x] = {}
for y = 1, H do
gField[x][y] = {
is_mine = false,
area_mines = 0,
is_covered = true,
flag = FLAG_NONE,
}
end
end
-- place mines using the dumbfuck algorithm
local place_mines = gMines
while place_mines > 0 do
local x = math.random(1, W)
local y = math.random(1, H)
if not gField[x][y].is_mine then
gField[x][y].is_mine = true
place_mines = place_mines - 1
end
end
-- pick a random start position (also using dumbfuck algorithm)
for i = 1, 1000000 do
local x = math.random(1, W)
local y = math.random(1, H)
if not gField[x][y].is_mine then
gX = x
gY = y
break
end
end
-- compute proximities after mines have been placed
for y = 1, H do
for x = 1, W do
local tile = gField[x][y]
for a_x = -1, 1 do
for a_y = -1, 1 do
local t_x = x + a_x
local t_y = y + a_y
if t_x >= 1 and t_x <= W and t_y >= 1 and t_y <= H and
gField[t_x][t_y].is_mine
then
tile.area_mines = tile.area_mines + 1
end
end
end
end
end
uncover()
check_status()
gNeedRefresh = true
end
function uncover_at(x, y)
if x < 1 or x > W or y < 1 or y > H then
return
end
local tile = gField[x][y]
if not tile.is_covered then
return
end
tile.is_covered = false
if tile.is_mine then
return -- lost anyway
end
-- uncover mines as far as it goes
-- apparently, the standard thing to do is recursively uncovering all
-- tiles which have 0 neightbours - tiles with 1 or more neighbours are
-- uncovered, but not recursively
if tile.area_mines == 0 then
for a_x = -1, 1 do
for a_y = -1, 1 do
uncover_at(x + a_x, y + a_y)
end
end
end
gNeedRefresh = true
end
function check_status()
if gStatus ~= STATUS_PLAYING then
return
end
local won = true
local lost = false
for y = 1, H do
for x = 1, W do
local tile = gField[x][y]
won = won and (tile.is_mine == tile.is_covered)
lost = lost or (tile.is_mine and not tile.is_covered)
end
end
if lost then
gStatus = STATUS_LOST
gNeedRefresh = true
elseif won then
gStatus = STATUS_WON
gNeedRefresh = true
end
end
function uncover()
if gStatus ~= STATUS_PLAYING and not gField[gX][gY].is_covered then
init_field()
render()
return
end
uncover_at(gX, gY)
check_status()
render()
end
function flag()
local tile = gField[gX][gY]
local cycle = {FLAG_NONE, FLAG_MINE, FLAG_MAYBE_MINE, FLAG_MAYBE_SAFE}
for i = 1, #cycle do
if tile.flag == cycle[i] then
tile.flag = cycle[(i - 1 + 1) % #cycle + 1]
break
end
end
if not tile.is_covered then
tile.flag = FLAG_NONE
end
force_render()
end
function move(x, y)
gX = math.min(math.max(gX + x, 1), W)
gY = math.min(math.max(gY + y, 1), H)
force_render()
end
function force_render()
gNeedRefresh = true
render()
end
function render()
if not gNeedRefresh then
return
end
if gHidden then
mp.set_osd_ass(1280, 720, "")
return
end
local canvas_w = 1280
local canvas_h = 720
local dw, dh, da = mp.get_osd_size()
if dw ~= nil and dw > 0 and dh > 0 then
canvas_w = dw / dh * canvas_h
end
local tile_wh = 32
local o_x = canvas_w / 2 - tile_wh * W / 2
local o_y = canvas_h / 2 - tile_wh * (H + 2) / 2 + tile_wh
local ass = assdraw.ass_new()
local transp = nil
if gTransparent then
transp = "{\\1a&HA0&\\3a&HA0&}"
end
-- some shitty background
ass:new_event()
ass:append("{\\1c&Ha3a3a3&\\1a&H30&}")
if transp then
ass:append(transp)
end
ass:pos(o_x - tile_wh, o_y - tile_wh)
ass:draw_start()
ass:rect_cw(0, 0, (W + 2) * tile_wh, (H + 2) * tile_wh)
-- grid
local function grid_line(x0, y0, x1, y1)
ass:new_event()
ass:append("{\\bord0.5}")
if transp then
ass:append(transp)
end
ass:pos(x0, y0)
ass:draw_start()
ass:coord(0, 0)
ass:line_to(x1 - x0, y1 - y0)
end
for x = 0, W do
local p_x = x * tile_wh + o_x
grid_line(p_x, o_y, p_x, o_y + tile_wh * H)
end
for y = 0, H do
local p_y = y * tile_wh + o_y
grid_line(o_x, p_y, o_x + tile_wh * W, p_y)
end
local function draw_sym(x, y, sym, c)
ass:new_event()
ass:pos(x, y)
ass:append("{\\an5\\fs25\\bord0\\1c&H" .. c .. "&\\b1}" .. sym)
end
for x = 1, W do
for y = 1, H do
local tile = gField[x][y]
local p_x = (x - 1) * tile_wh + tile_wh / 2 + o_x
local p_y = (y - 1) * tile_wh + tile_wh / 2 + o_y
local wh = tile_wh - 4
local sym = nil
if tile.is_covered then
ass:new_event()
if transp then
ass:append(transp)
end
ass:pos(p_x, p_y)
ass:draw_start()
ass:round_rect_cw(-wh / 2, -wh / 2, wh / 2, wh / 2, 5)
ass:draw_stop()
elseif tile.is_mine then
draw_sym(p_x, p_y, "💣", "0000FF")
elseif tile.area_mines > 0 then
draw_sym(p_x, p_y, tile.area_mines, "000000")
end
if tile.flag ~= FLAG_NONE then
draw_sym(p_x, p_y, tile.flag, "FF0000")
end
if x == gX and y == gY then
local wh = tile_wh - 12
ass:new_event()
ass:append("{\\1a&HFF&}")
ass:pos(p_x, p_y)
ass:draw_start()
ass:rect_cw(-wh / 2, -wh / 2, wh / 2, wh / 2)
ass:draw_stop()
end
end
end
local banner = nil
if gStatus == STATUS_WON then
banner = "You may have won, but actually you just wasted time."
elseif gStatus == STATUS_LOST then
banner = "You lost (and wasted time)."
end
if banner then
ass:new_event()
ass:pos(o_x + tile_wh * W / 2, o_y - tile_wh - 10)
ass:append("{\\fs40\\b1\\an2}" .. banner)
end
mp.set_osd_ass(canvas_w, canvas_h, ass.text)
end
mp.observe_property("osd-width", "native", force_render)
mp.observe_property("osd-height", "native", force_render)
init_field()
force_render()
function toggle_transp()
gTransparent = not gTransparent
force_render()
end
function cycle_preset()
gCurrentPreset = (gCurrentPreset + 1 - 1) % #PRESETS + 1
init_field()
render()
end
function toggle_show()
if gHidden then
gHidden = false
local REP = {repeatable = true}
mp.add_forced_key_binding("left", "mines-left", function() move(-1, 0) end, REP)
mp.add_forced_key_binding("right", "mines-right", function() move(1, 0) end, REP)
mp.add_forced_key_binding("up", "mines-up", function() move(0, -1) end, REP)
mp.add_forced_key_binding("down", "mines-down", function() move(0, 1) end, REP)
mp.add_forced_key_binding("space", "mines-uncover", uncover)
mp.add_forced_key_binding("b", "mines-flag", flag)
mp.add_forced_key_binding("t", "mines-transp", toggle_transp)
mp.add_forced_key_binding("w", "mines-preset", cycle_preset)
else
gHidden = true
mp.remove_key_binding("mines-left")
mp.remove_key_binding("mines-right")
mp.remove_key_binding("mines-up")
mp.remove_key_binding("mines-down")
mp.remove_key_binding("mines-uncover")
mp.remove_key_binding("mines-flag")
mp.remove_key_binding("mines-transp")
mp.remove_key_binding("mines-preset")
end
force_render()
end
mp.add_forced_key_binding("ctrl+x", "mines-show", toggle_show)

View file

@ -0,0 +1,43 @@
-- Toggle redshift when viewing videos with mpv
if os.execute("pgrep -x redshift >/dev/null") ~= 0
then
return
end
-- Consider that redshift is enabled when starting
rs_enabled = true
function rs_toggle()
os.execute("pkill -x -USR1 redshift")
end
function rs_disable()
if rs_enabled
then
rs_toggle()
rs_enabled = false
mp.msg.log("info", "Disabling redshift")
end
end
function rs_enable()
if not rs_enabled
then
rs_toggle()
rs_enabled = true
mp.msg.log("info", "Reenabling redshift")
end
end
function rs_handler()
if mp.get_property("video") ~= "no"
then
rs_disable()
else
rs_enable()
end
end
mp.register_event("file-loaded", rs_handler)
mp.register_event("shutdown", rs_enable)

View file

@ -0,0 +1,145 @@
local msg = require "mp.msg"
local utils = require "mp.utils"
local options = require "mp.options"
local cut_pos = nil
local copy_audio = true
local o = {
target_dir = "~",
vcodec = "rawvideo",
acodec = "pcm_s16le",
prevf = "",
vf = "format=yuv444p16$hqvf,scale=in_color_matrix=$matrix,format=bgr24",
hqvf = "",
postvf = "",
opts = "",
ext = "avi",
command_template = [[
ffmpeg -v warning -y -stats
-ss $shift -i "$in" -t $duration
-c:v $vcodec -c:a $acodec $audio
-vf $prevf$vf$postvf $opts "$out.$ext"
]],
}
options.read_options(o)
function timestamp(duration)
local hours = duration / 3600
local minutes = duration % 3600 / 60
local seconds = duration % 60
return string.format("%02d:%02d:%02.03f", hours, minutes, seconds)
end
function osd(str)
return mp.osd_message(str, 3)
end
function get_homedir()
-- It would be better to do platform detection instead of fallback but
-- it's not that easy in Lua.
return os.getenv("HOME") or os.getenv("USERPROFILE") or ""
end
function log(str)
local logpath = utils.join_path(
o.target_dir:gsub("~", get_homedir()),
"mpv_slicing.log")
f = io.open(logpath, "a")
f:write(string.format("# %s\n%s\n",
os.date("%Y-%m-%d %H:%M:%S"),
str))
f:close()
end
function escape(str)
-- FIXME(Kagami): This escaping is NOT enough, see e.g.
-- https://stackoverflow.com/a/31413730
-- Consider using `utils.subprocess` instead.
return str:gsub("\\", "\\\\"):gsub('"', '\\"')
end
function trim(str)
return str:gsub("^%s+", ""):gsub("%s+$", "")
end
function get_csp()
local csp = mp.get_property("colormatrix")
if csp == "bt.601" then return "bt601"
elseif csp == "bt.709" then return "bt709"
elseif csp == "smpte-240m" then return "smpte240m"
else
local err = "Unknown colorspace: " .. csp
osd(err)
error(err)
end
end
function get_outname(shift, endpos)
local name = mp.get_property("filename")
local dotidx = name:reverse():find(".", 1, true)
if dotidx then name = name:sub(1, -dotidx-1) end
name = name:gsub(" ", "_")
name = name:gsub(":", "-")
name = name .. string.format(".%s-%s", timestamp(shift), timestamp(endpos))
return name
end
function cut(shift, endpos)
local cmd = trim(o.command_template:gsub("%s+", " "))
local inpath = escape(utils.join_path(
utils.getcwd(),
mp.get_property("stream-path")))
local outpath = escape(utils.join_path(
o.target_dir:gsub("~", get_homedir()),
get_outname(shift, endpos)))
cmd = cmd:gsub("$shift", shift)
cmd = cmd:gsub("$duration", endpos - shift)
cmd = cmd:gsub("$vcodec", o.vcodec)
cmd = cmd:gsub("$acodec", o.acodec)
cmd = cmd:gsub("$audio", copy_audio and "" or "-an")
cmd = cmd:gsub("$prevf", o.prevf)
cmd = cmd:gsub("$vf", o.vf)
cmd = cmd:gsub("$hqvf", o.hqvf)
cmd = cmd:gsub("$postvf", o.postvf)
cmd = cmd:gsub("$matrix", get_csp())
cmd = cmd:gsub("$opts", o.opts)
-- Beware that input/out filename may contain replacing patterns.
cmd = cmd:gsub("$ext", o.ext)
cmd = cmd:gsub("$out", outpath)
cmd = cmd:gsub("$in", inpath, 1)
msg.info(cmd)
log(cmd)
os.execute(cmd)
end
function toggle_mark()
local pos = mp.get_property_number("time-pos")
if cut_pos then
local shift, endpos = cut_pos, pos
if shift > endpos then
shift, endpos = endpos, shift
end
if shift == endpos then
osd("Cut fragment is empty")
else
cut_pos = nil
osd(string.format("Cut fragment: %s - %s",
timestamp(shift),
timestamp(endpos)))
cut(shift, endpos)
end
else
cut_pos = pos
osd(string.format("Marked %s as start position", timestamp(pos)))
end
end
function toggle_audio()
copy_audio = not copy_audio
osd("Audio capturing is " .. (copy_audio and "enabled" or "disabled"))
end
mp.add_key_binding("c", "slicing_mark", toggle_mark)
mp.add_key_binding("a", "slicing_audio", toggle_audio)

View file

@ -0,0 +1,99 @@
SPACE repeatable playlist-next
alt+SPACE repeatable playlist-prev
UP ignore
DOWN ignore
LEFT repeatable playlist-prev
RIGHT repeatable playlist-next
# simple reminder of default bindings
#1 add contrast -1
#2 add contrast 1
#3 add brightness -1
#4 add brightness 1
#5 add gamma -1
#6 add gamma 1
#7 add saturation -1
#8 add saturation 1
# mouse-centric bindings
MBTN_RIGHT script-binding image_viewer/drag-to-pan
MBTN_LEFT script-binding image_viewer/pan-follows-cursor
WHEEL_UP script-message cursor-centric-zoom 0.1
WHEEL_DOWN script-message cursor-centric-zoom -0.1
# panning with the keyboard:
# pan-image takes the following arguments
# pan-image AXIS AMOUNT ZOOM_INVARIANT IMAGE_CONSTRAINED
# ^ ^ ^
# x or y | |
# | |
# if yes, will pan by the same if yes, stops panning if the image
# amount regardless of zoom would go outside of the window
ctrl+down repeatable script-message pan-image y -0.1 yes yes
ctrl+up repeatable script-message pan-image y +0.1 yes yes
ctrl+right repeatable script-message pan-image x -0.1 yes yes
ctrl+left repeatable script-message pan-image x +0.1 yes yes
# now with more precision
alt+down repeatable script-message pan-image y -0.01 yes yes
alt+up repeatable script-message pan-image y +0.01 yes yes
alt+right repeatable script-message pan-image x -0.01 yes yes
alt+left repeatable script-message pan-image x +0.01 yes yes
# replace at will with h,j,k,l if you prefer vim-style bindings
# on a trackpad you may want to use these
#WHEEL_UP repeatable script-message pan-image y -0.02 yes yes
#WHEEL_DOWN repeatable script-message pan-image y +0.02 yes yes
#WHEEL_LEFT repeatable script-message pan-image x -0.02 yes yes
#WHEEL_RIGHT repeatable script-message pan-image x +0.02 yes yes
# align the border of the image to the border of the window
# align-border takes the following arguments:
# align-border ALIGN_X ALIGN_Y
# any value for ALIGN_* is accepted, -1 and 1 map to the border of the window
ctrl+shift+right script-message align-border -1 ""
ctrl+shift+left script-message align-border 1 ""
ctrl+shift+down script-message align-border "" -1
ctrl+shift+up script-message align-border "" 1
# reset the image
ctrl+0 no-osd set video-pan-x 0; no-osd set video-pan-y 0; no-osd set video-zoom 0
+ add video-zoom 0.5
- add video-zoom -0.5; script-message reset-pan-if-visible
= no-osd set video-zoom 0; script-message reset-pan-if-visible
# sxiv compatibility
w no-osd set video-unscaled yes; keypress =
e no-osd set video-unscaled no; keypress =
h no-osd vf toggle hflip; show-text "Horizontal flip"
v no-osd vf toggle vflip; show-text "Vertical flip"
r script-message rotate-video 90; show-text "Clockwise rotation"
R script-message rotate-video -90; show-text "Counter-clockwise rotation"
alt+r no-osd set video-rotate 0; show-text "Reset rotation"
d script-message ruler
# Toggling between pixel-exact reproduction and interpolation
a cycle-values scale nearest ewa_lanczossharp
# Toggle color management on or off
c cycle icc-profile-auto
# Screenshot of the window output
S screenshot window
# Toggle aspect ratio information on and off
A cycle-values video-aspect "-1" "no"
p script-message force-print-filename
# ADVANCED: you can define bindings that belong to a "section" (named "image-viewer" here) like so:
#alt+SPACE {image-viewer} repeatable playlist-prev
#SPACE {image-viewer} repeatable playlist-next
# to load them conditionally with a command. See scripts-opts/image_viewer.conf for how you can do this

46
home/.config/mvi/mpv.conf Normal file
View file

@ -0,0 +1,46 @@
## IMAGE
# classic opengl-hq parameter, change at will
scale=spline36
cscale=spline36
dscale=mitchell
dither-depth=auto
correct-downscaling
sigmoid-upscaling
# debanding seems rarely useful with images
#deband
## MISC
mute=yes
# the osc is mostly useful for videos
osc=no
# don't try to autoload subtitles or audio files
sub-auto=no
audio-file-auto=no
# get rid of the useless V: 00:00:00 / 00:00:00 line
term-status-msg=
# replace mpv with mvi in the window title
title="${?media-title:${media-title}}${!media-title:No file} - mvi"
# don't slideshow by default
image-display-duration=inf
# loop files in case of webms or gifs
loop-file=inf
# and loop the whole playlist
loop-playlist=inf
# you need this if you plan to use drag-to-pan or pan-follows-cursor with MOUSE_LEFT
window-dragging=no
#according to haasn, aspect ratio info for PNG and JPG is "universally bust"
[extension.png]
video-aspect=no
[extension.jpg]
video-aspect=no
[extension.jpeg]
profile=extension.jpg
[silent]
msg-level=all=no

View file

@ -0,0 +1,78 @@
## MISC
# size of the margins with pan-follows-cursor
pan_follows_cursor_margin=50
# whether pan-follows-cursor should pan when the entire image is visible
pan_follows_cursor_move_if_full_view=no
## STATUS LINE
# whether to show a status line
status_line_enabled=yes
# its position, possible values: (bottom|top)_(left|right)
status_line_position=bottom_left
# its font size
status_line_size=36
# the text to be expanded
# see property expansion: https://mpv.io/manual/master/#property-expansion
# \N can be used for line breaks
# you can also use ass tags, see here: http://docs.aegisub.org/3.2/ASS_Tags/
status_line=${filename} [${playlist-pos-1}/${playlist-count}]
## MINIMAP
# whether to show a minimap
minimap_enabled=yes
# the position of the center of the minimap, in percentage of the window (x, y)
minimap_center=92,92
# the scale of the minimap (i.e. the view rectangle is scale / 100 times the size of the window)
minimap_scale=12
# the cutoff size of the minimap (i.e. the image rectangle is clipped if it falls outside of the this zone)
minimap_max_size=16,16
# opacity of the "image" (from 00=opaque to FF=transparent)
minimap_image_opacity=88
# color of the "image" (#BBGGRR where each component rages from 00 to FF)
minimap_image_color=BBBBBB
# opacity of the "view"
minimap_view_opacity=BB
minimap_view_color=222222
# whether the view should be drawn above the image
minimap_view_above_image=yes
# whether to show the minimap if the current image is fully visible
minimap_hide_when_full_image_in_view=yes
## RULER
# whether to show the length of the lines between the two points
ruler_show_distance=yes
# whether to show the coordinates of the two points
ruler_show_coordinates=yes
# the coordinate space of the text shown. Can be "image", "window", "both"
ruler_coordinates_space=image
# can be "degrees", "radians", "both", or "no"
ruler_show_angles=degrees
ruler_line_width=2
ruler_dots_radius=3
ruler_font_size=36
# ranges from 00 (black) to FF (white)
ruler_line_color=33
# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list
ruler_confirm_bindings=MBTN_LEFT,ENTER
# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list
ruler_exit_bindings=ESC
# if yes, the first point will be immediately set at the cursor position when calling 'ruler'
ruler_set_first_point_on_begin=no
# if yes, the ruler overlay will be immediately cleared when setting the second point
ruler_clear_on_second_point_set=no
## HOOKS
# commands to execute when a file detected as an image (1 frame, no audio) is loaded or unloaded
# an image was loaded, and the previous file was not an image (or there was no previous file)
command_on_first_image_loaded=
# an image was loaded (regardless of what the previous file was)
command_on_image_loaded=
# a non-image was loaded, and the previous file was an image
command_on_non_image_loaded=
# the purpose of these "hooks" is to let you change bindings, profiles, reset properties...
# see https://mpv.io/manual/master/#list-of-input-commands for general command information
# note that there is no such thing as "unloading a profile", to emulate this you must create an opposite profile and load that
# example possible values:
#command_on_first_image_loaded=apply-profile image; enable-section image-viewer; script-message enable-status-line
#command_on_image_loaded=no-osd set video-pan-x 0; script-message align-border "" -1
#command_on_non_image_loaded=disable-section image-viewer; no-osd set video-pan-x 0; no-osd set video-pan-y 0; no-osd set video-zoom 0; script-message disable-status-line

View file

@ -0,0 +1,953 @@
local opts = {
pan_follows_cursor_margin = 50,
pan_follows_cursor_move_if_full_view = false,
status_line_enabled = false,
status_line_position = "bottom_left",
status_line_size = 36,
status_line = "${filename} [${playlist-pos-1}/${playlist-count}]",
minimap_enabled = true,
minimap_center = "92,92",
minimap_scale = 12,
minimap_max_size = "16,16",
minimap_image_opacity = "88",
minimap_image_color = "BBBBBB",
minimap_view_opacity = "BB",
minimap_view_color = "222222",
minimap_view_above_image = true,
minimap_hide_when_full_image_in_view = true,
ruler_show_distance=true,
ruler_show_coordinates=true,
ruler_coordinates_space="both",
ruler_show_angles="degrees",
ruler_line_width=2,
ruler_dots_radius=3,
ruler_font_size=36,
ruler_line_color="33",
ruler_confirm_bindings="MBTN_LEFT,ENTER",
ruler_exit_bindings="ESC",
ruler_set_first_point_on_begin=false,
ruler_clear_on_second_point_set=false,
command_on_first_image_loaded="",
command_on_image_loaded="",
command_on_non_image_loaded="",
}
(require 'mp.options').read_options(opts)
function split(input)
local ret = {}
for str in string.gmatch(input, "([^,]+)") do
ret[#ret + 1] = str
end
return ret
end
function str_to_num(array)
local ret = {}
for _, v in ipairs(array) do
ret[#ret + 1] = tonumber(v)
end
return ret
end
opts.minimap_center=str_to_num(split(opts.minimap_center))
opts.minimap_max_size=str_to_num(split(opts.minimap_max_size))
opts.ruler_confirm_bindings=split(opts.ruler_confirm_bindings)
opts.ruler_exit_bindings=split(opts.ruler_exit_bindings)
function clamp(value, low, high)
if value <= low then
return low
elseif value >= high then
return high
else
return value
end
end
local msg = require 'mp.msg'
local assdraw = require 'mp.assdraw'
local ass = { -- shared ass state
status_line = "",
minimap = "",
ruler = "",
}
local cleanup = nil -- function set up by drag-to-pan/pan-follows cursor and must be called to clean lingering state
local mouse_move_callbacks = {} -- functions that are called when mouse_move is triggered
function add_mouse_move_callback(key, func)
if #mouse_move_callbacks == 0 then
mp.add_forced_key_binding("mouse_move", "image-viewer-internal", function()
for _, func in pairs(mouse_move_callbacks) do
func()
end
end)
end
mouse_move_callbacks[key] = func
end
function remove_mouse_move_callback(key)
mouse_move_callbacks[key] = nil
for _,_ in pairs(mouse_move_callbacks) do
return
end
mp.remove_key_binding("image-viewer-internal")
end
video_dimensions_stale = true
function get_video_dimensions()
-- this function is very much ripped from video/out/aspect.c in mpv's source
if not video_dimensions_stale then return _video_dimensions end
local video_params = mp.get_property_native("video-out-params")
if not video_params then
_video_dimensions = nil
return nil
end
if not _timestamp then _timestamp = 0 end
_timestamp = _timestamp + 1
_video_dimensions = {
timestamp = _timestamp,
top_left = {x = 0, y = 0},
bottom_right = {x = 0, y = 0},
size = {w = 0, h = 0},
ratios = {w = 0, h = 0}, -- by how much the original video got scaled
}
local keep_aspect = mp.get_property_bool("keepaspect")
local w = video_params["w"]
local h = video_params["h"]
local dw = video_params["dw"]
local dh = video_params["dh"]
if mp.get_property_number("video-rotate") % 180 == 90 then
w, h = h,w
dw, dh = dh, dw
end
local window_w, window_h = mp.get_osd_size()
if keep_aspect then
local unscaled = mp.get_property_native("video-unscaled")
local panscan = mp.get_property_number("panscan")
local fwidth = window_w
local fheight = math.floor(window_w / dw * dh)
if fheight > window_h or fheight < h then
local tmpw = math.floor(window_h / dh * dw)
if tmpw <= window_w then
fheight = window_h
fwidth = tmpw
end
end
local vo_panscan_area = window_h - fheight
local f_w = fwidth / fheight
local f_h = 1
if vo_panscan_area == 0 then
vo_panscan_area = window_h - fwidth
f_w = 1
f_h = fheight / fwidth
end
if unscaled or unscaled == "downscale-big" then
vo_panscan_area = 0
if unscaled or (dw <= window_w and dh <= window_h) then
fwidth = dw
fheight = dh
end
end
local scaled_width = fwidth + math.floor(vo_panscan_area * panscan * f_w)
local scaled_height = fheight + math.floor(vo_panscan_area * panscan * f_h)
local split_scaling = function (dst_size, scaled_src_size, zoom, align, pan)
scaled_src_size = math.floor(scaled_src_size * 2 ^ zoom)
align = (align + 1) / 2
local dst_start = math.floor((dst_size - scaled_src_size) * align + pan * scaled_src_size)
if dst_start < 0 then
--account for C int cast truncating as opposed to flooring
dst_start = dst_start + 1
end
local dst_end = dst_start + scaled_src_size;
if dst_start >= dst_end then
dst_start = 0
dst_end = 1
end
return dst_start, dst_end
end
local zoom = mp.get_property_number("video-zoom")
local align_x = mp.get_property_number("video-align-x")
local pan_x = mp.get_property_number("video-pan-x")
_video_dimensions.top_left.x, _video_dimensions.bottom_right.x = split_scaling(window_w, scaled_width, zoom, align_x, pan_x)
local align_y = mp.get_property_number("video-align-y")
local pan_y = mp.get_property_number("video-pan-y")
_video_dimensions.top_left.y, _video_dimensions.bottom_right.y = split_scaling(window_h, scaled_height, zoom, align_y, pan_y)
else
_video_dimensions.top_left.x = 0
_video_dimensions.bottom_right.x = window_w
_video_dimensions.top_left.y = 0
_video_dimensions.bottom_right.y = window_h
end
_video_dimensions.size.w = _video_dimensions.bottom_right.x - _video_dimensions.top_left.x
_video_dimensions.size.h = _video_dimensions.bottom_right.y - _video_dimensions.top_left.y
_video_dimensions.ratios.w = _video_dimensions.size.w / w
_video_dimensions.ratios.h = _video_dimensions.size.h / h
video_dimensions_stale = false
return _video_dimensions
end
for _, p in ipairs({
"keepaspect",
"video-out-params",
"video-unscaled",
"panscan",
"video-zoom",
"video-align-x",
"video-pan-x",
"video-align-y",
"video-pan-y",
"osd-width",
"osd-height",
}) do
mp.observe_property(p, "native", function() video_dimensions_stale = true end)
end
function drag_to_pan_handler(table)
if cleanup then
cleanup()
cleanup = nil
end
if table["event"] == "down" then
local video_dimensions = get_video_dimensions()
if not video_dimensions then return end
local mouse_pos_origin, video_pan_origin = {}, {}
local moved = false
mouse_pos_origin.x, mouse_pos_origin.y = mp.get_mouse_pos()
video_pan_origin.x = mp.get_property("video-pan-x")
video_pan_origin.y = mp.get_property("video-pan-y")
local idle = function()
if moved then
local mX, mY = mp.get_mouse_pos()
local pX = video_pan_origin.x + (mX - mouse_pos_origin.x) / video_dimensions.size.w
local pY = video_pan_origin.y + (mY - mouse_pos_origin.y) / video_dimensions.size.h
mp.command("no-osd set video-pan-x " .. clamp(pX, -3, 3) .. "; no-osd set video-pan-y " .. clamp(pY, -3, 3))
moved = false
end
end
mp.register_idle(idle)
add_mouse_move_callback("drag-to-pan", function() moved = true end)
cleanup = function()
remove_mouse_move_callback("drag-to-pan")
mp.unregister_idle(idle)
end
end
end
function pan_follows_cursor_handler(table)
if cleanup then
cleanup()
cleanup = nil
end
if table["event"] == "down" then
local video_dimensions = get_video_dimensions()
if not video_dimensions then return end
local window_w, window_h = mp.get_osd_size()
local moved = true
local idle = function()
if moved then
local mX, mY = mp.get_mouse_pos()
local x = math.min(1, math.max(- 2 * mX / window_w + 1, -1))
local y = math.min(1, math.max(- 2 * mY / window_h + 1, -1))
local command = ""
local margin, move_full = opts.pan_follows_cursor_margin, opts.pan_follows_cursor_move_if_full_view
if (not move_full and window_w < video_dimensions.size.w) then
command = command .. "no-osd set video-pan-x " .. clamp(x * (video_dimensions.size.w - window_w + 2 * margin) / (2 * video_dimensions.size.w), -3, 3) .. ";"
elseif mp.get_property_number("video-pan-x") ~= 0 then
command = command .. "no-osd set video-pan-x " .. "0;"
end
if (not move_full and window_h < video_dimensions.size.h) then
command = command .. "no-osd set video-pan-y " .. clamp(y * (video_dimensions.size.h - window_h + 2 * margin) / (2 * video_dimensions.size.h), -3, 3) .. ";"
elseif mp.get_property_number("video-pan-y") ~= 0 then
command = command .. "no-osd set video-pan-y " .. "0;"
end
if command ~= "" then
mp.command(command)
end
moved = false
end
end
mp.register_idle(idle)
add_mouse_move_callback("pan-follows-cursor", function() moved = true end)
cleanup = function()
remove_mouse_move_callback("pan-follows-cursor")
mp.unregister_idle(idle)
end
end
end
function cursor_centric_zoom_handler(amt)
local zoom_inc = tonumber(amt)
if not zoom_inc or zoom_inc == 0 then return end
local video_dimensions = get_video_dimensions()
if not video_dimensions then return end
local mouse_pos_origin, video_pan_origin = {}, {}
mouse_pos_origin.x, mouse_pos_origin.y = mp.get_mouse_pos()
video_pan_origin.x = mp.get_property("video-pan-x")
video_pan_origin.y = mp.get_property("video-pan-y")
local zoom_origin = mp.get_property("video-zoom")
-- how far the cursor is form the middle of the video (in percentage)
local rx = (video_dimensions.top_left.x + video_dimensions.size.w / 2 - mouse_pos_origin.x) / (video_dimensions.size.w / 2)
local ry = (video_dimensions.top_left.y + video_dimensions.size.h / 2 - mouse_pos_origin.y) / (video_dimensions.size.h / 2)
-- the size in pixels of the (in|de)crement
local diffHeight = (2 ^ zoom_inc - 1) * video_dimensions.size.h
local diffWidth = (2 ^ zoom_inc - 1) * video_dimensions.size.w
local newPanX = (video_pan_origin.x * video_dimensions.size.w + rx * diffWidth / 2) / (video_dimensions.size.w + diffWidth)
local newPanY = (video_pan_origin.y * video_dimensions.size.h + ry * diffHeight / 2) / (video_dimensions.size.h + diffHeight)
mp.command("no-osd set video-zoom " .. zoom_origin + zoom_inc .. "; no-osd set video-pan-x " .. clamp(newPanX, -3, 3) .. "; no-osd set video-pan-y " .. clamp(newPanY, -3, 3))
end
function align_border(x, y)
local video_dimensions = get_video_dimensions()
if not video_dimensions then return end
local window_w, window_h = mp.get_osd_size()
local x, y = tonumber(x), tonumber(y)
local command = ""
if x then
command = command .. "no-osd set video-pan-x " .. clamp(x * (video_dimensions.size.w - window_w) / (2 * video_dimensions.size.w), -3, 3) .. ";"
end
if y then
command = command .. "no-osd set video-pan-y " .. clamp(y * (video_dimensions.size.h - window_h) / (2 * video_dimensions.size.h), -3, 3) .. ";"
end
if command ~= "" then
mp.command(command)
end
end
function pan_image(axis, amount, zoom_invariant, image_constrained)
amount = tonumber(amount)
if not amount or amount == 0 or axis ~= "x" and axis ~= "y" then return end
if zoom_invariant == "yes" then
amount = amount / 2 ^ mp.get_property_number("video-zoom")
end
local prop = "video-pan-" .. axis
local old_pan = mp.get_property_number(prop)
if image_constrained == "yes" then
local video_dimensions = get_video_dimensions()
if not video_dimensions then return end
local measure = axis == "x" and "w" or "h"
local window = {}
window.w, window.h = mp.get_osd_size()
local pixels_moved = amount * video_dimensions.size[measure]
-- should somehow refactor this
if pixels_moved > 0 then
if window[measure] > video_dimensions.size[measure] then
if video_dimensions.bottom_right[axis] >= window[measure] then return end
if video_dimensions.bottom_right[axis] + pixels_moved > window[measure] then
amount = (window[measure] - video_dimensions.bottom_right[axis]) / video_dimensions.size[measure]
end
else
if video_dimensions.top_left[axis] >= 0 then return end
if video_dimensions.top_left[axis] + pixels_moved > 0 then
amount = (0 - video_dimensions.top_left[axis]) / video_dimensions.size[measure]
end
end
else
if window[measure] > video_dimensions.size[measure] then
if video_dimensions.top_left[axis] <= 0 then return end
if video_dimensions.top_left[axis] + pixels_moved < 0 then
amount = (0 - video_dimensions.top_left[axis]) / video_dimensions.size[measure]
end
else
if video_dimensions.bottom_right[axis] <= window[measure] then return end
if video_dimensions.bottom_right[axis] + pixels_moved < window[measure] then
amount = (window[measure] - video_dimensions.bottom_right[axis]) / video_dimensions.size[measure]
end
end
end
end
mp.set_property_number(prop, old_pan + amount)
end
function rotate_video(amt)
local rot = mp.get_property_number("video-rotate")
rot = (rot + amt) % 360
mp.set_property_number("video-rotate", rot)
end
function reset_pan_if_visible()
local video_dimensions = get_video_dimensions()
if not video_dimensions then return end
local window_w, window_h = mp.get_osd_size()
local command = ""
if (window_w >= video_dimensions.size.w) then
command = command .. "no-osd set video-pan-x 0" .. ";"
end
if (window_h >= video_dimensions.size.h) then
command = command .. "no-osd set video-pan-y 0" .. ";"
end
if command ~= "" then
mp.command(command)
end
end
function force_print_filename()
mp.set_property("msg-level", "cplayer=info")
mp.commandv("print-text", mp.get_property("path"))
mp.set_property("msg-level", "all=no")
end
function draw_ass()
local ww, wh = mp.get_osd_size()
local merge = function(a, b)
return b ~= "" and (a .. "\n" .. b) or a
end
mp.set_osd_ass(ww, wh, merge(merge(ass.status_line, ass.minimap), ass.ruler))
end
local status_line_enabled = false
local status_line_stale = true
function mark_status_line_stale()
status_line_stale = true
end
function refresh_status_line()
if not status_line_stale then return end
status_line_stale = false
local path = mp.get_property("path")
if path == nil or path == "" then
ass.status_line = ""
draw_ass()
return
end
local expanded = mp.command_native({ "expand-text", opts.status_line })
if not expanded then
msg.warn("Error expanding status line")
ass.status_line = ""
draw_ass()
return
end
local w,h = mp.get_osd_size()
local an, x, y
local margin = 10
if opts.status_line_position == "top_left" then
x = margin
y = margin
an = 7
elseif opts.status_line_position == "top_right" then
x = w-margin
y = margin
an = 9
elseif opts.status_line_position == "bottom_right" then
x = w-margin
y = h-margin
an = 3
else
x = margin
y = h-margin
an = 1
end
local a = assdraw:ass_new()
a:new_event()
a:an(an)
a:pos(x,y)
a:append("{\\fs".. opts.status_line_size.. "}{\\bord1.0}")
a:append(expanded)
ass.status_line = a.text
draw_ass()
end
function enable_status_line()
if status_line_enabled then return end
status_line_enabled = true
local start = 0
while true do
local s, e, cap = string.find(opts.status_line, "%${[?!]?([%l%d-/]*)", start)
if not s then break end
mp.observe_property(cap, nil, mark_status_line_stale)
start = e
end
mp.observe_property("path", nil, mark_status_line_stale)
mp.observe_property("osd-width", nil, mark_status_line_stale)
mp.observe_property("osd-height", nil, mark_status_line_stale)
mp.register_idle(refresh_status_line)
mark_status_line_stale()
end
function disable_status_line()
if not status_line_enabled then return end
status_line_enabled = false
mp.unobserve_property(mark_status_line_stale)
mp.unregister_idle(refresh_status_line)
ass.status_line = ""
draw_ass()
end
if opts.status_line_enabled then
enable_status_line()
end
if opts.command_on_image_loaded ~= "" or opts.command_on_non_image_loaded ~= "" then
local was_image = false
local frame_count = nil
local audio_tracks = nil
local out_params_ready = nil
local path = nil
function state_changed()
function set_image(is_image)
if is_image and not was_image and opts.command_on_first_image_loaded ~= "" then
mp.command(opts.command_on_first_image_loaded)
end
if is_image and opts.command_on_image_loaded ~= "" then
mp.command(opts.command_on_image_loaded)
end
if not is_image and was_image and opts.command_on_non_image_loaded ~= "" then
mp.command(opts.command_on_non_image_loaded)
end
was_image = is_image
end
-- only do things when state is consistent
if path ~= nil and audio_tracks ~= nil then
if frame_count == nil and audio_tracks > 0 then
set_image(false)
elseif out_params_ready and frame_count ~= nil then
-- png have 0 frames, jpg 1 ¯\_(ツ)_/¯
set_image((frame_count == 0 or frame_count == 1) and audio_tracks == 0)
end
end
end
mp.observe_property("video-out-params/par", "number", function(_, val)
out_params_ready = (val ~= nil and val > 0)
state_changed()
end)
mp.observe_property("estimated-frame-count", "number", function(_, val)
frame_count = val
state_changed()
end)
mp.observe_property("path", "string", function(_, val)
if not val or val == "" then
path = nil
else
path = val
end
state_changed()
end)
mp.register_event("tracks-changed", function()
audio_tracks = 0
local tracks = 0
for _, track in ipairs(mp.get_property_native("track-list")) do
tracks = tracks + 1
if track.type == "audio" then
audio_tracks = audio_tracks + 1
end
end
if tracks == 0 then
audio_tracks = nil
end
state_changed()
end)
end
function refresh_minimap()
local dim = get_video_dimensions()
if not dim then
ass.minimap = ""
draw_ass()
return
end
if _minimap_old_timestamp and dim.timestamp == _minimap_old_timestamp then return end
_minimap_old_timestamp = dim.timestamp
local ww, wh = mp.get_osd_size()
if opts.minimap_hide_when_full_image_in_view then
if dim.top_left.x >= 0 and
dim.top_left.y >= 0 and
dim.bottom_right.x <= ww and
dim.bottom_right.y <= wh
then
ass.minimap = ""
draw_ass()
return
end
end
local center = {
x=opts.minimap_center[1]/100*ww,
y=opts.minimap_center[2]/100*wh
}
local cutoff = {
x=opts.minimap_max_size[1]/100*ww/2,
y=opts.minimap_max_size[2]/100*wh/2
}
local a = assdraw.ass_new()
local draw = function(x, y, w, h, opacity, color)
a:new_event()
a:pos(center.x, center.y)
a:append("{\\bord0}")
a:append("{\\shad0}")
a:append("{\\c&" .. color .. "&}")
a:append("{\\2a&HFF}")
a:append("{\\3a&HFF}")
a:append("{\\4a&HFF}")
a:append("{\\1a&H" .. opacity .. "}")
w=w/2
h=h/2
a:draw_start()
local rounded = {true,true,true,true} -- tl, tr, br, bl
local x0,y0,x1,y1 = x-w, y-h, x+w, y+h
if x0 < -cutoff.x then
x0 = -cutoff.x
rounded[4] = false
rounded[1] = false
end
if y0 < -cutoff.y then
y0 = -cutoff.y
rounded[1] = false
rounded[2] = false
end
if x1 > cutoff.x then
x1 = cutoff.x
rounded[2] = false
rounded[3] = false
end
if y1 > cutoff.y then
y1 = cutoff.y
rounded[3] = false
rounded[4] = false
end
local r = 3
local c = 0.551915024494 * r
if rounded[0] then
a:move_to(x0 + r, y0)
else
a:move_to(x0,y0)
end
if rounded[1] then
a:line_to(x1 - r, y0)
a:bezier_curve(x1 - r + c, y0, x1, y0 + r - c, x1, y0 + r)
else
a:line_to(x1, y0)
end
if rounded[2] then
a:line_to(x1, y1 - r)
a:bezier_curve(x1, y1 - r + c, x1 - r + c, y1, x1 - r, y1)
else
a:line_to(x1, y1)
end
if rounded[3] then
a:line_to(x0 + r, y1)
a:bezier_curve(x0 + r - c, y1, x0, y1 - r + c, x0, y1 - r)
else
a:line_to(x0, y1)
end
if rounded[4] then
a:line_to(x0, y0 + r)
a:bezier_curve(x0, y0 + r - c, x0 + r - c, y0, x0 + r, y0)
else
a:line_to(x0, y0)
end
a:draw_stop()
end
local image = function()
draw((dim.top_left.x + dim.size.w/2 - ww/2) / opts.minimap_scale,
(dim.top_left.y + dim.size.h/2 - wh/2) / opts.minimap_scale,
dim.size.w / opts.minimap_scale,
dim.size.h / opts.minimap_scale,
opts.minimap_image_opacity,
opts.minimap_image_color)
end
local view = function()
draw(0,
0,
ww / opts.minimap_scale,
wh / opts.minimap_scale,
opts.minimap_view_opacity,
opts.minimap_view_color)
end
if opts.minimap_view_above_image then
image()
view()
else
view()
image()
end
ass.minimap = a.text
draw_ass()
end
local minimap_enabled = false
function enable_minimap()
if minimap_enabled then return end
minimap_enabled = true
mp.register_idle(refresh_minimap)
end
function disable_minimap()
if not minimap_enabled then return end
minimap_enabled = false
ass.minimap = a.text
draw_ass()
mp.unregister_idle(refresh_minimap)
end
if opts.minimap_enabled then
enable_minimap()
end
local ruler_state = 0 -- {0,1,2,3} = {inactive,setting first point,setting second point,done}
local ruler_first_point = nil -- in video space coordinates
local ruler_second_point = nil -- in video space coordinates
function cursor_video_space()
local dim = get_video_dimensions()
if not dim then return nil end
local mx, my = mp.get_mouse_pos()
local ret = {}
ret.x = (mx - dim.top_left.x) / dim.ratios.w
ret.y = (my - dim.top_left.y) / dim.ratios.h
return ret
end
function video_space_to_screen(point)
local dim = get_video_dimensions()
if not dim then return nil end
local ret = {}
ret.x = point.x * dim.ratios.w + dim.top_left.x
ret.y = point.y * dim.ratios.h + dim.top_left.y
return ret
end
function refresh_ruler()
local dim = get_video_dimensions()
if not dim then
ass.ruler = ""
draw_ass()
return
end
local line_start = {}
local line_end = {}
if ruler_second_point then
line_start.image = ruler_first_point
line_start.screen = video_space_to_screen(ruler_first_point)
line_end.image = ruler_second_point
line_end.screen = video_space_to_screen(ruler_second_point)
elseif ruler_first_point then
line_start.image = ruler_first_point
line_start.screen = video_space_to_screen(ruler_first_point)
line_end.image = cursor_video_space()
line_end.screen = {}
line_end.screen.x, line_end.screen.y = mp.get_mouse_pos()
else
local mx, my = mp.get_mouse_pos()
line_start.image = cursor_video_space()
line_start.screen = {}
line_start.screen.x, line_start.screen.y = mp.get_mouse_pos()
line_end = line_start
end
local distinct = (math.abs(line_start.screen.x - line_end.screen.x) >= 1
or math.abs(line_start.screen.y - line_end.screen.y) >= 1)
local a = assdraw:ass_new()
local draw_setup = function(bord)
a:new_event()
a:pos(0,0)
a:append("{\\bord" .. bord .. "}")
a:append("{\\shad0}")
local r = opts.ruler_line_color
a:append("{\\3c&H".. r .. r .. r .. "&}")
a:append("{\\1a&HFF}")
a:append("{\\2a&HFF}")
a:append("{\\3a&H00}")
a:append("{\\4a&HFF}")
a:draw_start()
end
local dot = function(pos, size)
draw_setup(size)
a:move_to(pos.x, pos.y-0.5)
a:line_to(pos.x, pos.y+0.5)
end
local line = function(from, to, size)
draw_setup(size)
a:move_to(from.x, from.y)
a:line_to(to.x, to.y)
end
if distinct then
dot(line_start.screen, opts.ruler_dots_radius)
line(line_start.screen, line_end.screen, opts.ruler_line_width)
dot(line_end.screen, opts.ruler_dots_radius)
else
dot(line_start.screen, opts.ruler_dots_radius)
end
local line_info = function()
if not opts.ruler_show_distance then return end
a:new_event()
a:append("{\\fs36}{\\bord1}")
a:pos((line_start.screen.x + line_end.screen.x) / 2, (line_start.screen.y + line_end.screen.y) / 2)
local an = 1
if line_start.image.x < line_end.image.x then an = an + 2 end
if line_start.image.y < line_end.image.y then an = an + 6 end
a:an(an)
local image = math.sqrt(math.pow(line_start.image.x - line_end.image.x, 2) + math.pow(line_start.image.y - line_end.image.y, 2))
local screen = math.sqrt(math.pow(line_start.screen.x - line_end.screen.x, 2) + math.pow(line_start.screen.y - line_end.screen.y, 2))
if opts.ruler_coordinates_space == "both" then
a:append(string.format("image: %.1f\\Nscreen: %.1f", image, screen))
elseif opts.ruler_coordinates_space == "image" then
a:append(string.format("%.1f", image))
elseif opts.ruler_coordinates_space == "window" then
a:append(string.format("%.1f", screen))
end
end
local dot_info = function(pos, opposite)
if not opts.ruler_show_coordinates then return end
a:new_event()
a:append("{\\fs" .. opts.ruler_font_size .."}{\\bord1}")
a:pos(pos.screen.x, pos.screen.y)
local an
if distinct then
an = 1
if line_start.image.x > line_end.image.x then an = an + 2 end
if line_start.image.y < line_end.image.y then an = an + 6 end
else
an = 7
end
if opposite then
an = 9 + 1 - an
end
a:an(an)
if opts.ruler_coordinates_space == "both" then
a:append(string.format("image: %.1f, %.1f\\Nscreen: %i, %i",
pos.image.x, pos.image.y, pos.screen.x, pos.screen.y))
elseif opts.ruler_coordinates_space == "image" then
a:append(string.format("%.1f, %.1f", pos.image.x, pos.image.y))
elseif opts.ruler_coordinates_space == "window" then
a:append(string.format("%i, %i", pos.screen.x, pos.screen.y))
end
end
dot_info(line_start, true)
if distinct then
line_info()
dot_info(line_end, false)
end
if distinct and opts.ruler_show_angles ~= "no" then
local dist = 50
local pos_from_angle = function(mult, angle)
return {
x = line_start.screen.x + mult * dist * math.cos(angle),
y = line_start.screen.y + mult * dist * math.sin(angle)
}
end
local extended = {x=line_start.screen.x, y=line_start.screen.y}
if line_end.screen.x > line_start.screen.x then
extended.x = extended.x + dist
else
extended.x = extended.x - dist
end
line(line_start.screen, extended, math.max(0, opts.ruler_line_width-0.5))
local angle = math.atan(math.abs(line_start.image.y - line_end.image.y) / math.abs(line_start.image.x - line_end.image.x))
local fix_angle
local an
if line_end.image.y < line_start.image.y and line_end.image.x > line_start.image.x then
-- upper-right
an = 4
fix_angle = function(angle) return - angle end
elseif line_end.image.y < line_start.image.y then
-- upper-left
an = 6
fix_angle = function(angle) return math.pi + angle end
elseif line_end.image.x < line_start.image.x then
-- bottom-left
an = 6
fix_angle = function(angle) return math.pi - angle end
else
-- bottom-right
an = 4
fix_angle = function(angle) return angle end
end
-- should implement this https://math.stackexchange.com/questions/873224/calculate-control-points-of-cubic-bezier-curve-approximating-a-part-of-a-circle
local cp1 = pos_from_angle(1, fix_angle(angle*1/4))
local cp2 = pos_from_angle(1, fix_angle(angle*3/4))
local p2 = pos_from_angle(1, fix_angle(angle))
a:bezier_curve(cp1.x, cp1.y, cp2.x, cp2.y, p2.x, p2.y)
a:new_event()
a:append("{\\fs" .. opts.ruler_font_size .."}{\\bord1}")
local text_pos = pos_from_angle(1.1, fix_angle(angle*2/3)) -- you'd think /2 would make more sense, but *2/3 looks better
a:pos(text_pos.x, text_pos.y)
a:an(an)
if opts.ruler_show_angles == "both" then
a:append(string.format("%.2f\\N%.1f°", angle, angle / math.pi * 180))
elseif opts.ruler_show_angles == "degrees" then
a:append(string.format("%.1f°", angle / math.pi * 180))
elseif opts.ruler_show_angles == "radians" then
a:append(string.format("%.2f", angle))
end
end
ass.ruler = a.text
draw_ass()
end
function ruler_next()
if ruler_state == 0 then
mp.register_idle(refresh_ruler)
add_mouse_move_callback("ruler", function() end) -- only used to get an idle event on mouse move
for _,key in ipairs(opts.ruler_confirm_bindings) do
mp.add_forced_key_binding(key, "ruler-next-" .. key, ruler_next)
end
for _,key in ipairs(opts.ruler_exit_bindings) do
mp.add_forced_key_binding(key, "ruler-stop-" .. key, ruler_stop)
end
ruler_state = 1
if opts.ruler_set_first_point_on_begin then
ruler_next()
end
elseif ruler_state == 1 then
ruler_first_point = cursor_video_space()
ruler_state = 2
elseif ruler_state == 2 then
ruler_state = 3
ruler_second_point = cursor_video_space()
if opts.ruler_clear_on_second_point_set then
ruler_next()
end
else
ruler_stop()
end
end
function ruler_stop()
if ruler_state == 0 then return end
mp.unregister_idle(refresh_ruler)
for _,key in ipairs(opts.ruler_confirm_bindings) do
mp.remove_key_binding("ruler-next-" .. key)
end
for _,key in ipairs(opts.ruler_exit_bindings) do
mp.remove_key_binding("ruler-stop-" .. key)
end
remove_mouse_move_callback("ruler")
ruler_state = 0
ruler_first_point = nil
ruler_second_point = nil
ass.ruler = ""
draw_ass()
end
mp.add_key_binding(nil, "drag-to-pan", drag_to_pan_handler, {complex = true})
mp.add_key_binding(nil, "pan-follows-cursor", pan_follows_cursor_handler, {complex = true})
mp.add_key_binding(nil, "cursor-centric-zoom", cursor_centric_zoom_handler)
mp.add_key_binding(nil, "align-border", align_border)
mp.add_key_binding(nil, "pan-image", pan_image)
mp.add_key_binding(nil, "rotate-video", rotate_video)
mp.add_key_binding(nil, "reset-pan-if-visible", reset_pan_if_visible)
mp.add_key_binding(nil, "force-print-filename", force_print_filename)
mp.add_key_binding(nil, "ruler", ruler_next)
mp.add_key_binding(nil, "enable-status-line", enable_status_line)
mp.add_key_binding(nil, "disable-status-line", disable_status_line)
mp.add_key_binding(nil, "toggle-status-line", function() if status_line_enabled then disable_status_line() else enable_status_line() end end)
mp.add_key_binding(nil, "enable-minimap", enable_minimap)
mp.add_key_binding(nil, "disable-minimap", disable_minimap)
mp.add_key_binding(nil, "toggle-minimap", function() if minimap_enabled then disable_minimap() else enable_minimap() end end)

View file

@ -0,0 +1,551 @@
##############################################################
## This is the example bindings file. Copy it to ##
## ~/.ncmpcpp/bindings or $XDG_CONFIG_HOME/ncmpcpp/bindings ##
## and set up your preferences ##
##############################################################
##
##### General rules #####
##
## 1) Because each action has runtime checks whether it's
## ok to run it, a few actions can be bound to one key.
## Actions will be bound in order given in configuration
## file. When a key is pressed, first action in order
## will test itself whether it's possible to run it. If
## test succeeds, action is executed and other actions
## bound to this key are ignored. If it doesn't, next
## action in order tests itself etc.
##
## 2) It's possible to bind more that one action at once
## to a key. It can be done using the following syntax:
##
## def_key "key"
## action1
## action2
## ...
##
## This creates a chain of actions. When such chain is
## executed, each action in chain is run until the end of
## chain is reached or one of its actions fails to execute
## due to its requirements not being met. If multiple actions
## and/or chains are bound to the same key, they will be
## consecutively run until one of them gets fully executed.
##
## 3) When ncmpcpp starts, bindings configuration file is
## parsed and then ncmpcpp provides "missing pieces"
## of default keybindings. If you want to disable some
## bindings, there is a special action called 'dummy'
## for that purpose. Eg. if you want to disable ability
## to crop playlists, you need to put the following
## into configuration file:
##
## def_key "C"
## dummy
##
## After that ncmpcpp will not bind any default action
## to this key.
##
## 4) To let you write simple macros, the following special
## actions are provided:
##
## - push_character "character" - pushes given special
## character into input queue, so it will be immediately
## picked by ncmpcpp upon next call to readKey function.
## Accepted values: mouse, up, down, page_up, page_down,
## home, end, space, enter, insert, delete, left, right,
## tab, ctrl-a, ctrl-b, ..., ctrl-z, ctrl-[, ctrl-\\,
## ctrl-], ctrl-^, ctrl-_, f1, f2, ..., f12, backspace.
## In addition, most of these names can be prefixed with
## alt-/ctrl-/shift- to be recognized with the appropriate
## modifier key(s).
##
## - push_characters "string" - pushes given string into
## input queue.
##
## - require_runnable "action" - checks whether given action
## is runnable and fails if it isn't. This is especially
## useful when mixed with previous two functions. Consider
## the following macro definition:
##
## def_key "key"
## push_characters "custom_filter"
## apply_filter
##
## If apply_filter can't be currently run, we end up with
## sequence of characters in input queue which will be
## treated just as we typed them. This may lead to unexpected
## results (in this case 'c' will most likely clear current
## playlist, 'u' will trigger database update, 's' will stop
## playback etc.). To prevent such thing from happening, we
## need to change above definition to this one:
##
## def_key "key"
## require_runnable "apply_filter"
## push_characters "custom_filter"
## apply_filter
##
## Here, first we test whether apply_filter can be actually run
## before we stuff characters into input queue, so if condition
## is not met, whole chain is aborted and we're fine.
##
## - require_screen "screen" - checks whether given screen is
## currently active. accepted values: browser, clock, help,
## media_library, outputs, playlist, playlist_editor,
## search_engine, tag_editor, visualizer, last_fm, lyrics,
## selected_items_adder, server_info, song_info,
## sort_playlist_dialog, tiny_tag_editor.
##
## - run_external_command "command" - runs given command using
## system() function.
##
## 5) In addition to binding to a key, you can also bind actions
## or chains of actions to a command. If it comes to commands,
## syntax is very similar to defining keys. Here goes example
## definition of a command:
##
## def_command "quit" [deferred]
## stop
## quit
##
## If you execute the above command (which can be done by
## invoking action execute_command, typing 'quit' and pressing
## enter), ncmpcpp will stop the player and then quit. Note the
## presence of word 'deferred' enclosed in square brackets. It
## tells ncmpcpp to wait for confirmation (ie. pressing enter)
## after you typed quit. Instead of 'deferred', 'immediate'
## could be used. Then ncmpcpp will not wait for confirmation
## (enter) and will execute the command the moment it sees it.
##
## Note: while command chains are executed, internal environment
## update (which includes current window refresh and mpd status
## update) is not performed for performance reasons. However, it
## may be desirable to do so in some situration. Therefore it's
## possible to invoke by hand by performing 'update enviroment'
## action.
##
## Note: There is a difference between:
##
## def_key "key"
## action1
##
## def_key "key"
## action2
##
## and
##
## def_key "key"
## action1
## action2
##
## First one binds two single actions to the same key whilst
## second one defines a chain of actions. The behavior of
## these two is different and is described in (1) and (2).
##
## Note: Function def_key accepts non-ascii characters.
##
##### List of unbound actions #####
##
## The following actions are not bound to any key/command:
##
## - set_volume
##
#
#def_key "mouse"
# mouse_event
#
#def_key "h"
# previous_column
def_key "j"
scroll_down
def_key "k"
scroll_up
#def_key "l"
# next_column
#def_key "up"
# scroll_up
#
#def_key "shift-up"
# select_item
# scroll_up
#
#def_key "down"
# scroll_down
#
#def_key "shift-down"
# select_item
# scroll_down
#
#def_key "["
# scroll_up_album
#
#def_key "]"
# scroll_down_album
#
#def_key "{"
# scroll_up_artist
#
#def_key "}"
# scroll_down_artist
#
#def_key "page_up"
# page_up
#
#def_key "page_down"
# page_down
#
#def_key "home"
# move_home
#
#def_key "end"
# move_end
#
#def_key "insert"
# select_item
#
#def_key "enter"
# enter_directory
#
#def_key "enter"
# toggle_output
#
#def_key "enter"
# run_action
#
#def_key "enter"
# play_item
#
#def_key "space"
# add_item_to_playlist
#
#def_key "space"
# toggle_lyrics_update_on_song_change
#
#def_key "space"
# toggle_visualization_type
#
#def_key "delete"
# delete_playlist_items
#
#def_key "delete"
# delete_browser_items
#
#def_key "delete"
# delete_stored_playlist
#
#def_key "right"
# next_column
#
#def_key "right"
# slave_screen
#
#def_key "right"
# volume_up
#
#def_key "+"
# volume_up
#
#def_key "left"
# previous_column
#
#def_key "left"
# master_screen
#
#def_key "left"
# volume_down
#
#def_key "-"
# volume_down
#
#def_key ":"
# execute_command
#
#def_key "tab"
# next_screen
#
#def_key "shift-tab"
# previous_screen
#
#def_key "f1"
# show_help
#
#def_key "1"
# show_playlist
#
#def_key "2"
# show_browser
#
#def_key "2"
# change_browse_mode
#
#def_key "3"
# show_search_engine
#
#def_key "3"
# reset_search_engine
#
#def_key "4"
# show_media_library
#
#def_key "4"
# toggle_media_library_columns_mode
#
#def_key "5"
# show_playlist_editor
#
#def_key "6"
# show_tag_editor
#
#def_key "7"
# show_outputs
#
#def_key "8"
# show_visualizer
#
#def_key "="
# show_clock
#
#def_key "@"
# show_server_info
#
#def_key "s"
# stop
#
#def_key "p"
# pause
#
#def_key ">"
# next
#
#def_key "<"
# previous
#
#def_key "ctrl-h"
# jump_to_parent_directory
#
#def_key "ctrl-h"
# replay_song
#
#def_key "backspace"
# jump_to_parent_directory
#
#def_key "backspace"
# replay_song
#
#def_key "f"
# seek_forward
#
#def_key "b"
# seek_backward
#
#def_key "r"
# toggle_repeat
#
#def_key "z"
# toggle_random
#
#def_key "y"
# save_tag_changes
#
#def_key "y"
# start_searching
#
#def_key "y"
# toggle_single
#
#def_key "R"
# toggle_consume
#
#def_key "Y"
# toggle_replay_gain_mode
#
#def_key "T"
# toggle_add_mode
#
#def_key "|"
# toggle_mouse
#
#def_key "#"
# toggle_bitrate_visibility
#
#def_key "Z"
# shuffle
#
#def_key "x"
# toggle_crossfade
#
#def_key "X"
# set_crossfade
#
#def_key "u"
# update_database
#
#def_key "ctrl-s"
# sort_playlist
#
#def_key "ctrl-s"
# toggle_browser_sort_mode
#
#def_key "ctrl-s"
# toggle_media_library_sort_mode
#
#def_key "ctrl-r"
# reverse_playlist
#
#def_key "ctrl-f"
# apply_filter
#
#def_key "ctrl-_"
# select_found_items
#
#def_key "/"
# find
#
#def_key "/"
# find_item_forward
#
#def_key "?"
# find
#
#def_key "?"
# find_item_backward
#
#def_key "."
# next_found_item
#
#def_key ","
# previous_found_item
#
#def_key "w"
# toggle_find_mode
#
#def_key "e"
# edit_song
#
#def_key "e"
# edit_library_tag
#
#def_key "e"
# edit_library_album
#
#def_key "e"
# edit_directory_name
#
#def_key "e"
# edit_playlist_name
#
#def_key "e"
# edit_lyrics
#
#def_key "i"
# show_song_info
#
#def_key "I"
# show_artist_info
#
#def_key "g"
# jump_to_position_in_song
#
#def_key "l"
# show_lyrics
#
#def_key "ctrl-v"
# select_range
#
#def_key "v"
# reverse_selection
#
#def_key "V"
# remove_selection
#
#def_key "B"
# select_album
#
#def_key "a"
# add_selected_items
#
#def_key "c"
# clear_playlist
#
#def_key "c"
# clear_main_playlist
#
#def_key "C"
# crop_playlist
#
#def_key "C"
# crop_main_playlist
#
#def_key "m"
# move_sort_order_up
#
#def_key "m"
# move_selected_items_up
#
#def_key "n"
# move_sort_order_down
#
#def_key "n"
# move_selected_items_down
#
#def_key "M"
# move_selected_items_to
#
#def_key "A"
# add
#
#def_key "S"
# save_playlist
#
#def_key "o"
# jump_to_playing_song
#
#def_key "G"
# jump_to_browser
#
#def_key "G"
# jump_to_playlist_editor
#
#def_key "~"
# jump_to_media_library
#
#def_key "E"
# jump_to_tag_editor
#
#def_key "U"
# toggle_playing_song_centering
#
#def_key "P"
# toggle_display_mode
#
#def_key "\\"
# toggle_interface
#
#def_key "!"
# toggle_separators_between_albums
#
#def_key "L"
# toggle_lyrics_fetcher
#
#def_key "F"
# fetch_lyrics_in_background
#
#def_key "alt-l"
# toggle_fetching_lyrics_in_background
#
#def_key "ctrl-l"
# toggle_screen_lock
#
#def_key "`"
# toggle_library_tag_type
#
#def_key "`"
# refetch_lyrics
#
#def_key "`"
# add_random_items
#
#def_key "ctrl-p"
# set_selected_items_priority
#
#def_key "q"
# quit
#

View file

@ -0,0 +1,14 @@
# vim: filetype=muttrc
set my_email = "admin@reekynet.com"
set from = $my_email
set sendmail = "/usr/bin/msmtp -a $my_email"
set realname = "ReekyNET Admin"
set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---"
set mbox_type = Maildir
set folder = "~/.mail/$my_email"
set mbox = "+INBOX"
set record = "+INBOX"
set postponed = "+Drafts"
set spoolfile = "+INBOX"
mailboxes = +INBOX

View file

@ -0,0 +1,14 @@
# vim: filetype=muttrc
set my_email = "marko.korhonen@metropolia.fi"
set from = $my_email
set sendmail = "/usr/bin/msmtp -a $my_email"
set realname = "Marko Korhonen"
set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---"
set mbox_type = Maildir
set folder = "~/.mail/$my_email"
set mbox = "+INBOX"
set record = "+INBOX"
set postponed = "+Drafts"
set spoolfile = "+INBOX"
mailboxes = +INBOX

View file

@ -0,0 +1,14 @@
# vim: filetype=muttrc
set my_email = "marko.korhonen@reekynet.com"
set from = $my_email
set sendmail = "/usr/bin/msmtp -a $my_email"
set realname = "Marko Korhonen"
set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---"
set mbox_type = Maildir
set folder = "~/.mail/$my_email"
set mbox = "+INBOX"
set record = "+INBOX"
set postponed = "+Drafts"
set spoolfile = "+INBOX"
mailboxes = +INBOX

View file

@ -0,0 +1,15 @@
# vim: filetype=muttrc
# Incoming mail from maildir
set my_email = "reekymarko@reekynet.com"
set from = $my_email
set sendmail = "/usr/bin/msmtp -a $my_email"
set realname = "Marko Korhonen"
set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---"
set mbox_type = Maildir
set folder = ~/.mail/$my_email
set mbox = +INBOX
set record = +Sent
set postponed = +Drafts
set spoolfile = +INBOX
mailboxes = +INBOX

View file

@ -0,0 +1 @@
color normal default default

View file

@ -0,0 +1,15 @@
# vim: filetype=muttrc
set sendmail = "/usr/bin/msmtp"
set mbox_type = Maildir
set folder = ~/.mail
set spoolfile = +Personal/INBOX
source ~/.config/neomutt/appearance
source ~/.config/neomutt/sidebar
source ~/.config/neomutt/accounts/reekymarko@reekynet.com
macro index <f2> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/reekymarko@reekynet.com<enter><change-folder>!<enter>'
macro index <f3> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/marko.korhonen@reekynet.com<enter><change-folder>!<enter>'
macro index <f4> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/admin@reekynet.com<enter><change-folder>!<enter>'
macro index <f5> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/marko.korhonen@metropolia.fi<enter><change-folder>!<enter>'

View file

@ -0,0 +1,5 @@
# vim: filetype=muttrc
set sidebar_visible = yes
set sidebar_indent_string = ' '
sidebar_whitelist '~/.mail/<>/INBOX'

View file

@ -0,0 +1,28 @@
[dmenu]
fn = -*-SF-Pro-Display-Regular-*-*-*-10-*-*-*-*-*-*-*
dmenu_command = /usr/bin/rofi
l = 10
# # Note that dmenu_command can contain arguments as well like `rofi -width 30`
# # Rofi and dmenu are set to case insensitive by default `-i`
# l = number of lines to display, defaults to number of total network options
# fn = font string
# nb = normal background (name, #RGB, or #RRGGBB)
# nf = normal foreground
# sb = selected background
# sf = selected foreground
# b = (just set to empty value and menu will appear at the bottom
# m = number of monitor to display on
# p = Custom Prompt for the networks menu
# pinentry = Pinentry command
# rofi_highlight = <True or False> # (Default: False) use rofi highlighting instead of '**'
# # override normal foreground and background colors (dmenu) or use the
# # -password option (rofi) to obscure passphrase entry
# [dmenu_passphrase]
# nf = #222222
# nb = #222222
# rofi_obscure = True
[editor]
terminal = termite
gui_if_available = True

View file

@ -0,0 +1,45 @@
{
"python.jediEnabled": false,
"python.setLinter": "pylint",
"suggest.noselect": false,
"suggest.echodocSupport": true,
"suggest.maxCompleteItemCount": 20,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact"
],
"eslint.filetypes": [
"javascript",
"typescript",
"typescriptreact",
"javascriptreact"
],
"eslint.autoFixOnSave": false,
"prettier.singleQuote": true,
"diagnostic.errorSign": "•",
"diagnostic.warningSign": "•",
"diagnostic.infoSign": "•",
"suggest.snippetIndicator": "~",
"languageserver": {
"bash": {
"command": "bash-language-server",
"args": ["start"],
"filetypes": ["sh"],
"ignoredRootPaths": ["~"]
},
"xml": {
"command": "xml-language-server",
"args": ["start"],
"filetypes": ["xml"],
"ignoredRootPaths": ["~"]
},
"efm": {
"command": "~/.bin/go/bin/efm-langserver",
"args": [],
"filetypes": ["markdown"]
}
}
}

View file

@ -0,0 +1,97 @@
" Auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
" Set coc extensions
let g:coc_global_extensions = [
\ 'coc-tsserver',
\ 'coc-html',
\ 'coc-tsserver',
\ 'coc-json',
\ 'coc-yaml',
\ 'coc-highlight',
\ 'coc-vimtex',
\ 'coc-prettier',
\ 'coc-python',
\ 'coc-emmet'
\ ]
call plug#begin()
" Make editing passwords safer
Plug 'https://git.zx2c4.com/password-store', { 'rtp': 'contrib/vim/redact_pass.vim' }
" Pandoc live preview
Plug 'ReekyMarko/pandoc-preview.vim'
" Spelling
Plug 'vim-scripts/Vimchant'
" Pandoc plugin
Plug 'vim-pandoc/vim-pandoc'
" Fuzzy finder
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" This is so I can use vim as a diff pager
Plug 'powerman/vim-plugin-AnsiEsc'
" Airline statusline
Plug 'vim-airline/vim-airline'
" Syntax plugins
Plug 'stephpy/vim-yaml'
Plug 'vim-pandoc/vim-pandoc-syntax'
Plug 'leafgarland/typescript-vim'
Plug 'ianks/vim-tsx'
Plug 'kevinoid/vim-jsonc'
Plug 'MaxMEllon/vim-jsx-pretty'
Plug 'zplugin/zplugin-vim-syntax'
Plug 'aouelete/sway-vim-syntax'
" Read editorconfig settings
Plug 'editorconfig/editorconfig-vim'
" Make directory if it doesn't exist
Plug 'pbrisbin/vim-mkdir'
" Tree explorer
Plug 'scrooloose/nerdtree'
" Moar snippets
Plug 'honza/vim-snippets'
" Filetype icons
Plug 'ryanoasis/vim-devicons'
" A personal wiki for vim
Plug 'vimwiki/vimwiki'
" Surround stuff with brackets and quotes
Plug 'tpope/vim-surround'
" Do stuff as sudo
Plug 'lambdalisue/suda.vim'
" Conguer of Completion
Plug 'neoclide/coc.nvim', {'do': './install.sh nightly'}
" Git wrapper
Plug 'tpope/vim-fugitive'
" Git diff in gutter
Plug 'airblade/vim-gitgutter'
" Gpg support
Plug 'jamessan/vim-gnupg'
" Colorscheme
Plug 'morhetz/gruvbox'
" Latex plugin
Plug 'lervag/vimtex'
call plug#end()

View file

@ -0,0 +1,44 @@
" Set colorscheme
colorscheme gruvbox
" Enable italics
let g:gruvbox_italic = 1
" Disable mode indicator because airline shows it
set noshowmode
" True color support
set termguicolors
" Airline
set laststatus=2
set encoding=utf-8
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_section_warning = ''
let g:airline_section_error = ''
let g:airline_theme='gruvbox'
" Line numbering
set number
set relativenumber
" Always show signcolumn
set signcolumn=yes
" Autoindent and syntax highlight
set autoindent
set smartindent
syntax on
filetype on
filetype plugin indent on
set tabstop=4
set shiftwidth=4
" Make gutter and cursorline bg transparent
highlight CursorLineNr guibg=transparent
highlight SignColumn guibg=transparent
highlight GitGutterAdd guibg=transparent guifg=#b8bb26
highlight GitGutterChange guibg=transparent guifg=#8ec07c
highlight GitGutterDelete guibg=transparent guifg=#fb4934
highlight GitGutterChangeDelete guibg=transparent guifg=#8ec07c

View file

@ -0,0 +1,37 @@
" Toggle nerdtree
map <silent> <C-t> :NERDTreeToggle<CR>
" Markdown preview
nmap <C-s> <Plug>MarkdownPreview
nmap <M-s> <Plug>MarkdownPreviewStop
nmap <C-p> <Plug>MarkdownPreviewToggle
" FZF
nmap <C-f> :Files<CR>
nmap <C-g> :Rg<CR>
" Ripgrep command customization
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --hidden --line-number --no-heading --color=always --smart-case '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
set splitbelow
set splitright
" Move between buffers
nnoremap <C-N> :bn<CR>
nnoremap <C-B> :bp<CR>
" Move between splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Enable mouse
set mouse=a
" Preview with pandoc
nnoremap <leader>v :PandocPreview<cr>

View file

@ -0,0 +1,129 @@
" Enable symbol highlight
autocmd CursorHold * silent call CocActionAsync('highlight')
" If hidden is not set, TextEdit might fail.
set hidden
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
" Better display for messages
set cmdheight=2
" Smaller updatetime for CursorHold & CursorHoldI
set updatetime=300
" Don't give |ins-completion-menu| messages.
set shortmess+=c
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <cr> to confirm snippet
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() :
\"\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Use `[c` and `]c` to navigate diagnostics
nmap <silent> [c <Plug>(coc-diagnostic-prev)
nmap <silent> ]c <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Highlight symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
" Remap for rename current word
nmap <leader>rn <Plug>(coc-rename)
" Remap for format selected region
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap for do codeAction of current line
nmap <leader>ac <Plug>(coc-codeaction)
" Fix autofix problem of current line
nmap <leader>qf <Plug>(coc-fix-current)
" Use `:Format` to format current buffer
command! -nargs=0 Format :call CocAction('format')
" Use `:Fold` to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add diagnostic info for https://github.com/itchyny/lightline.vim
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'coc#status'
\ },
\ }
" Using CocList
" Show all diagnostics
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
" Show commands
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list
nnoremap <silent> <space>p :<C-u>CocListResume<CR>

View file

@ -0,0 +1,9 @@
" LaTex settings
let g:vimtex_view_method='zathura'
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_MultipleCompileFormats='pdf, aux'
let g:vimtex_compiler_progname='nvr'
" YAML settings
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab

View file

@ -0,0 +1,34 @@
" Enable python support
let g:python3_host_prog='/usr/bin/python3'
let pyxversion=3
" Use suda by default
let g:suda_smart_edit = 1
" Remap exit terminal mode to esc
tnoremap <Esc> <C-\><C-n>
" Use system clipboard
set clipboard=unnamedplus
" Remove extra line
set cmdheight=1
" Set pandoc preview program
let g:pandoc_preview_pdf_cmd = "zathura"
" Case insensitive seatch
set ignorecase
set smartcase
" Format on paste
set paste
" Automatically change working directory
set autochdir
" Nerdtree settings
let NERDTreeMinimalUI = 1 "remove press ? for help"
let NERDTreeAutoDeleteBuffer = 1 " delete buffer when file is deleted
let NERDTreeQuitOnOpen = 1 " close nerdtree when opening file
let NERDTreeDirArrows = 1

View file

@ -0,0 +1,5 @@
" Run multiple wikis "
let g:vimwiki_list = [
\{'path': '~/Documents/VimWiki/personal.wiki'},
\{'path': '~/Documents/VimWiki/tech.wiki'}
\]

View file

@ -0,0 +1,18 @@
{%@@ if profile == "Mirkwood" @@%}
" Wayland clipboard provider that strips carriage returns (GTK3 issue).
" This is needed because currently there's an issue where GTK3 applications on
" Wayland contain carriage returns at the end of the lines (this is a root
" issue that needs to be fixed).
let g:clipboard = {
\ 'name': 'wayland-strip-carriage',
\ 'copy': {
\ '+': 'wl-copy --foreground --type text/plain',
\ '*': 'wl-copy --foreground --type text/plain --primary',
\ },
\ 'paste': {
\ '+': {-> systemlist('wl-paste --no-newline | tr -d "\r"')},
\ '*': {-> systemlist('wl-paste --no-newline --primary | tr -d "\r"')},
\ },
\ 'cache_enabled': 1,
\ }
{%@@ endif @@%}

View file

@ -0,0 +1,3 @@
for f in split(glob('~/.config/nvim/conf.d/*.vim'), '\n')
exe 'source' f
endfor

View file

@ -0,0 +1,19 @@
" Source UI plugins
set runtimepath+=~/.config/nvim/plugged/vim-airline
set runtimepath+=~/.config/nvim/plugged/gruvbox
" Source syntax plugins
set runtimepath+=~/.config/nvim/plugged/vim-yaml
set runtimepath+=~/.config/nvim/plugged/vim-pandoc-syntax
set runtimepath+=~/.config/nvim/plugged/typescript-vim
set runtimepath+=~/.config/nvim/plugged/vim-tsx
set runtimepath+=~/.config/nvim/plugged/vim-jsonc
set runtimepath+=~/.config/nvim/plugged/vim-jsx-pretty
set runtimepath+=~/.config/nvim/plugged/zplugin-vim-syntax
set runtimepath+=~/.config/nvim/plugged/sway-vim-syntax
set runtimepath+=~/.config/nvim/plugged/vim-pandoc-syntax
source ~/.config/nvim/conf.d/02-appearance.vim
source ~/.config/nvim/conf.d/03-keybinds.vim
source ~/.config/nvim/conf.d/06-misc.vim
source ~/.config/nvim/conf.d/08-clipboardfix.vim

View file

@ -0,0 +1,48 @@
DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'rsync::/usr/bin/rsync --no-motd -z %u %o'
'scp::/usr/bin/scp -C %u %o')
VCSCLIENTS=('bzr::bzr'
'git::git'
'hg::mercurial'
'svn::subversion')
CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
MAKEFLAGS="-j$(nproc)"
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
BUILDENV=(!distcc color !ccache check !sign)
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
INTEGRITY_CHECK=(md5)
STRIP_BINARIES="--strip-all"
STRIP_SHARED="--strip-unneeded"
STRIP_STATIC="--strip-debug"
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
DBGSRCDIR="/usr/src/debug"
COMPRESSGZ=(pigz -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z - --threads=0)
COMPRESSZST=(zstd -c -z -q -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
PKGEXT='.pkg.tar.zst'
SRCEXT='.src.tar.gz'

263
home/.config/polybar/config Normal file
View file

@ -0,0 +1,263 @@
[colors]
background = ${xrdb:color0:#222}
foreground = ${xrdb:color7:#222}
foreground-alt = ${xrdb:color7:#222}
primary = ${xrdb:color1:#222}
secondary = ${xrdb:color2:#222}
alert = ${xrdb:color3:#222}
[bar/top]
monitor= eDP
width = 100%
height = 35
offset-x = 0
offset-y = -1
;bottom = true
background = ${colors.background}
foreground = ${colors.foreground}
underline-size = 2
underline-color = #eee
spacing = 1
module-margin-left = 0
module-margin-right = 0
font-0 = "SF Pro Display:style=regular:pixelsize=13;0"
font-1 = "Material Design Icons:style=Regular:pixelsize=13;1"
modules-left = bspwm
modules-center = player-mpris-tail
modules-right = battery pulseaudio date
tray-position = right
tray-padding = 2
tray-background = ${xrdb:color0:#222}
wm-restack = bspwm
scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev
; MODULES
[module/network]
type = internal/network
interface = wlp1s0
format-connected = <ramp-signal>
ramp-signal-0 = 浪
ramp-signal-1 = 冷
ramp-signal-2 = 爛
ramp-signal-3 = 嵐
ramp-signal-4 = 襤
ramp-signal-5 = 蠟
[module/bspwm]
type = internal/bspwm
ws-icon-0 = web;
ws-icon-1 = term;
ws-icon-2 = chat;ﭕ
ws-icon-3 = mail;
ws-icon-4 = music;
ws-icon-default = 
format = <label-state> <label-mode>
label-focused = %icon%
label-focused-background = #88000000
label-focused-underline= #ddd
label-focused-padding = 4
label-occupied = %icon%
label-occupied-padding = 4
label-urgent = %icon%
label-urgent-padding = 4
label-empty = %icon%
label-empty-foreground = #44ffffff
label-empty-padding = 4
[module/xwindow]
type = internal/xwindow
label = %title:0:120:...%
label-padding = 4
[module/weather]
type = custom/script
exec = weather-bar
tail = true
[module/date]
type = internal/date
; Seconds to sleep between updates
interval = 1.0
; See "man date" for details on how to format the date string
; NOTE: if you want to use syntax tags here you need to use %%{...}
date = " %a %Y-%m-%d"
; Optional time format
time = %H:%M
; if `date-alt` or `time-alt` is defined, clicking
; the module will toggle between formats
date-alt = %A, %d %B %Y
time-alt = %H:%M:%S
label = %date% %time%
format =  <label>
;format-background = #5a000000
format-padding = 3
[module/padding]
type = custom/text
content =
content-foreground = #00000000
content-background = #55000000
[module/battery]
type = internal/battery
full-at = 99
battery = BAT0
adapter = AC0
poll-interval = 5
format-charging = <animation-charging> <label-charging>
format-discharging = <ramp-capacity> <label-discharging>
format-full = <ramp-capacity> <label-full>
label-charging = %percentage%
label-discharging = %percentage%
label-full = %percentage%
format-charging-padding = 3
format-discharging-padding = 3
format-full-padding = 3
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-5 = 
ramp-capacity-6 = 
ramp-capacity-7 = 
ramp-capacity-8 = 
ramp-capacity-9 = 
ramp-capacity-10 = 
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-5 = 
animation-charging-6 = 
animation-charging-7 = 
animation-charging-8 = 
animation-charging-9 = 
animation-charging-10 = 
animation-charging-framerate = 750
[module/xbacklight]
type = internal/backlight
card = amdgpu_bl0
enable-scroll = true
format = <ramp> <label>
label = %percentage%
ramp-0 = 🌕
ramp-1 = 🌔
ramp-2 = 🌓
ramp-3 = 🌒
ramp-4 = 🌑
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <ramp-volume> <label-volume>
format-muted = <label-muted>
label-volume = %percentage%
label-muted =  muted
label-muted-foreground = #aaa
format-volume-padding = 3
format-muted-padding = 3
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
ramp-headphones-0 = 
[module/powermenu]
type = custom/menu
label-open = 
;label-open-background = #dd0000
;label-open-foreground = #fff
label-close = cancel
;label-close-background = #dd0000
;label-close-foreground = #fff
label-open-padding = 4
label-close-padding = 3
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-0-0-padding = 3
menu-0-1-padding = 3
menu-1-0 = reboot?
menu-1-0-exec = sudo reboot
menu-1-0-padding = 3
menu-2-0 = power off?
menu-2-0-exec = sudo poweroff
menu-2-0-padding = 3
[module/player-mpris-tail]
type = custom/script
exec = ~/Scripts/player-mpris-tail.py -f '{icon} {artist} - {title}'
tail = true
label =  %output% 
click-left = ~/Scripts/player-mpris-tail.py play-pause
click-right = ~/Scripts/player-mpris-tail.py next
click-middle = ~/Scripts/player-mpris-tail.py stop
; Seconds to sleep between progressbar/song timer sync
; Default: 1
interval = 2
; Available tags:
; <label-song> (default)
; <label-time>
; <bar-progress>
; <toggle> - gets replaced with <icon-(pause|play)>
; <toggle-stop> - gets replaced with <icon-(stop|play)>
; <icon-random>
; <icon-repeat>
; <icon-repeatone>
; <icon-prev>
; <icon-stop>
; <icon-play>
; <icon-pause>
; <icon-next>
; <icon-seekb>
; <icon-seekf>
format-online =  <label-song>
; Available tokens:
; %artist%
; %album%
; %date%
; %title%
; Default: %artist% - %title%
label-song = %title%
format-online-padding = 3

213
home/.config/ranger/commands.py Executable file
View file

@ -0,0 +1,213 @@
# This is a sample commands.py. You can add your own commands here.
#
# Please refer to commands_full.py for all the default commands and a complete
# documentation. Do NOT add them all here, or you may end up with defunct
# commands when upgrading ranger.
# You always need to import ranger.api.commands here to get the Command class:
from ranger.api.commands import *
# A simple command for demonstration purposes follows.
#------------------------------------------------------------------------------
# You can import any python module as needed.
import os
# Any class that is a subclass of "Command" will be integrated into ranger as a
# command. Try typing ":my_edit<ENTER>" in ranger!
class my_edit(Command):
# The so-called doc-string of the class will be visible in the built-in
# help that is accessible by typing "?c" inside ranger.
""":my_edit <filename>
A sample command for demonstration purposes that opens a file in an editor.
"""
# The execute method is called when you run this command in ranger.
def execute(self):
# self.arg(1) is the first (space-separated) argument to the function.
# This way you can write ":my_edit somefilename<ENTER>".
if self.arg(1):
# self.rest(1) contains self.arg(1) and everything that follows
target_filename = self.rest(1)
else:
# self.fm is a ranger.core.filemanager.FileManager object and gives
# you access to internals of ranger.
# self.fm.thisfile is a ranger.container.file.File object and is a
# reference to the currently selected file.
target_filename = self.fm.thisfile.path
# This is a generic function to print text in ranger.
self.fm.notify("Let's edit the file " + target_filename + "!")
# Using bad=True in fm.notify allows you to print error messages:
if not os.path.exists(target_filename):
self.fm.notify("The given file does not exist!", bad=True)
return
# This executes a function from ranger.core.acitons, a module with a
# variety of subroutines that can help you construct commands.
# Check out the source, or run "pydoc ranger.core.actions" for a list.
self.fm.edit_file(target_filename)
# The tab method is called when you press tab, and should return a list of
# suggestions that the user will tab through.
def tab(self):
# This is a generic tab-completion function that iterates through the
# content of the current directory.
return self._tab_directory_content()
# https://github.com/ranger/ranger/wiki/Integrating-File-Search-with-fzf
# Now, simply bind this function to a key, by adding this to your ~/.config/ranger/rc.conf: map <C-f> fzf_select
class fzf_select(Command):
"""
:fzf_select
Find a file using fzf.
With a prefix argument select only directories.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
# match only directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
else:
# match files and directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
# fzf_locate
class fzf_locate(Command):
"""
:fzf_locate
Find a file using fzf.
With a prefix argument select only directories.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
command="locate home media | fzf -e -i"
else:
command="locate home media | fzf -e -i"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
class fzf_bring(Command):
"""
:fzf_bring
Find a file using fzf and bring it to the current directory.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
# match only directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
else:
# match files and directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
import os
from ranger.core.loader import CommandLoader
class compress(Command):
def execute(self):
""" Compress marked files to current directory """
cwd = self.fm.thisdir
marked_files = cwd.get_selection()
if not marked_files:
return
def refresh(_):
cwd = self.fm.get_directory(original_path)
cwd.load_content()
original_path = cwd.path
parts = self.line.split()
au_flags = parts[1:]
descr = "compressing files in: " + os.path.basename(parts[1])
obj = CommandLoader(args=['apack'] + au_flags + \
[os.path.relpath(f.path, cwd.path) for f in marked_files], descr=descr)
obj.signal_bind('after', refresh)
self.fm.loader.add(obj)
def tab(self):
""" Complete with current folder name """
extension = ['.zip', '.tar.gz', '.rar', '.7z']
return ['compress ' + os.path.basename(self.fm.thisdir.path) + ext for ext in extension]
import os
from ranger.core.loader import CommandLoader
class extracthere(Command):
def execute(self):
""" Extract copied files to current directory """
copied_files = tuple(self.fm.copy_buffer)
if not copied_files:
return
def refresh(_):
cwd = self.fm.get_directory(original_path)
cwd.load_content()
one_file = copied_files[0]
cwd = self.fm.thisdir
original_path = cwd.path
au_flags = ['-X', cwd.path]
au_flags += self.line.split()[1:]
au_flags += ['-e']
self.fm.copy_buffer.clear()
self.fm.cut_buffer = False
if len(copied_files) == 1:
descr = "extracting: " + os.path.basename(one_file.path)
else:
descr = "extracting files from: " + os.path.basename(one_file.dirname)
obj = CommandLoader(args=['aunpack'] + au_flags \
+ [f.path for f in copied_files], descr=descr)
obj.signal_bind('after', refresh)
self.fm.loader.add(obj)

View file

@ -0,0 +1,50 @@
# image previews
#set preview_script /usr/share/doc/ranger/config/scope.sh
set preview_images true
set preview_images_method ueberzug
# appearance
set draw_borders true
set colorscheme default
set column_ratios 1,3,4
set padding_right true
set show_selection_in_titlebar true
set display_size_in_main_column true
set display_size_in_status_bar true
set display_tags_in_all_columns true
# extract archive
map X shell extracthere %f
# make file runnable
map x shell chmod -x %s
# don't show hidden files
set show_hidden false
# confirm on multiple file delete
set confirm_on_delete multiple
set tilde_in_titlebar true
# VIM keybinds
copymap <UP> k
copymap <DOWN> j
copymap <LEFT> h
copymap <RIGHT> l
copymap <HOME> gg
copymap <END> G
copymap <PAGEDOWN> <C-F>
copymap <PAGEUP> <C-B>
map / console search%space
map n search_next
map N search_next forward=False
map ct search_next order=tag
map cs search_next order=size
map ci search_next order=mimetype
map cc search_next order=ctime
map cm search_next order=mtime
map ca search_next order=atime
# toggle hidden
map zh toggle_option show_hidden

View file

@ -0,0 +1,3 @@
[manual]
lat=60.19
lon=24.94

View file

@ -0,0 +1,88 @@
# permanently set alternative root dir. Use ":" to separate multiple roots
# which can be switched at runtime with shift+left/right
# root=/path/to/root
# rofi command. Make sure to have "$@" as last argument
_rofi () {
rofi -i -no-auto-select "$@"
}
# image viewer to display qrcode of selected entry
# qrencode is needed to generate the image and a viewer
# that can read from pipes. Known viewers to work are feh and display
_image_viewer () {
feh -
# display
}
# xdotool needs the keyboard layout to be set using setxkbmap
# You can do this in your autostart scripts (e.g. xinitrc)
# If for some reason, you cannot do this, you can set the command here.
# and set fix_layout to true
fix_layout=false
layout_cmd () {
setxkbmap eu
}
# fields to be used
URL_field='url'
USERNAME_field='username'
AUTOTYPE_field='autotype'
# delay to be used for :delay keyword
delay=2
# rofi-pass needs to close itself before it can type passwords. Set delay here.
wait=0.2
## Programs to be used
# Editor
EDITOR='gvim -f'
# Browser
BROWSER='xdg-open'
## Misc settings
default_do='menu' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
auto_enter='true'
notify='false'
default_autotype='user :tab pass'
# color of the help messages
# leave empty for autodetection
help_color="#4872FF"
# Clipboard settings
# Possible options: primary, clipboard, both
clip=primary
## Options for generating new password entries
# open new password entries in editor
edit_new_pass="true"
# default_user is also used for password files that have no user field.
#default_user="${ROFI_PASS_DEFAULT_USER-$(whoami)}"
#default_user2=mary_ann
#password_length=12
# Custom Keybindings
autotype="Alt+1"
type_user="Alt+2"
type_pass="Alt+3"
open_url="Alt+4"
copy_name="Alt+u"
copy_url="Alt+l"
copy_pass="Alt+p"
show="Alt+o"
copy_entry="Alt+2"
type_entry="Alt+1"
copy_menu="Alt+c"
action_menu="Alt+a"
type_menu="Alt+t"
help="Alt+h"
switch="Alt+x"
insert_pass="Alt+n"

9
home/.config/rofi/config Normal file
View file

@ -0,0 +1,9 @@
rofi.lines: 5
rofi.eh: 2
rofi.padding: 50
rofi.fullscreen: false
rofi.bw: 0
rofi.separator-style: none
rofi.hide-scrollbar: true
rofi.font: Overpass 22
rofi.theme: ~/.config/rofi/gruvbox-dark.rasi

View file

@ -0,0 +1,127 @@
/* ==========================================================================
File: gruvbox-common.rasi
Desc: Shared rules between all gruvbox themes
Author: bardisty <b@bah.im>
Source: https://github.com/bardisty/gruvbox-rofi
Modified: Mon Feb 12 2018 06:06:47 PST -0800
========================================================================== */
window {
background-color: @background;
border: 2;
padding: 2;
}
mainbox {
border: 0;
padding: 0;
}
message {
border: 2px 0 0;
border-color: @separatorcolor;
padding: 1px;
}
textbox {
highlight: @highlight;
text-color: @foreground;
}
listview {
border: 2px solid 0 0;
padding: 2px 0 0;
border-color: @separatorcolor;
spacing: 2px;
scrollbar: @scrollbar;
}
element {
border: 0;
padding: 2px;
}
element.normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
element.normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
element.selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
element.selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
element.alternate.normal {
background-color: @alternate-normal-background;
text-color: @alternate-normal-foreground;
}
element.alternate.urgent {
background-color: @alternate-urgent-background;
text-color: @alternate-urgent-foreground;
}
element.alternate.active {
background-color: @alternate-active-background;
text-color: @alternate-active-foreground;
}
scrollbar {
width: 4px;
border: 0;
handle-color: @scrollbar-handle;
handle-width: 8px;
padding: 0;
}
sidebar {
border: 2px 0 0;
border-color: @separatorcolor;
}
inputbar {
spacing: 0;
text-color: @normal-foreground;
padding: 2px;
children: [ prompt, textbox-prompt-sep, entry, case-indicator ];
}
case-indicator,
entry,
prompt,
button {
spacing: 0;
text-color: @normal-foreground;
}
button.selected {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
textbox-prompt-sep {
expand: false;
str: ":";
text-color: @normal-foreground;
margin: 0 0.3em 0 0;
}

View file

@ -0,0 +1,61 @@
/* ==========================================================================
Rofi color theme
Based on the Gruvbox color scheme for Vim by morhetz
https://github.com/morhetz/gruvbox
File: gruvbox-dark-soft.rasi
Desc: Gruvbox dark (soft contrast) color theme for Rofi
Author: bardisty <b@bah.im>
Source: https://github.com/bardisty/gruvbox-rofi
Modified: Mon Feb 12 2018 06:04:37 PST -0800
========================================================================== */
* {
/* Theme settings */
highlight: bold italic;
scrollbar: true;
/* Gruvbox dark colors */
gruvbox-dark-bg0-soft: #32302f;
gruvbox-dark-bg1: #3c3836;
gruvbox-dark-bg3: #665c54;
gruvbox-dark-fg0: #fbf1c7;
gruvbox-dark-fg1: #ebdbb2;
gruvbox-dark-red-dark: #cc241d;
gruvbox-dark-red-light: #fb4934;
gruvbox-dark-yellow-dark: #d79921;
gruvbox-dark-yellow-light: #fabd2f;
gruvbox-dark-gray: #a89984;
/* Theme colors */
background: @gruvbox-dark-bg0-soft;
background-color: @background;
foreground: @gruvbox-dark-fg1;
border-color: @gruvbox-dark-gray;
separatorcolor: @border-color;
scrollbar-handle: @border-color;
normal-background: @background;
normal-foreground: @foreground;
alternate-normal-background: @background;
alternate-normal-foreground: @foreground;
selected-normal-background: @gruvbox-dark-bg3;
selected-normal-foreground: @gruvbox-dark-fg0;
active-background: @gruvbox-dark-yellow-dark;
active-foreground: @background;
alternate-active-background: @active-background;
alternate-active-foreground: @active-foreground;
selected-active-background: @gruvbox-dark-yellow-light;
selected-active-foreground: @active-foreground;
urgent-background: @gruvbox-dark-red-dark;
urgent-foreground: @background;
alternate-urgent-background: @urgent-background;
alternate-urgent-foreground: @urgent-foreground;
selected-urgent-background: @gruvbox-dark-red-light;
selected-urgent-foreground: @urgent-foreground;
}
@import "gruvbox-common.inc"

150
home/.config/rofi/nord.rasi Normal file
View file

@ -0,0 +1,150 @@
* {
nord0: #2E3440;
nord1: #3B4252;
nord2: #434C5E;
nord3: #4C566A;
nord4: #D8DEE9;
nord5: #E5E9F0;
nord6: #ECEFF4;
nord7: #8FBCBB;
nord8: #88C0D0;
nord9: #81A1C1;
nord10: #5E81AC;
nord11: #BF616A;
nord12: #D08770;
nord13: #EBCB8B;
nord14: #A3BE8C;
nord15: #B48EAD;
background: @nord0;
foreground: @nord4;
selected-normal-foreground: @nord4;
normal-foreground: @foreground;
alternate-normal-background: @nord0;
selected-urgent-foreground: @nord4;
urgent-foreground: @foreground;
alternate-urgent-background: @nord0;
active-foreground: @foreground;
selected-active-foreground: @foreground;
alternate-active-background: @nord0;
bordercolor: @nord10;
alternate-normal-foreground: @foreground;
normal-background: @background;
selected-normal-background: @nord3;
border-color: @nord10;
spacing: 2;
separatorcolor: @blue;
urgent-background: @background;
selected-urgent-background: @nord3;
alternate-urgent-foreground: @urgent-foreground;
background-color: @background;
alternate-active-foreground: @active-foreground;
active-background: @background;
selected-active-background: @nord3;
}
//----------------------
// Style
//----------------------
#window {
background-color: @background;
}
#mainbox {
border: 2;
padding: 10;
}
#message {
border: 2px 2px 2px ;
border-color: @separatorcolor;
padding: 10 ;
}
#textbox {
text-color: @foreground;
}
#listview {
fixed-height: 0;
padding: 5 0 0;
spacing: 5px ;
}
#element {
border: 0;
padding: 5px ;
}
#element.normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
#element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
#element.normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
#element.selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
#element.selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
#element.alternate.normal {
background-color: @alternate-normal-background;
text-color: @alternate-normal-foreground;
}
#element.alternate.urgent {
background-color: @alternate-urgent-background;
text-color: @alternate-urgent-foreground;
}
#element.alternate.active {
background-color: @alternate-active-background;
text-color: @alternate-active-foreground;
}
#button.selected {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#inputbar {
spacing: 5;
text-color: @normal-foreground;
padding: 5px ;
border: 0 0 1;
border-color: @separatorcolor;
}
#case-indicator {
spacing: 0;
text-color: @normal-foreground;
}
#entry {
spacing: 0;
text-color: @normal-foreground;
}
#prompt {
spacing: 0;
text-color: @normal-foreground;
}

162
home/.config/rtv/rtv.cfg Normal file
View file

@ -0,0 +1,162 @@
; Reddit Terminal Viewer Configuration File
; https://github.com/michael-lazar/rtv
;
; This file should be placed in $XDG_CONFIG/rtv/rtv.cfg
; If $XDG_CONFIG is not set, use ~/.config/rtv/rtv.cfg
[rtv]
##################
# General Settings
##################
; Turn on ascii-only mode to disable all unicode characters.
; This may be necessary for compatibility with some terminal browsers.
ascii = False
; Turn on monochrome mode to disable color.
monochrome = False
; Flash when an invalid action is executed.
flash = True
; Enable debugging by logging all HTTP requests and errors to the given file.
;log = /tmp/rtv.log
; Default subreddit that will be opened when the program launches.
subreddit = front
;subreddit = python
;subreddit = python+linux+programming
;subreddit = all
; Allow rtv to store reddit authentication credentials between sessions.
persistent = True
; Clear any stored credentials when the program starts.
clear_auth = False
; Maximum number of opened links that will be saved in the history file.
history_size = 200
; Open external links using programs defined in the mailcap config.
enable_media = True
; Maximum number of columns for a comment
max_comment_cols = 120
; Hide username if logged in, display "Logged in" instead
hide_username = False
; Color theme, use "rtv --list-themes" to view a list of valid options.
; This can be an absolute filepath, or the name of a theme file that has
; been installed into either the custom of default theme paths.
;theme = molokai
################
# OAuth Settings
################
; This sections defines the paramaters that will be used during the OAuth
; authentication process. rtv is registered as an "installed app",
; see https://github.com/reddit/reddit/wiki/OAuth2 for more information.
; These settings are defined at https://www.reddit.com/prefs/apps and should
; not be altered unless you are defining your own developer application.
oauth_client_id = E2oEtRQfdfAfNQ
oauth_client_secret = praw_gapfill
oauth_redirect_uri = http://127.0.0.1:65000/
; Port that the rtv webserver will listen on. This should match the redirect
; uri defined above.
oauth_redirect_port = 65000
; Access permissions that will be requested.
oauth_scope = edit,history,identity,mysubreddits,privatemessages,read,report,save,submit,subscribe,vote
; This is a separate token for the imgur api. It's used to extract images
; from imgur links and albums so they can be opened with mailcap.
; See https://imgur.com/account/settings/apps to generate your own key.
imgur_client_id = 93396265f59dec9
[bindings]
##############
# Key Bindings
##############
; If you would like to define custom bindings, copy this section into your
; config file with the [bindings] heading. All commands must be bound to at
; least one key for the config to be valid.
;
; 1.) Plain keys can be represented by either uppercase/lowercase characters
; or the hexadecimal numbers referring their ascii codes. For reference, see
; https://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart
; e.g. Q, q, 1, ?
; e.g. 0x20 (space), 0x3c (less-than sign)
;
; 2.) Special ascii control codes should be surrounded with <>. For reference,
; see https://en.wikipedia.org/wiki/ASCII#ASCII_control_code_chart
; e.g. <LF> (enter), <ESC> (escape)
;
; 3.) Other special keys are defined by curses, they should be surrounded by <>
; and prefixed with KEY_. For reference, see
; https://docs.python.org/2/library/curses.html#constants
; e.g. <KEY_LEFT> (left arrow), <KEY_F5>, <KEY_NPAGE> (page down)
;
; Notes:
; - Curses <KEY_ENTER> is unreliable and should always be used in conjunction
; with <LF>.
; - Use 0x20 for the space key.
; - A subset of Ctrl modifiers are available through the ascii control codes.
; For example, Ctrl-D will trigger an <EOT> signal. See the table above for
; a complete reference.
; Base page
EXIT = Q
FORCE_EXIT = q
HELP = ?
SORT_HOT = 1
SORT_TOP = 2
SORT_RISING = 3
SORT_NEW = 4
SORT_CONTROVERSIAL = 5
SORT_GILDED = 6
MOVE_UP = k, <KEY_UP>
MOVE_DOWN = j, <KEY_DOWN>
PREVIOUS_THEME = <KEY_F2>
NEXT_THEME = <KEY_F3>
PAGE_UP = m, <KEY_PPAGE>, <NAK>
PAGE_DOWN = n, <KEY_NPAGE>, <EOT>
PAGE_TOP = gg
PAGE_BOTTOM = G
UPVOTE = a
DOWNVOTE = z
LOGIN = u
DELETE = d
EDIT = e
INBOX = i
REFRESH = r, <KEY_F5>
PROMPT = /
SAVE = w
COPY_PERMALINK = y
COPY_URL = Y
; Submission page
SUBMISSION_TOGGLE_COMMENT = 0x20
SUBMISSION_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER>
SUBMISSION_POST = c
SUBMISSION_EXIT = h, <KEY_LEFT>
SUBMISSION_OPEN_IN_PAGER = l, <KEY_RIGHT>
SUBMISSION_OPEN_IN_URLVIEWER = b
SUBMISSION_GOTO_PARENT = K
SUBMISSION_GOTO_SIBLING = J
; Subreddit page
SUBREDDIT_SEARCH = f
SUBREDDIT_POST = c
SUBREDDIT_OPEN = l, <KEY_RIGHT>
SUBREDDIT_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER>
SUBREDDIT_OPEN_SUBSCRIPTIONS = s
SUBREDDIT_OPEN_MULTIREDDITS = S
SUBREDDIT_FRONTPAGE = p
SUBREDDIT_HIDE = 0x20
; Subscription page
SUBSCRIPTION_SELECT = l, <LF>, <KEY_ENTER>, <KEY_RIGHT>
SUBSCRIPTION_EXIT = h, s, S, <ESC>, <KEY_LEFT>

View file

@ -0,0 +1,6 @@
# vim:ft=sway
set $mod Mod4
set $term alacritty
set $gnome-schema org.gnome.desktop.interface
set $wallpaper ~/Pictures/Wallpapers/random/$(ls ~/Pictures/Wallpapers/random | sort -R | tail -n 1)

View file

@ -0,0 +1,6 @@
# vim:ft=sway
bar {
swaybar_command waybar
output eDP-1
}

View file

@ -0,0 +1,13 @@
# vim:ft=sway
input * {
xkb_layout eu
xkb_options caps:escape
}
input "1739:32382:DELL0884:00_06CB:7E7E_Touchpad" {
tap enabled
natural_scroll enabled
}
input '1267:9364:ELAN_Touchscreen' map_to_output eDP-1

View file

@ -0,0 +1,3 @@
# vim:ft=sway
output * bg $wallpaper fill

View file

@ -0,0 +1,17 @@
# vim:ft=sway
# Start applications in specific workspaces
assign [title="Telegram"] workspace 3
assign [app_id="evolution"] workspace 4
# Make passff float
for_window [title="moz-extension:\/\/aa3e4372-6ac1-4d2f-b1f4-1bd4cf33c726 - Firefox Nightly"] floating enable
# Automatically switch to urgent workspace
for_window [urgent="latest"] focus
# Make gimp export window float
for_window [title="Export Image*"] floating enable
# Make fzf-launcher float
for_window [app_id="fzf-launcher"] focus, floating enabled, border pixel 1

View file

@ -0,0 +1,177 @@
# vim:ft=sway
# start terminal
bindsym $mod+Return exec $term
# kill focused window
bindsym $mod+w kill
# start your launcher
bindsym $mod+Shift+p exec rofi-pass --bmarks
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# reload the configuration file
bindsym $mod+Shift+r reload
# open link from clipboard in default application
bindsym $mod+Shift+o exec mimeo "$(wl-paste)"
# flash the current window
bindsym $mod+n exec flash_window
# turn on and off internal screen
bindsym --locked XF86Search output eDP-1 enable
bindsym --locked Shift+XF86Search output eDP-1 disable
# FZF
# exit menu
bindsym $mod+Shift+e exec $term --class fzf-launcher -e $HOME/Scripts/sway-exit.sh
# launch a program
bindsym $mod+d exec $term --class fzf-launcher --title "FZF Launcher" -e sh -c '~/Scripts/sway-launcher-desktop.sh'
# open a file
bindsym $mod+o exec $term --class fzf-launcher --title "FZF Open file" -e sh -c 'setsid mimeo $(fzf)'
# password manager
bindsym $mod+p exec $term --class fzf-launcher --title "FZF pass" -e sh -c fzf-pass
# manage notifications
bindsym $mod+Backspace exec makoctl invoke
bindsym Control+Escape exec makoctl dismiss
# activate lockscreen
bindsym Control+Shift+l exec loginctl lock-session
# Move your focus around
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# _move_ the focused window with the same, but add Shift
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Layout stuff:
# Split direction
bindsym $mod+y splith
bindsym $mod+x splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+e layout tabbed
bindsym $mod+t layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# move focus to the parent container
bindsym $mod+a focus parent
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym h resize grow width 10px
bindsym j resize shrink height 10px
bindsym k resize grow height 10px
bindsym l resize shrink width 10px
# ditto, with arrow keys
bindsym Left resize grow width 10px
bindsym Down resize shrink height 10px
bindsym Up resize grow height 10px
bindsym Right resize shrink width 10px
# return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# start browser
bindsym $mod+b exec firefox-nightly
# media keys
bindsym --locked XF86AudioRaiseVolume exec pulseaudio-ctl up
bindsym --locked XF86AudioLowerVolume exec pulseaudio-ctl down
bindsym --locked XF86AudioMute exec pulseaudio-ctl mute
bindsym --locked XF86AudioNext exec playerctl next
bindsym --locked XF86AudioPrev exec playerctl previous
bindsym --locked XF86AudioPlay exec playerctl play-pause
bindsym --locked XF86AudioStop exec playerctl stop
bindsym --locked Ctrl+Alt+s exec playerctl stop
# rotate screen
bindsym $mod+Control+Left exec swaymsg output eDP-1 transform 90
bindsym $mod+Control+Down exec swaymsg output eDP-1 transform 0
bindsym $mod+Control+Up exec swaymsg output eDP-1 transform 180
bindsym $mod+Control+Right exec swaymsg output eDP-1 transform 270
# display brightness
bindsym --locked XF86MonBrightnessUp exec light -A 5
bindsym --locked XF86MonBrightnessDown exec light -U 5
# switch to urgent workspace
bindsym $mod+u [urgent=latest] focus
# Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# Move container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# Take a screenshot to clipboard
bindsym Print exec grim -g "$(slurp -d)" - | wl-copy -t image/png
# Copy qr code to clipboard
bindsym Shift+Print exec grim -g "$(slurp -d)" - | zbarimg -q --raw PNG:- | wl-copy

View file

@ -0,0 +1,17 @@
# vim:ft=sway
default_border none
gaps inner 10
gaps outer 20
seat * hide_cursor 4000
###### Borders ######
# class border backgr. text indicator child_border
#client.focused #F7B125 #F7B125 #FFFFFF #377375 #F7B125
#client.focused_inactive #5C6370 #2E3440 #FFFFFF #2E3440 #2E3440
#client.unfocused #5C6370 #2E3440 #FFFFFF #2E3440 #2E3440
#for_window [app_id="^.*"] border pixel 5
#for_window [class="^.*"] border pixel 5
#####################

View file

@ -0,0 +1,36 @@
# vim:ft=sway
exec {
{%@@ if profile == "Mirkwood" @@%}
nm-applet --indicator
redshift-gtk -m wayland
mpDris2
evolution
telegram-desktop
syncthing-gtk -m
mako
$HOME/Scripts/swayidle.sh
{%@@ elif profile == "Rivendell" @@%}
kodi
{%@@ endif @@%}
/usr/lib/kdeconnectd
kdeconnect-indicator
/usr/bin/gnome-keyring-daemon --start --components=secrets
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
ydotoold
wl-paste -t text --watch clipman store
autotiling
}
exec_always {
{%@@ if profile == "Mirkwood" @@%}
bash $HOME/.config/sway/randr/laptop.sh
{%@@ endif @@%}
gsettings set $gnome-schema gtk-theme 'Matcha-dark-aliz'
gsettings set $gnome-schema icon-theme 'Numix'
gsettings set $gnome-schema cursor-theme 'Breeze'
gsettings set $gnome-schema font-name 'Overpass 12'
gsettings set $gnome-schema document-font-name 'Overpass 12'
gsettings set $gnome-schema monospace-font-name 'Hack Nerd Font Mono 12'
flashfocus
}

1
home/.config/sway/config Normal file
View file

@ -0,0 +1 @@
include ~/.config/sway/conf.d/*.conf

19
home/.config/sway/env Normal file
View file

@ -0,0 +1,19 @@
# Fix java on wayland
_JAVA_AWT_WM_NONREPARENTING=1
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
# Enable qt5 theming and wayland support
QT_QPA_PLATFORMTHEME=qt5ct
QT_QPA_PLATFORM=wayland-egl
QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# Firefox
MOZ_ENABLE_WAYLAND=1
MOZ_USE_XINPUT2=1
MOZ_WEBRENDER=1
# Fix redshift on wlroots
WLR_DRM_NO_ATOMIC=1
# Make clutter programs use wayland
CLUTTER_BACKEND=wayland

View file

@ -0,0 +1,3 @@
wlr-randr \
--output eDP-1 --mode 1920x1080 --pos 0,0 --transform normal \
--output HDMI-A-1 --mode 1920x1080 --pos 1900,0 --transform normal \

View file

@ -0,0 +1,43 @@
# DO NOT CHANGE THIS FILE. Override these defaults by writing new files in
# /etc/sway/security.d/*
# Configures enabled compositor features for specific programs
permit * fullscreen keyboard mouse
permit /usr/bin/swaylock lock
permit /usr/bin/swaybg background
permit /usr/bin/swaybar panel
# Configures enabled IPC features for specific programs
ipc /usr/bin/swaymsg {
* enabled
events {
* disabled
}
}
ipc /usr/bin/swaybar {
bar-config enabled
outputs enabled
workspaces enabled
command enabled
events {
workspace enabled
mode enabled
}
}
ipc /usr/bin/swaylock {
outputs enabled
}
# Limits the contexts from which certain commands are permitted
commands {
* all
fullscreen binding criteria
bindsym config
exit binding
kill binding
}

209
home/.config/sxhkd/sxhkdrc Normal file
View file

@ -0,0 +1,209 @@
#
# wm independent hotkeys
#
# terminal emulator
super + Return
termite
# rotate screen
super + shift + Left
xrandr --output eDP --rotate left && xinput set-prop "ELAN Touchscreen" --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
super + shift + Right
xrandr --output eDP --rotate right && xinput set-prop "ELAN Touchscreen" --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
super + shift + Up
xrandr --output eDP --rotate normal && xinput set-prop "ELAN Touchscreen" --type=float "Coordinate Transformation Matrix" 0 0 0 0 0 0 0 0 0
super + shift + Down
xrandr --output eDP --rotate inverted && xinput set-prop "ELAN Touchscreen" --type=float "Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1
# play music / video from clipboard with mpv (second one can be used to open with default application using mimeo)
super + shift + p
mpv --no-video "$(xclip -o -selection clipboard)"
super + shift + o
mimeo "$(xclip -o -selection clipboard)"
# connect to bluetooth speaker and headset
XF86Search
bluetoothctl connect 27:59:BE:CE:45:42
shift + XF86Search
bluetoothctl connect 17:08:01:0D:09:33
# program launcher
super + d
rofi -show-icons -show drun
å
rofi -show-icons -show drun
# password manager
super + p
rofi-pass --last-used
# password manager bookmarks
super + shift + b
rofi-pass --bmarks --last-used
# networkmanager_dmenu
super + x
networkmanager_dmenu
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd; \
notify-send "sxhkd config reloaded"
#
# bspwm hotkeys
#
# quit bspwm normally
super + shift + e
bspc quit
# close and kill
super + {_,shift + }w
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# if the current node is automatic, send it to the last manual, otherwise pull the last leaf
super + y
bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused
# swap the current node and the biggest node
super + g
bspc node -s biggest
# open browser
super + b
/usr/local/bin/firefox-nightly
#
# state/flags
#
# set the window state
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
super + ctrl + {x,y,z}
bspc node -g {locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
# super + {p,b,comma,period}
# bspc node -f @{parent,brother,first,second}
# focus the next/previous node
super + {_,shift + }c
bspc node -f {next,prev}
# focus the next/previous desktop
super + bracket{left,right}
bspc desktop -f {prev,next}
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
# focus the next/previous node in the same window
super + {comma,period}
bspc node -f {next,prev}.local
#
# preselect
#
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
super + {equal,minus}
bspc config window_gap $(( $(bspc config window_gap) {+,-} 5 ))
super + ctrl + {Left,Right,Up,Down}
bspc node @focused:/ --rotate {270,90,180,180}
# screenshots
Print
maim -u -s -l -c 0.157,0.333,0.466,0.4 | xclip -selection clipboard -t image/png && canberra-gtk-play -i camera-shutter
# volume
XF86AudioRaiseVolume
amixer -D pulse sset Master 5%+
XF86AudioLowerVolume
amixer -D pulse sset Master 5%-
XF86AudioMute
amixer -D pulse set Master 1+ toggle
# monitor brightness
XF86MonBrightnessUp
light -A 5
XF86MonBrightnessDown
light -U 5
# music controls
XF86AudioNext
playerctl next
XF86AudioPrev
playerctl previous
XF86AudioPlay
playerctl play-pause
XF86AudioStop
playerctl stop
ctrl + alt + s
playerctl stop
# Lock Desktop
ctrl + shift + l
xset s activate

View file

@ -0,0 +1,11 @@
[Unit]
Description=Aria2 download manager
[Service]
Type=forking
ExecStart=/usr/bin/aria2c --daemon --enable-rpc --rpc-listen-all --rpc-allow-origin-all --rpc-certificate %h/.config/aria2/cert.pem --private-key %h/.config/aria2/key.pem --rpc-secure --save-session %h/.config/aria2/session.lock --input-file %h/.config/aria2/session.lock --conf-path %h/.config/aria2/aria2.conf --dir %h/Downloads
RestartSec=1min
Restart=on-failure
[Install]
WantedBy=default.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=A simple clipboard manager for Wayland
PartOf=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/clipman -d
[Install]
WantedBy=sway-session.target

View file

@ -0,0 +1,9 @@
[Unit]
Description=Listenbrainz scrobbler for MPD
After=mpd.service
[Service]
ExecStart=%h/.bin/go/bin/libra
[Install]
WantedBy=default.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=A lightweight Wayland notification daemon
Documentation=man:mako(1)
PartOf=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/mako
[Install]
WantedBy=sway-session.target

View file

@ -0,0 +1,6 @@
[Unit]
Description=sway compositor session
Documentation=man:systemd.special(7)
BindsTo=graphical-session.target
Wants=graphical-session-pre.target
After=graphical-session-pre.target

View file

@ -0,0 +1,17 @@
[Unit]
Description=sway - SirCmpwn's Wayland window manager
Documentation=man:sway(5)
BindsTo=graphical-session.target
Wants=graphical-session-pre.target
After=graphical-session-pre.target
[Service]
Type=simple
EnvironmentFile=-%h/.config/sway/env
ExecStart=/usr/bin/sway
Restart=on-failure
RestartSec=1
TimeoutStopSec=10
[Install]
WantedBy=default.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=Idle manager for Wayland
Documentation=man:swayidle(1)
PartOf=graphical-session.target
[Service]
Type=simple
ExecStart=%h/Scripts/swayidle.sh
[Install]
WantedBy=sway-session.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
Documentation=https://github.com/Alexays/Waybar/wiki/
PartOf=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/waybar
[Install]
WantedBy=sway-session.target

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,44 @@
[options]
font = Noto Color Emoji 12
font = Material Design Icons 12
font = Hack Nerd Font 12
[colors]
# special
foreground = #d8dee9
foreground_bold = #d8dee9
cursor = #d8dee9
background = #2e3440
# black
color0 = #3b4252
color8 = #4c566a
# red
color1 = #bf616a
color9 = #bf616a
# green
color2 = #a3be8c
color10 = #a3be8c
# yellow
color3 = #ebcb8b
color11 = #ebcb8b
# blue
color4 = #81a1c1
color12 = #81a1c1
# magenta
color5 = #b48ead
color13 = #b48ead
# cyan
color6 = #88c0d0
color14 = #8fbcbb
# white
color7 = #e5e9f0
color15 = #eceff4

View file

@ -0,0 +1,5 @@
{%@@ if profile == "ReekyPC" @@%}
device_config:
- id_uuid: 10879044936567925003
ignore:true
{%@@ endif @@%}

View file

@ -0,0 +1,15 @@
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

120
home/.config/waybar/config Normal file
View file

@ -0,0 +1,120 @@
// vim: ft=jsonc
{
"layer": "bottom", // Waybar at top layer
"height": 22, // Waybar height
"modules-left": ["sway/workspaces", "sway/mode", "custom/playerctl"],
"modules-center": ["sway/window"],
"modules-right": [
"idle_inhibitor",
"pulseaudio",
"network",
"cpu",
"memory",
"battery",
"clock",
"tray"
],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"urgent": "",
"focused": "",
"default": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"idle_inhibitor": {
"tooltip": false,
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"tooltip": false,
"format": "{:%Y-%m-%d %H:%M}"
},
"cpu": {
"tooltip": false,
"format": "{usage}% CPU"
},
"memory": {
"tooltip": false,
"format": "{}% RAM"
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", ""]
},
"battery": {
"tooltip": false,
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
"tooltip": false,
"interface": "wg0",
"format-ethernet": "VPN Connected",
"format-disconnected": "VPN disconnected ⚠",
"on-click": "sudo systemctl start wg-quick@wg0.service",
"on-click-right": "sudo systemctl stop wg-quick@wg0.service",
"interval": 10
},
"pulseaudio": {
"tooltip": false,
//"scroll-step": 1,
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pulseaudio-ctl mute",
"on-click-right": "pavucontrol",
"on-scroll-up": "pulseaudio-ctl up",
"on-scroll-down": "pulseaudio-ctl down"
},
"custom/playerctl": {
"tooltip": false,
"format": "{}",
"exec": "$HOME/Scripts/metadata.sh",
"interval": 2,
"max-length": 40,
"on-click": "playerctl play-pause",
"on-click-right": "playerctl next",
"on-scroll-up": "playerctl volume 0.05+",
"on-scroll-down": "playerctl volume 0.05-"
}
}

View file

@ -0,0 +1,111 @@
* {
border: none;
border-radius: 0;
font-family: "Noto Sans Display", "Font Awesome 5 Free";
font-size: 13px;
min-height: 0;
}
window#waybar {
background: #282828;
color: white;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button {
padding: 0 5px;
background: transparent;
color: white;
}
#workspaces button.focused {
background: #64727D;
}
#mode {
background: #64727D;
}
#clock, #battery, #cpu, #memory, #backlight, #network, #pulseaudio, #custom-playerctl, #tray, #mode, #idle_inhibitor {
padding: 0 10px;
margin: 0 5px;
}
#clock {
background-color: #64727D;
}
#battery {
background-color: #ffffff;
color: black;
}
#battery.charging {
color: black;
background-color: #a3be8c;
}
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
#battery.critical:not(.charging) {
background: #bf616a;
color: white;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#cpu {
background: #2ecc71;
color: #000000;
}
#memory {
color: black;
background: #b48ead;
}
#backlight {
background: #90b1b1;
}
#network {
color: black;
background: #81a1c1;
}
#network.disconnected {
background: #f53c3c;
}
#pulseaudio {
background: #88c0d0;
color: black;
}
#pulseaudio.muted {
background: #90b1b1;
color: #2a5c45;
}
#custom-playerctl {
background: #a3be8c;
color: #2a5c45;
}
#tray {
background-color: #282828;
}
#idle_inhibitor {
background-color: #8fbcbb;
color: #000000;
}

View file

@ -0,0 +1,51 @@
[weather]
; If you have a Weather Underground API key, provide it here. When you provide an API key here,
; weather-bar will use the WU API instead of NOAA, which enables much more weather detail and more
; frequent weather updates.
;
; If you don't yet have an API key, you can sign up for their **free** "Stratus" plan, which gives
; you 500 queries per day. https://www.wunderground.com/api
weather-underground-api-key = "fde86b6cdf518288"
; By default, noaa-weather-bar will attempt to geolocate you and determine the nearest NOAA weather station
; based on this location. If the geolocation is failing or inaccurate, you can override it by providing a
; latitude and longitude (in +/- DD.dddddd format) or a NOAA station ID here.
;
; To hardcode a latitude/longitude, uncomment the following:
; latitude = 39.17851
; longitude = -96.63765
;
; To hardcode a specific ICAO or WU PWS weather station, uncomment the following:
; station = "KMHK"
; station = "KTXALAMO5"
[format]
; weather-format formats the line as displayed in your bar.
;
; Available tokens:
; ------------------------
; %temperature-fahrenheit% - Temperature in degrees Fahrenheit
; %temperature-celcius% - Temperature in degrees Celcius
; %barometer% - Barometer in millibar
; %wind-speed-mph% - Wind speed in miles/hour
; %wind-speed-kph% - Wind speed in kilometers/hour
; %wind-direction% - Wind direction in degrees
; %wind-cardinal% - Wind direction in cardinals (e.g. N, SW, WNW, etc.)
; %station-id% - NOAA station ID (e.g. KMHK)
;
; The folowing tokens are also available if you have provided your Weather Underground API
; key above (they will not work for NOAA reports):
; ----------------------------------------------------------------------------------------
; %weather% - Current general weather conditions (e.g. "Partly Cloudy")
; %wind-gust-mph% - Maximum wind gust in miles/hour
; %wind-gust-kph% - Maximum wind gust in kilometers/hour
; %humidity% - Humidity in %
; %wind-chill-fahrenheit% - Wind chill in degrees Fahrenheit
; %wind-chill-celcius% - Wind chill in degrees Celcius
; %heat-index-fahrenheit% - Heat index in degrees Fahrenheit
; %heat-index-celcius% - Heat index in degrees Celcius
; %rain-today-inches% - Rainfall today in inches
; %rain-last-hour-inches% - Rainfall in the last hour in inches
weather-format = " %station-id%  %temperature-celcius%°C  %wind-cardinal% @ %wind-speed-kph% kph"

View file

@ -0,0 +1,40 @@
{
"aururl": "https://aur.archlinux.org",
"buildDir": "$HOME/.cache/yay",
"editor": "vim",
"editorflags": "",
"makepkgbin": "makepkg",
"makepkgconf": "",
"pacmanbin": "pacman",
"pacmanconf": "/etc/pacman.conf",
"tarbin": "bsdtar",
"redownload": "no",
"rebuild": "no",
"answerclean": "",
"answerdiff": "",
"answeredit": "",
"answerupgrade": "",
"gitbin": "git",
"gpgbin": "gpg",
"gpgflags": "",
"mflags": "",
"sortby": "votes",
"gitflags": "",
"removemake": "ask",
"requestsplitn": 150,
"sortmode": 0,
"completionrefreshtime": 7,
"sudoloop": false,
"timeupdate": false,
"devel": true,
"cleanAfter": false,
"gitclone": true,
"provides": true,
"pgpfetch": true,
"upgrademenu": true,
"cleanmenu": true,
"diffmenu": true,
"editmenu": false,
"combinedupgrade": true,
"useask": false
}

Some files were not shown because too many files have changed in this diff Show more