Compare commits

...
This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.

59 Commits
main ... old

Author SHA1 Message Date
lelgenio 38d15eb601 :) 2020-06-17 13:52:30 -03:00
lelgenio 8409bc1e5c :) 2020-06-17 05:25:10 -03:00
lelgenio 4178222332 :) 2020-06-16 16:58:16 -03:00
lelgenio bca58321d4 update accent color 2020-05-21 21:34:08 -03:00
lelgenio be5865c31d revert to overlay 2020-05-17 19:41:09 -03:00
lelgenio e0bf147ccd adapt to dvorak 2020-05-17 19:40:41 -03:00
lelgenio 89ac282d5d add bspwm/sxhkd 2020-05-17 19:33:58 -03:00
lelgenio df3efb6979 use ly and some fixes to netctl 2020-05-03 02:28:33 -03:00
lelgenio 16f6355470 use reflector on install 2020-05-03 00:56:17 -03:00
lelgenio 1dc5024ab6 fix disk size detection 2020-05-03 00:07:58 -03:00
lelgenio a3d8b77b2c installer: don't use contiguos swap to avoid headache 2020-05-02 23:57:04 -03:00
lelgenio 7a38b78a9d add round-vol script 2020-05-02 21:28:03 -03:00
lelgenio b1047070d3 mime: move to transmission 2020-05-02 21:27:49 -03:00
lelgenio e26e65a4e9 waybar: better battery status 2020-05-02 21:26:47 -03:00
lelgenio 8fb70ee2fd sway: add ignore mode 2020-05-02 21:26:06 -03:00
lelgenio 7954b7dc58 fish: better environment variable config 2020-04-29 23:34:35 -03:00
lelgenio 658f2250e5 fish: remove edit-commandline since its already present(alt+e/v) 2020-04-28 00:22:11 -03:00
lelgenio 5ad0b125f6 add wdmenu 2020-04-27 19:24:16 -03:00
lelgenio 241a9313a3 wpass: fix for bmenu 2020-04-27 19:13:01 -03:00
lelgenio c5f9445103 add 'launcher script' and add input to default groups 2020-04-27 03:54:08 -03:00
lelgenio 90dc5ac05f bmenu: exit fullscreen when running 2020-04-26 03:43:54 -03:00
lelgenio 3924986ee7 limit ytdl quality 2020-04-25 14:08:34 -03:00
lelgenio 936c2a21c9 bump 2020-04-25 01:10:37 -03:00
lelgenio b680e84274 fish: beam on insert mode and other neat stuff 2020-04-24 20:21:12 -03:00
lelgenio 9650b5de02 bump 2020-04-24 18:17:08 -03:00
lelgenio 660be75a7c add devicons 2020-04-24 16:38:24 -03:00
lelgenio 1fc556fa0c bump 2020-04-23 18:59:39 -03:00
lelgenio 92dd3cecf8 fix in gui-cli 2020-04-23 18:59:14 -03:00
lelgenio 96084c74b9 waybar: change from deluge to transmission 2020-04-23 18:58:49 -03:00
lelgenio f94f1fd0db neomutt: add mailcap 2020-04-23 18:58:08 -03:00
lelgenio 3369209e75 bump 2020-04-22 15:36:07 -03:00
lelgenio 88bbfc6778 add swayscreenshare 2020-04-22 14:34:57 -03:00
lelgenio d276232db3 mime: xdg on ranger 2020-04-22 00:53:17 -03:00
lelgenio fb51878982 bump 2020-04-21 19:36:45 -03:00
lelgenio 67537fdd4a fix netctl auto-activation 2020-04-19 23:33:16 -03:00
lelgenio c153aca70d bump 2020-04-19 23:30:25 -03:00
lelgenio 8b9afda5fa bump 2020-04-19 23:27:35 -03:00
lelgenio eda1efc0e8 move from dhclient to dhcpd 2020-04-19 17:47:45 -03:00
lelgenio 2994c2c96c move to netctl 2020-04-19 16:41:24 -03:00
lelgenio 7e0c1708e5 bump 2020-04-19 16:17:46 -03:00
lelgenio 315e4388b7 fix install 2020-04-18 01:17:07 -03:00
lelgenio 8ec57dc0ef move to redshift git 2020-04-18 00:20:24 -03:00
lelgenio 91f834c2d1 allow install failure on yay 2020-04-18 00:18:28 -03:00
lelgenio adfbda6c56 bump 2020-04-17 23:37:44 -03:00
lelgenio f521a992dc bump 2020-04-17 23:24:01 -03:00
lelgenio 15efe1e196 Merge branch 'master' of gitlab.com:lelgenio/dotfiles 2020-04-17 23:20:39 -03:00
lelgenio 80d59cc907 bump 2020-04-17 23:20:04 -03:00
lelgenio b6129e6649 bump 2020-04-17 23:17:35 -03:00
lelgenio 91b45ef3d8 bump 2020-04-17 01:54:35 -03:00
lelgenio 1d63d40df1 add wpass 2020-04-14 14:51:53 -03:00
lelgenio 6745ad71f9 Revert "add etwm"
This reverts commit 86bbe1e5dd.
2020-04-14 11:26:40 -03:00
lelgenio 86bbe1e5dd add etwm 2020-04-14 11:06:27 -03:00
lelgenio 21b3ae70da add gnupg agent 2020-04-11 18:38:34 -03:00
lelgenio e10d27ca07 script: add update-gdm-monitors 2020-04-06 23:48:09 -03:00
lelgenio a8e9550335 move to imv 2020-04-02 14:11:51 -03:00
lelgenio 98eeaea41a forecast fix rain 2020-04-02 02:04:30 -03:00
lelgenio 3b632392d4 back to sway 2020-04-02 00:57:15 -03:00
lelgenio 9d103b70b7 waybar: remove urgent 2020-04-02 00:38:33 -03:00
lelgenio 5c57721d0d mpv: add sponsorblock 2020-03-29 14:45:17 -03:00
57 changed files with 2711 additions and 573 deletions

18
.gitignore vendored
View File

@ -6,12 +6,22 @@ mpd/.config/mpd/state
neomutt/.config/neomutt/password.gpg
nvim/.config/nvim/autoload/
nvim/.config/nvim/plugged/
qutebrowser/.config/qutebrowser/autoconfig.yml
qutebrowser/.config/qutebrowser/qsettings/
qutebrowser/.config/qutebrowser/quickmarks
qutebrowser/.local/
theme/.config/gtk-3.0/bookmarks
qutebrowser/**
!qutebrowser/.config/qutebrowser/config.py
!qutebrowser/.local/share/qutebrowser/greasemonkey/youtube-ad.js
!qutebrowser/.local/share/qutebrowser/userscripts/readability
fish/**
!fish/.config/fish/config.fish
emacs/.emacs.d
!emacs/.emacs.d/init.el
neomutt/.gnupg/
!neomutt/.gnupg/gpg-agent.conf
__pycache__
*.db
*.tmp

View File

@ -65,7 +65,7 @@ USER_NAME='lelgenio'
# Link to users dotfiles repo(git)
# Assumed to have stow-able modules on its root(cd .dotfiles;stow*/)
DOTFILES_URL="https://gitlab.com/$USER_NAME/dotfiles"
USER_SHELL='zsh'
USER_SHELL='fish'
# The main user's password (leave blank to be prompted).
USER_PASSWORD=''
@ -73,6 +73,9 @@ USER_PASSWORD=''
# System timezone.
TIMEZONE='America/Sao_Paulo'
# Country code for pacman repos
COUNTRY='brazil'
# Have /tmp on a tmpfs or not. Leave blank to disable.
# Only leave this blank on systems with very little RAM.
TMP_ON_TMPFS='TRUE'
@ -98,10 +101,13 @@ FULL_INSTALL=false
# PACKAGES{{{
set_pkgs() {
# sudo to allow to run as a user later
sudo pacman -Sy &> /dev/null
sudo pacman -Sy
pkgs_base+=' base linux-zen linux-firmware intel-ucode lvm2 '
pkgs_base+=' zsh networkmanager bluez cronie git man-db'
pkgs_base+=' fish bluez cronie git man-db'
# netctl
pkgs_base+=' netctl dhcpd ifplugged wpa_supplicant dialog'
pkgs_base+=" $(pacman -Sgq base-devel)"
if $IS_BIOS;then
pkgs_base+=' grub'
@ -109,27 +115,31 @@ set_pkgs() {
pkgs+=" $pkgs_base"
# DE
pkgs+=' sway waybar ruby-fusuma light mako udiskie bemenu wofi-hg stow yay'
pkgs+=' ly sway waybar ruby-fusuma light mako udiskie stow yay'
pkgs+=' bemenu wofi-hg j4-dmenu-desktop'
# passwords and auth
pkgs+=' pass gnupg pam-gnupg'
# pkgs+=' i3 termite scrot pamixer'
pkgs+=' nemo redshift-wlr-gamma-control '
pkgs+=' pkgfile kitty neovim moreutils htop-vim-git'
pkgs+=' nemo cinnamon-translations thunar redshift-wlr-gamma-control-git '
pkgs+=' pkgfile alacritty neovim moreutils htop-vim-git'
# Audio
pkgs+=' pulseaudio pavolume-git'
# Fonts
pkgs+=' ttf-hack inter-font'
pkgs+=' ttf-hack inter-font otf-fira-code ttf-material-wifi-icons-git'
if $FULL_INSTALL; then
# Screenshot
pkgs+=' grim slurp wl-clipboard wf-recorder-git'
pkgs+=' httpie jq python-keepmenu-git'
pkgs+=' httpie jq'
# Theme
pkgs+=' materia-custom-accent papirus-icon-theme'
pkgs+=' papirus-folders-git capitaine-cursors '
# Terminal
pkgs+=' tmux ranger atool p7zip tree'
pkgs+=' neofetch powerline-fonts otf-fira-code'
pkgs+=' lolcat cmatrix'
pkgs+=' neofetch powerline-fonts'
pkgs+=' exa bat lolcat cmatrix'
# extra font for ranger
pkgs+=' otf-nerd-fonts-fira-code'
# Network
pkgs+=' wget curl bluez-utils rsync rclone nmap gnu-netcat tor mtr speedtest-cli'
pkgs+=' openssh sshfs fail2ban'
@ -139,9 +149,9 @@ set_pkgs() {
pkgs+=' neomutt isync'
# Files
pkgs+=' syncthing nextcloud-client '
pkgs+=' deluge deezloader-remix-bin smloadr'
pkgs+=' deluge deezloader-remix-git smloadr'
# Media
pkgs+=' sxiv mpv mpd mpc ncmpcpp mpv-mpris mpdris2 playerctl'
pkgs+=' imv mpv mpd mpc ncmpcpp mpv-mpris mpdris2 playerctl'
pkgs+=' blender gimp kdenlive picard image_optim'
# Office
pkgs+=' libreoffice-fresh libreoffice-fresh-pt-br hunspell-pt-br papirus-libreoffice-theme'
@ -209,6 +219,9 @@ setup() {
echo 'Mounting filesystems'
mount_filesystems "$boot_dev"
echo 'Setting repos'
set_repos
echo 'Installing base system'
install_base
@ -253,18 +266,22 @@ partition_drive() {
# 100 MB /boot partition, everything else under LVM
if $IS_BIOS;then
parted -s "$dev" \
parted \
--align optimal \
--script "$dev" \
mklabel msdos \
mkpart primary fat32 1M 100M \
mkpart primary ext4 100M 100% \
set 1 boot on \
set 2 lvm on
else
parted -s "$dev" \
parted \
--align optimal \
--script "$dev" \
mklabel gpt \
mkpart boot 1 100M \
mkpart lvm 100M 100% \
set 1 boot on\
set 1 boot on \
set 2 lvm on
fi
}
@ -284,19 +301,23 @@ setup_lvm() {
local partition="$1"; shift
local volgroup="$1"; shift
local d_size=$(lsblk --noheadings --nodeps --bytes --raw $DRIVE)
local d_size=$(lsblk --noheadings --nodeps --bytes --raw --output SIZE $DRIVE)
pvcreate "$partition"
vgcreate "$volgroup" "$partition"
# Create a 1GB swap partition
lvcreate --yes -C y -L1G "$volgroup" -n swap
# if the disk has more than
if [ "$d_size" -gt $(( 50*10**9 )) ]; then
# Create a 4GB swap partition
lvcreate --yes -L4G "$volgroup" -n swap
# Create a 50GB root partition
lvcreate --yes -L '50G' "$volgroup" -n root
else
# Create a swap partition of 10% the disk
lvcreate --yes -l '+10%FREE' "$volgroup" -n swap
# Create root partition on 50% of free space
lvcreate --yes -l '+50%FREE' "$volgroup" -n root
fi
@ -330,6 +351,67 @@ mount_filesystems() {
swapon /dev/vg00/swap
}
#}}}
# set_repos() {{{{
set_repos() {
# /etc/pacman.conf{{{
cat > /etc/pacman.conf <<EOF
#
# GENERAL OPTIONS
#
[options]
HoldPkg = pacman glibc
Architecture = auto
# Misc options
#UseSyslog
Color
ILoveCandy
#TotalDownload
CheckSpace
#VerbosePkgLists
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
#
# REPOSITORIES
#
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
EOF
#}}}
# /etc/pacman.d/mirrorlist{{{
pacman -Sy reflector --noconfirm
reflector -c $COUNTRY -f 10 -p http -p https
#}}}
mkdir -p /mnt/etc/pacman.d
cp -r /mnt/etc/pacman* /etc/
}
#}}}
# install_base #{{{
install_base() {
pacstrap /mnt $pkgs_base
@ -365,9 +447,6 @@ configure() {
local boot_dev="$DRIVE"1
local lvm_dev="$DRIVE"2
echo 'Setting repos'
set_repos
echo 'Setting hostname'
set_hostname "$HOSTNAME"
@ -398,6 +477,9 @@ configure() {
echo 'Configuring PAM'
set_pam
echo 'Configuring logind'
set_logind
if [ -z "$ROOT_PASSWORD" ];then
echo 'Enter the root password:'
read -s ROOT_PASSWORD
@ -419,80 +501,12 @@ configure() {
chown $USER_NAME "/home/$USER_NAME/setup.sh"
su $USER_NAME -c "/home/$USER_NAME/setup.sh"
shred "/home/$USER_NAME/setup.sh"
rm "/home/$USER_NAME/setup.sh"
echo 'Updating pkgfile database'
update_pkgfile
shred "$0"
rm "$0"
}
#}}}
# set_repos() {{{{
set_repos() {
# /etc/pacman.conf{{{
cat > /etc/pacman.conf <<EOF
#
# GENERAL OPTIONS
#
[options]
HoldPkg = pacman glibc
Architecture = auto
# Misc options
#UseSyslog
Color
#TotalDownload
CheckSpace
#VerbosePkgLists
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
#
# REPOSITORIES
#
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
EOF
#}}}
# /etc/mirrorlist{{{
cat > /etc/mirrorlist <<EOF
# Server list generated by rankmirrors on 2019-11-24
# Brazil
Server = http://archlinux.c3sl.ufpr.br/$repo/os/$arch
Server = https://www.caco.ic.unicamp.br/archlinux/$repo/os/$arch
Server = http://mirror.ufscar.br/archlinux/$repo/os/$arch
Server = http://br.mirror.archlinux-br.org/$repo/os/$arch
Server = http://mirror.ufam.edu.br/archlinux/$repo/os/$arch
Server = http://www.caco.ic.unicamp.br/archlinux/$repo/os/$arch
Server = http://linorg.usp.br/archlinux/$repo/os/$arch
Server = http://archlinux.pop-es.rnp.br/$repo/os/$arch
Server = http://pet.inf.ufsc.br/mirrors/archlinux/$repo/os/$arch
EOF
#}}}
}
#}}}
# set_hostname() {#{{{
@ -585,12 +599,51 @@ EOF
# set_daemons() {#{{{
set_daemons() {
local tmp_on_tmpfs="$1"; shift
systemctl enable cronie.service NetworkManager.service
if [ -z "$tmp_on_tmpfs" ];then
systemctl mask tmp.mount
fi
systemctl enable \
cronie.service \
netctl.service \
ly.service
# Netctl{{{
cd /sys/class/net/
for interface in $(ls -d en*);do
systemctl enable netctl-ifpluged@$interface
done
for interface in $(ls -d wl*);do
systemctl enable netctl-auto@$interface
done
cd -
cat > /etc/netctl/ethernet-dhcp <<EOF
Description='A basic dhcp ethernet connection'
Interface=en-any
Connection=ethernet
IP=dhcp
EOF
mkdir -p /etc/netctl/interfaces/
cat > /etc/netctl/interfaces/en-any <<EOF
#!/bin/bash
for interface in /sys/class/net/en*; do
break;
done
Interface=$(basename $interface)
echo "en-any: using interface $Interface";
EOF
chmod +x /etc/netctl/interfaces/en-any
#}}}
# Ly{{{
mkdir -p /etc/ly/
cat > /etc/ly/config.ini << EOF
animate = true
blank_box = true
hide_borders = true
lang = br
EOF
#}}}
}
#}}}
# set_bluetooth{{{
@ -615,7 +668,7 @@ set_bootctl() {
local boot_dev="$1"; shift
local lvm_dev="$1"; shift
local lvm_uuid=$(get_uuid "$lvm_dev")
local lvm_uuid=$(get_uuid "/dev/vg00/root")
local k_args="root=UUID=$lvm_uuid"
@ -637,7 +690,7 @@ initrd intel-ucode.img
initrd initramfs-linux-zen.img
options $k_args
# options quiet splash loglevel=3 vga=current rd.udev.log_priority=3 rd.systemd.show_status=auto vt.global_cursor_default=0 nmi_watchdog=0 $k_args
# options quiet splash loglevel=3 vga=current rd.udev.log_priority=3 rd.systemd.show_status=auto vt.global_cursor_default=0 nmi_watchdog=0
EOF
fi
@ -668,16 +721,26 @@ EOF
#}}}
# set_pam{{{
set_pam() {
cat > /etc/pam.d/login <<EOF
#%PAM-1.0
cat > /etc/pam.d/system-local-login <<EOF
auth include system-login
account include system-login
password include system-login
session include system-login
auth required pam_securetty.so
auth requisite pam_nologin.so
auth include system-local-login
auth optional pam_gnome_keyring.so
account include system-local-login
session include system-local-login
session optional pam_gnome_keyring.so auto_start
auth optional pam_gnupg.so
session optional pam_gnupg.so
EOF
}
#}}}
# set_logind{{{
set_logind(){
mkdir -p /etc/systemd
cat > /etc/systemd/logind.conf <<EOF
[Login]
HandlePowerKey=suspend
HandleSuspendKey=suspend
HandleLidSwitch=ignore
EOF
}
#}}}
@ -693,7 +756,7 @@ create_user() {
local name="$1"; shift
local password="$1"; shift
useradd -m -s /usr/bin/$USER_SHELL -G adm,systemd-journal,wheel,rfkill,games,network,video,audio,optical,floppy,storage,scanner,power "$name"
useradd -m -s /usr/bin/$USER_SHELL -G adm,systemd-journal,wheel,rfkill,games,network,video,audio,optical,floppy,storage,scanner,power,input "$name"
/bin/echo -en "$password\n$password" | passwd "$name"
}
#}}}
@ -726,9 +789,6 @@ user_setup() {
echo 'Stowing dotfiles'
stow_dots
shred "$0"
rm "$0"
}
# Install AUR packages #{{{
install_aur_packages() {
@ -744,7 +804,7 @@ install_aur_packages() {
cd -
fi
yay -Syu --needed --noconfirm $pkgs
yay -Syu --needed --noconfirm $pkgs || true
}
#}}}
# Clean up packages #{{{
@ -771,22 +831,6 @@ stow_dots() {
cd -
}
#}}}
#}}}
# Update installer {{{
update_installer(){
echo "Updating installer..."
INSTALLER=$(mktemp)
wget -qO $INSTALLER $DOTFILES_URL/raw/master/arch_install
chmod +x $INSTALLER
exec $INSTALLER updated $@
}
[ "$1" == "updated" ] && shift || is_chroot || update_installer $@
echo "Installer updated :D"
#}}}
set_pkgs

32
bspwm/.config/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
setxkbmap 'br(dvorak)'
hsetroot -solid '#202020'
#env SXHKD_SHELL
sxhkd &
polybar main &
picom &
bspc monitor HDMI-1 -d I II III IV V VI VII VIII IX X
bspc config remove_disabled_monitors true
bspc config border_width 2
bspc config window_gap 5
bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_follows_pointer true
# bspc config pointer_follows_focus true
bspc config focused_border_color '#cc5757'
bspc rule -a Gimp desktop='^8' state=floating follow=on
bspc rule -a Chromium desktop='^2'
bspc rule -a mplayer2 state=floating
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off

123
bspwm/.config/sxhkd/sxhkdrc Normal file
View File

@ -0,0 +1,123 @@
#
# wm independent hotkeys
#
# terminal emulator
super + Return
alacritty
# program launcher
super + e
launcher
# make sxhkd reload its configuration files:
super + alt + s
pkill -USR1 -x sxhkd
#
# bspwm hotkeys
#
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
# close and kill
super + {_,shift + }x
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest node
super + g
bspc node -s biggest
#
# state/flags
#
# # set the window state
# super + {t,shift + t,s,f}
# bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
super + {space,f}
bspc node -t ~{floating,fullscreen}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
super + {_,shift + }{h,t,n,s}
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 in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# 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}'
#
# 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}

View File

@ -6,12 +6,12 @@
"workbench.editor.showTabs": false,
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": true,
"breadcrumbs.enabled": false,
"breadcrumbs.enabled": true,
"workbench.editor.closeEmptyGroups": true,
"workbench.editor.tabCloseButton": "off",
"explorer.openEditors.visible": 0,
"debug.openDebug": "openOnDebugBreak",
"debug.internalConsoleOptions": "none",
"debug.console.closeOnEnd": true,
// Don't ask
"git.autofetch": true,
"git.confirmSync": false,
@ -26,8 +26,9 @@
"window.zoomLevel": 0,
"vim.foldfix": true,
"editor.minimap.renderCharacters": false,
"editor.lineNumbers": "relative",
// Fonts
"terminal.integrated.fontFamily": "'Fira Code', 'Hack', 'Roboto Mono'",
"terminal.integrated.fontFamily": "'Fira Code', 'Hack', 'Roboto Mono'",
"editor.fontFamily": "'Fira Code', 'Hack','Roboto Mono', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontSize": 15,
"editor.fontLigatures": true,
@ -35,6 +36,167 @@
"vim.useSystemClipboard": true,
"vim.enableNeovim": true,
"vim.neovimPath": "/usr/bin/nvim",
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [
"t"
],
"after": [
"g",
"j"
]
},
{
"before": [
"n"
],
"after": [
"g",
"k"
]
},
{
"before": [
"h"
],
"after": [
"h"
]
},
{
"before": [
"s"
],
"after": [
"l"
]
},
{
"before": [
"S"
],
"after": [
"L"
]
},
{
"before": [
"j"
],
"after": [
"s"
]
},
{
"before": [
"J"
],
"after": [
"S"
]
},
{
"before": [
"T"
],
"after": [
"J"
]
},
{
"before": [
"l"
],
"after": [
"t"
]
},
{
"before": [
"L"
],
"after": [
"T"
]
},
{
"before": [
"k"
],
"after": [
"n"
]
},
{
"before": [
"K"
],
"after": [
"N"
]
},
{
"before": [
"<C-u>"
],
"after": [
"<C-b>"
]
},
{
"before": [
"<C-e>"
],
"after": [
"<C-f>"
]
},
{
"before": [
"<CR>"
],
"after": [
"o",
"<Esc>"
]
},
],
"vim.visualModeKeyBindingsNonRecursive": [
{
"before": [
"t"
],
"after": [
"g",
"j"
]
},
{
"before": [
"n"
],
"after": [
"g",
"k"
]
},
{
"before": [
"h"
],
"after": [
"h"
]
},
{
"before": [
"s"
],
"after": [
"l"
]
},
],
"vim.normalModeKeyBindings": [
{
"before": [
@ -52,23 +214,13 @@
"commands": [
"workbench.action.showCommands"
]
},
{
"before": [
"t",
"t"
],
"commands": [
"workbench.action.terminal.focus"
]
}
],
// Gay colors
"workbench.colorTheme": "Community Material Theme Darker High Contrast",
"materialTheme.accent": "Red",
"workbench.iconTheme": "material-icon-theme",
"material-icon-theme.folders.color": "#cc5757",
"workbench.colorCustomizations": {
"editorLineNumber.activeForeground": "#cc5757",
"minimap.selectionHighlight": "#CC5757",
"editorCursor.background": "#fff",
"editorCursor.foreground": "#cc5757dd",
@ -144,5 +296,8 @@
"python.linting.mypyEnabled": true,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"workbench.startupEditor": "newUntitledFile",
"workbench.colorTheme": "Community Material Theme Darker High Contrast",
"mesonbuild.configureOnOpen": false
}

View File

@ -12,41 +12,102 @@ set -x PATH $PATH ~/.local/bin
set -x EDITOR nvim
set -x VISUAL nvim
# set -x BROWSER=qutebrowser
set -x BROWSER qutebrowser
set -x PAGER less
if test -n "$XDG_VTRN"; and test -z "$DISPLAY"
or command -qs systemctl;and systemctl -q is-enabled ly
export _JAVA_AWT_WM_NONREPARENTING=1
export GTK_CSD=0
export LD_PRELOAD='/usr/lib/libgtk3-nocsd.so.0'
export XCURSOR_THEME=capitaine-cursors
export GTK_THEME=materia-custom-accent:dark
# export XDG_CURRENT_DESKTOP=Unity
export QT_SCALE_FACTOR=1.0001
export QPA_PLATFORM=wayland
export QT_QPA_PLATFORM=wayland
end
#}}}
# Aliases{{{
abbr rv sudo nvim
command -qs exa &&
alias ls exa
command -qs bat &&
alias cat bat
abbr gs git status
abbr gp 'git pull; git push'
function edit-config #{{{
cd ~/.config
set file ~/.config/( fzf )
cd -
if test -f "$file"
commandline -r nvim\ $file
end
end
abbr ec edit-config
#}}}
# alias mutt #{{{
function mutt --wraps=neomutt --description 'alias mutt=neomutt'
neomutt $argv;
pkill -RTMIN+4 waybar
end
abbr neomutt mutt
#}}}
function rcd #{{{
set file (mktemp)
ranger $argv --choosedir=$file
cd (cat $file)
rm $file
clear
ls
fish_prompt
end
# force-repaint to redraw prompt
bind -M insert \co rcd
#}}}
function etc #{{{
cd /etc/
set file /etc/(fzf)
cd -
test -f "$file"
and sudo nvim $file
end
#}}}
# }}}
# start window manager if using tty1 {{{
#
function esway
clear
# export XDG_CURRENT_DESKTOP=Unity
export QT_SCALE_FACTOR=1
export QPA_PLATFORM=wayland
export QT_QPA_PLATFORM=wayland
exec sway
end
function ei3
clear
exec startx i3
pgrep sway || exec sway
end
if test "$XDG_VTNR" = 1 -a -z "$DISPLAY" #faster like this
if command -v systemctl -a systemctl -q is-active graphical.target
export _JAVA_AWT_WM_NONREPARENTING=1
export GTK_CSD=0
export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0
export XCURSOR_THEME=capitaine-cursors
export GTK_THEME=materia-custom-accent:dark
esway > .swaylog
# ei3 > .i3log
esway &> .swaylog
# ei3 &> .i3log
# ebsp &> .bsplog
end
end
# }}}
# use tmux{{{
set TMUX 1
if test -z "$TMUX" && test "$TERM" != "xterm-kitty" && test -n "$DISPLAY"
# set TMUX 1
if test -z "$TMUX" -a -n "$DISPLAY" &&
not string match -qr kitty "$TERM" &&
test -z "$GNOME_TERMINAL_SCREEN" &&
status is-interactive
set attach_session (tmux 2> /dev/null ls -F \
'#{session_attached} #{?#{==:#{session_last_attached},},1,#{session_last_attached}} #{session_id}' |
awk '/^0/ { if ($2 > t) { t = $2; s = $3 } }; END { if (s) printf "%s", s }')
@ -69,21 +130,36 @@ set TMUX 1
set SPACEFISH_USER_SHOW always
set SPACEFISH_USER_COLOR "#cc5757"
set SPACEFISH_DIR_COLOR "#cc5757"
set SPACEFISH_USER_COLOR "#D9534F"
set SPACEFISH_DIR_COLOR "#D9534F"
set SPACEFISH_PROMPT_ADD_NEWLINE false
set SPACEFISH_CHAR_COLOR_SUCCESS white
set SPACEFISH_CHAR_PREFIX ""
set SPACEFISH_CHAR_SYMBOL '$'
set SPACEFISH_CHAR_SYMBOL_ROOT '#'
set SPACEFISH_VI_MODE_PREFIX ""
set SPACEFISH_VI_MODE_COLOR "#cc5757"
set SPACEFISH_VI_MODE_PREFIX "\e[1 q"
set SPACEFISH_VI_MODE_SUFIX ""
set SPACEFISH_VI_MODE_INSERT "I"
set SPACEFISH_VI_MODE_INSERT "I\e[5 q"
set SPACEFISH_VI_MODE_NORMAL "N"
set SPACEFISH_VI_MODE_VISUAL "V"
set SPACEFISH_VI_MODE_REPLACE "R"
set SPACEFISH_VI_MODE_REPLACE_ONE "S"
set fish_cursor_default block blink
set fish_cursor_insert line blink
set fish_cursor_replace_one underscore blink
set fish_cursor_visual block
# set -l cnf /usr/share/doc/pkgfile/command-not-found.fish
test -f "$cnf" &&
source "$cnf"
#}}}
# Color man pages{{{
@ -95,5 +171,4 @@ set -xU LESS_TERMCAP_ue (printf "\e[0m")
set -xU LESS_TERMCAP_us (printf "\e[01;32m")
#}}}
source /usr/share/doc/pkgfile/command-not-found.fish
# vim:foldmethod=marker

View File

@ -16,7 +16,7 @@
set $up k
set $right l
set $term termite
set $term alacritty
# set $menu bmenu run $term
set $menu rofi -show drun
font pango:Hack 14px

View File

@ -113,7 +113,7 @@ label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
label-empty = %index%
label-empty =
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2

View File

@ -1,5 +1,5 @@
[dmenu]
dmenu_command = rofi
dmenu_command = bmenu -d
[dmenu_passphrase]
nf = #222222
@ -7,7 +7,7 @@ nb = #222222
rofi_obscure = True
[database]
database_1 = ~/Nextcloud/Senhas/Senhas.kdbx
database_1 = ~/docs/senhas/Senhas.kdbx
pw_cache_period_min = 360
type_library = ydotool
autotype_default = {USERNAME}{TAB}{PASSWORD}{ENTER}

View File

@ -6,7 +6,7 @@ font_size 12
cursor #cc5757
background #202020
foreground #dddddd
background_opacity 0.9
background_opacity 0.98
# black

View File

@ -1,98 +1,98 @@
[Added Associations]
image/bmp=feh.desktop;
image/cgm=feh.desktop;
image/dicom-rle=feh.desktop;
image/emf=feh.desktop;
image/example=feh.desktop;
image/fits=feh.desktop;
image/g3fax=feh.desktop;
image/gif=feh.desktop;
image/heic=feh.desktop;
image/heif=feh.desktop;
image/ief=feh.desktop;
image/jls=feh.desktop;
image/jp2=feh.desktop;
image/jpeg=feh.desktop;
image/jpg=feh.desktop;
image/jpm=feh.desktop;
image/jpx=feh.desktop;
image/ktx=feh.desktop;
image/naplps=feh.desktop;
image/pjpeg=feh.desktop;
image/png=feh.desktop;
image/prs.btif=feh.desktop;
image/prs.pti=feh.desktop;
image/pwg-raster=feh.desktop;
image/svg+xml=feh.desktop;
image/svg+xml-compressed=feh.desktop;
image/t38=feh.desktop;
image/tiff=feh.desktop;
image/tiff-fx=feh.desktop;
image/vnd.adobe.photoshop=feh.desktop;
image/vnd.airzip.accelerator.azv=feh.desktop;
image/vnd.cns.inf2=feh.desktop;
image/vnd.dece.graphic=feh.desktop;
image/vnd.djvu=feh.desktop;
image/vnd.dvb.subtitle=feh.desktop;
image/vnd.dwg=feh.desktop;
image/vnd.dxf=feh.desktop;
image/vnd.fastbidsheet=feh.desktop;
image/vnd.fpx=feh.desktop;
image/vnd.fst=feh.desktop;
image/vnd.fujixerox.edmics-mmr=feh.desktop;
image/vnd.fujixerox.edmics-rlc=feh.desktop;
image/vnd.globalgraphics.pgb=feh.desktop;
image/vnd.microsoft.icon=feh.desktop;
image/vnd.mix=feh.desktop;
image/vnd.mozilla.apng=feh.desktop;
image/vnd.ms-modi=feh.desktop;
image/vnd.net-fpx=feh.desktop;
image/vnd.radiance=feh.desktop;
image/vnd.rn-realpix=feh.desktop;
image/vnd.sealed.png=feh.desktop;
image/vnd.sealedmedia.softseal.gif=feh.desktop;
image/vnd.sealedmedia.softseal.jpg=feh.desktop;
image/vnd.svf=feh.desktop;
image/vnd.tencent.tap=feh.desktop;
image/vnd.valve.source.texture=feh.desktop;
image/vnd.wap.wbmp=feh.desktop;
image/vnd.xiff=feh.desktop;
image/vnd.zbrush.pcx=feh.desktop;
image/webp=feh.desktop;
image/wmf=feh.desktop;
image/x-bmp=feh.desktop;
image/x-cmu-raster=feh.desktop;
image/x-compressed-xcf=feh.desktop;
image/x-emf=feh.desktop;
image/x-eps=feh.desktop;
image/x-exr=feh.desktop;
image/x-fits=feh.desktop;
image/x-freehand=feh.desktop;
image/x-gimp-gbr=feh.desktop;
image/x-gimp-gih=feh.desktop;
image/x-gimp-pat=feh.desktop;
image/x-icon=feh.desktop;
image/x-pcx=feh.desktop;
image/x-png=feh.desktop;
image/x-portable-anymap=feh.desktop;
image/x-portable-bitmap=feh.desktop;
image/x-portable-graymap=feh.desktop;
image/x-portable-pixmap=feh.desktop;
image/x-psd=feh.desktop;
image/x-psp=feh.desktop;
image/x-rgb=feh.desktop;
image/x-sgi=feh.desktop;
image/x-targa=feh.desktop;
image/x-tga=feh.desktop;
image/x-vsd=feh.desktop;
image/x-webp=feh.desktop;
image/x-wmf=feh.desktop;
image/x-xbitmap=feh.desktop;
image/x-xcdr=feh.desktop;
image/x-xcf=feh.desktop;
image/x-xcursor=feh.desktop;
image/x-xpixmap=feh.desktop;
image/x-xwindowdump=feh.desktop;
[Default Applications]
image/bmp=imv.desktop;
image/cgm=imv.desktop;
image/dicom-rle=imv.desktop;
image/emf=imv.desktop;
image/example=imv.desktop;
image/fits=imv.desktop;
image/g3fax=imv.desktop;
image/gif=imv.desktop;
image/heic=imv.desktop;
image/heif=imv.desktop;
image/ief=imv.desktop;
image/jls=imv.desktop;
image/jp2=imv.desktop;
image/jpeg=imv.desktop;
image/jpg=imv.desktop;
image/jpm=imv.desktop;
image/jpx=imv.desktop;
image/ktx=imv.desktop;
image/naplps=imv.desktop;
image/pjpeg=imv.desktop;
image/png=imv.desktop;
image/prs.btif=imv.desktop;
image/prs.pti=imv.desktop;
image/pwg-raster=imv.desktop;
image/svg+xml=imv.desktop;
image/svg+xml-compressed=imv.desktop;
image/t38=imv.desktop;
image/tiff=imv.desktop;
image/tiff-fx=imv.desktop;
image/vnd.adobe.photoshop=imv.desktop;
image/vnd.airzip.accelerator.azv=imv.desktop;
image/vnd.cns.inf2=imv.desktop;
image/vnd.dece.graphic=imv.desktop;
image/vnd.djvu=imv.desktop;
image/vnd.dvb.subtitle=imv.desktop;
image/vnd.dwg=imv.desktop;
image/vnd.dxf=imv.desktop;
image/vnd.fastbidsheet=imv.desktop;
image/vnd.fpx=imv.desktop;
image/vnd.fst=imv.desktop;
image/vnd.fujixerox.edmics-mmr=imv.desktop;
image/vnd.fujixerox.edmics-rlc=imv.desktop;
image/vnd.globalgraphics.pgb=imv.desktop;
image/vnd.microsoft.icon=imv.desktop;
image/vnd.mix=imv.desktop;
image/vnd.mozilla.apng=imv.desktop;
image/vnd.ms-modi=imv.desktop;
image/vnd.net-fpx=imv.desktop;
image/vnd.radiance=imv.desktop;
image/vnd.rn-realpix=imv.desktop;
image/vnd.sealed.png=imv.desktop;
image/vnd.sealedmedia.softseal.gif=imv.desktop;
image/vnd.sealedmedia.softseal.jpg=imv.desktop;
image/vnd.svf=imv.desktop;
image/vnd.tencent.tap=imv.desktop;
image/vnd.valve.source.texture=imv.desktop;
image/vnd.wap.wbmp=imv.desktop;
image/vnd.xiff=imv.desktop;
image/vnd.zbrush.pcx=imv.desktop;
image/webp=imv.desktop;
image/wmf=imv.desktop;
image/x-bmp=imv.desktop;
image/x-cmu-raster=imv.desktop;
image/x-compressed-xcf=imv.desktop;
image/x-emf=imv.desktop;
image/x-eps=imv.desktop;
image/x-exr=imv.desktop;
image/x-fits=imv.desktop;
image/x-freehand=imv.desktop;
image/x-gimp-gbr=imv.desktop;
image/x-gimp-gih=imv.desktop;
image/x-gimp-pat=imv.desktop;
image/x-icon=imv.desktop;
image/x-pcx=imv.desktop;
image/x-png=imv.desktop;
image/x-portable-anymap=imv.desktop;
image/x-portable-bitmap=imv.desktop;
image/x-portable-graymap=imv.desktop;
image/x-portable-pixmap=imv.desktop;
image/x-psd=imv.desktop;
image/x-psp=imv.desktop;
image/x-rgb=imv.desktop;
image/x-sgi=imv.desktop;
image/x-targa=imv.desktop;
image/x-tga=imv.desktop;
image/x-vsd=imv.desktop;
image/x-webp=imv.desktop;
image/x-wmf=imv.desktop;
image/x-xbitmap=imv.desktop;
image/x-xcdr=imv.desktop;
image/x-xcf=imv.desktop;
image/x-xcursor=imv.desktop;
image/x-xpixmap=imv.desktop;
image/x-xwindowdump=imv.desktop;
text/html=org.qutebrowser.qutebrowser.desktop;browser.desktop;
text/plain=nvim.desktop;
video/1d-interleaved-parityfec=mpv.desktop;
@ -219,13 +219,15 @@ video/x-ogm+ogg=mpv.desktop;
video/x-sgi-movie=mpv.desktop;
video/x-theora=mpv.desktop;
video/x-theora+ogg=mpv.desktop;
x-scheme-handler/sms=org.gnome.Shell.Extensions.GSConnect.desktop;
x-scheme-handler/tel=org.gnome.Shell.Extensions.GSConnect.desktop;
[Default Applications]
application/pdf=org.pwmt.zathura.desktop;
text/html=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop
application/x-bittorrent=deluge.desktop;
x-scheme-handler/magnet=deluge.desktop;
x-scheme-handler/magnet=torrent.desktop;
application/x-bittorrent=torrent.desktop;
x-scheme-handler/lbry=lbry.desktop
image/jpeg=imv.desktop
[Added Associations]
x-scheme-handler/sms=org.gnome.Shell.Extensions.GSConnect.desktop;
x-scheme-handler/tel=org.gnome.Shell.Extensions.GSConnect.desktop;

View File

@ -0,0 +1,4 @@
[Desktop Entry]
Type=Application
Name=Torrent
Exec=/usr/bin/env transadd %U

View File

@ -29,7 +29,7 @@ input {
audio_output {
type "pulse"
name "My Pulse Output"
mixer_type "software"
mixer_type "hardware"
}
audio_output {
type "fifo"

View File

@ -1,3 +1,4 @@
autofit=50%
slang=por
fullscreen
ytdl-format=bestvideo[height<=?1080]+bestaudio/best

View File

@ -0,0 +1,471 @@
-- sponsorblock.lua
--
-- This script skips sponsored segments of YouTube videos
-- using data from https://github.com/ajayyy/SponsorBlock
local ON_WINDOWS = package.config:sub(1,1) ~= "/"
local options = {
server_address = "https://sponsor.ajay.app",
python_path = ON_WINDOWS and "python" or "python3",
-- Whether or not to automatically skip sponsors
skip = true,
-- If true, sponsored segments will only be skipped once
skip_once = true,
-- Note that sponsored segments may ocasionally be inaccurate if this is turned off
-- see https://blog.ajay.app/voting-and-pseudo-randomness-or-sponsorblock-or-youtube-sponsorship-segment-blocker
local_database = true,
-- Update database on first run, does nothing if local_database is false
auto_update = true,
-- User ID used to submit sponsored segments, leave blank for random
user_id = "",
-- Name to display on the stats page https://sponsor.ajay.app/stats/ leave blank to keep current name
display_name = "",
-- Tell the server when a skip happens
report_views = true,
-- Auto upvote skipped sponsors
auto_upvote = true,
-- Use sponsor times from server if they're more up to date than our local database
server_fallback = true,
-- Create chapters at sponsor boundaries for OSC display and manual skipping with skip=false
make_chapters = true,
-- Minimum duration for sponsors (in seconds), segments under that threshold will be ignored
min_duration = 1,
-- Fade audio for smoother transitions
audio_fade = false,
-- Audio fade step, applied once every 100ms until cap is reached
audio_fade_step = 10,
-- Audio fade cap
audio_fade_cap = 0,
-- Fast forward through sponsors instead of skipping
fast_forward = false,
-- Playback speed modifier when fast forwarding, applied once every second until cap is reached
fast_forward_increase = .2,
-- Playback speed cap
fast_forward_cap = 2,
-- Pattern for video id in local files, ignored if blank
-- Recommended value for base youtube-dl is "-([%a%d%-_]+)%.[mw][kpe][v4b][m]?$"
local_pattern = ""
}
mp.options = require "mp.options"
mp.options.read_options(options, "sponsorblock")
local legacy = mp.command_native_async == nil
if legacy then
options.local_database = false
end
local utils = require "mp.utils"
scripts_dir = mp.find_config_file("scripts")
local sponsorblock = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.py")
local uid_path = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.txt")
local database_file = options.local_database and utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.db") or ""
local youtube_id = nil
local ranges = {}
local init = false
local segment = {a = 0, b = 0, progress = 0, first = true}
local retrying = false
local last_skip = {uuid = "", dir = nil}
local speed_timer = nil
local fade_timer = nil
local fade_dir = nil
local volume_before = mp.get_property_number("volume")
function file_exists(name)
local f = io.open(name,"r")
if f ~= nil then io.close(f) return true else return false end
end
function t_count(t)
local count = 0
for _ in pairs(t) do count = count + 1 end
return count
end
function time_sort(a, b)
return a.time < b.time
end
function clean_chapters()
local chapters = mp.get_property_native("chapter-list")
local new_chapters = {}
for _, chapter in pairs(chapters) do
if chapter.title ~= "Preview segment start" and chapter.title ~= "Preview segment end" then
table.insert(new_chapters, chapter)
end
end
mp.set_property_native("chapter-list", new_chapters)
end
function create_chapter(chapter_title, chapter_time)
local chapters = mp.get_property_native("chapter-list")
local duration = mp.get_property_native("duration")
table.insert(chapters, {title=chapter_title, time=(duration == nil or duration > chapter_time) and chapter_time or duration - .001})
table.sort(chapters, time_sort)
mp.set_property_native("chapter-list", chapters)
end
function getranges(_, exists, db, more)
if type(exists) == "table" and exists["status"] == "1" then
if options.server_fallback then
mp.add_timeout(0, function() getranges(true, true, "") end)
else
return mp.osd_message("[sponsorblock] database update failed, gave up")
end
end
if db ~= "" and db ~= database_file then db = database_file end
if exists ~= true and not file_exists(db) then
if not retrying then
mp.osd_message("[sponsorblock] database update failed, retrying...")
retrying = true
end
return update()
end
if retrying then
mp.osd_message("[sponsorblock] database update succeeded")
retrying = false
end
local sponsors
local args = {
options.python_path,
sponsorblock,
"ranges",
db,
options.server_address,
youtube_id
}
if not legacy then
sponsors = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = args})
else
sponsors = utils.subprocess({args = args})
end
if not string.match(sponsors.stdout, "^%s*(.*%S)") then return end
if string.match(sponsors.stdout, "error") then return getranges(true, true) end
local new_ranges = {}
local r_count = 0
if more then r_count = -1 end
for t in string.gmatch(sponsors.stdout, "[^:%s]+") do
uuid = string.match(t, "[^,]+$")
if ranges[uuid] then
new_ranges[uuid] = ranges[uuid]
else
start_time = tonumber(string.match(t, "[^,]+"))
end_time = tonumber(string.sub(string.match(t, ",[^,]+"), 2))
for o_uuid, o_t in pairs(ranges) do
if (start_time >= o_t.start_time and start_time <= o_t.end_time) or (o_t.start_time >= start_time and o_t.start_time <= end_time) then
new_ranges[o_uuid] = o_t
goto continue
end
end
if end_time - start_time >= options.min_duration then
new_ranges[uuid] = {
start_time = start_time,
end_time = end_time,
skipped = false
}
end
if options.make_chapters then
create_chapter("Sponsor start (" .. string.sub(uuid, 1, 6) .. ")", start_time)
create_chapter("Sponsor end (" .. string.sub(uuid, 1, 6) .. ")", end_time)
end
end
::continue::
r_count = r_count + 1
end
local c_count = t_count(ranges)
if c_count == 0 or r_count >= c_count then
ranges = new_ranges
end
end
function fast_forward()
local last_speed = mp.get_property_number("speed")
local new_speed = math.min(last_speed + options.fast_forward_increase, options.fast_forward_cap)
if new_speed <= last_speed then return end
mp.set_property("speed", new_speed)
end
function fade_audio(step)
local last_volume = mp.get_property_number("volume")
local new_volume = math.max(options.audio_fade_cap, math.min(last_volume + step, volume_before))
if new_volume == last_volume then
if step >= 0 then fade_dir = nil end
if fade_timer ~= nil then fade_timer:kill() end
fade_timer = nil
return
end
mp.set_property("volume", new_volume)
end
function skip_ads(name, pos)
if pos == nil then return end
local sponsor_ahead = false
for uuid, t in pairs(ranges) do
if (options.fast_forward == uuid or not options.skip_once or not t.skipped) and t.start_time <= pos and t.end_time > pos then
if options.fast_forward == uuid then return end
if options.fast_forward == false then
mp.osd_message("[sponsorblock] sponsor skipped")
mp.set_property("time-pos", t.end_time)
else
mp.osd_message("[sponsorblock] skipping sponsor")
end
t.skipped = true
last_skip = {uuid = uuid, dir = nil}
if options.report_views or options.auto_upvote then
local args = {
options.python_path,
sponsorblock,
"stats",
database_file,
options.server_address,
youtube_id,
uuid,
options.report_views and "1" or "",
uid_path,
options.user_id,
options.auto_upvote and "1" or ""
}
if not legacy then
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
else
utils.subprocess_detached({args = args})
end
end
if options.fast_forward ~= false then
options.fast_forward = uuid
speed_timer = mp.add_periodic_timer(1, fast_forward)
end
return
elseif (not options.skip_once or not t.skipped) and t.start_time <= pos + 1 and t.end_time > pos + 1 then
sponsor_ahead = true
end
end
if options.audio_fade then
if sponsor_ahead then
if fade_dir ~= false then
if fade_dir == nil then volume_before = mp.get_property_number("volume") end
if fade_timer ~= nil then fade_timer:kill() end
fade_dir = false
fade_timer = mp.add_periodic_timer(.1, function() fade_audio(-options.audio_fade_step) end)
end
elseif fade_dir == false then
fade_dir = true
if fade_timer ~= nil then fade_timer:kill() end
fade_timer = mp.add_periodic_timer(.1, function() fade_audio(options.audio_fade_step) end)
end
end
if options.fast_forward and options.fast_forward ~= true then
options.fast_forward = true
speed_timer:kill()
mp.set_property("speed", 1)
end
end
function vote(dir)
if last_skip.uuid == "" then return mp.osd_message("[sponsorblock] no sponsors skipped, can't submit vote") end
local updown = dir == "1" and "up" or "down"
if last_skip.dir == dir then return mp.osd_message("[sponsorblock] " .. updown .. "vote already submitted") end
last_skip.dir = dir
local args = {
options.python_path,
sponsorblock,
"stats",
database_file,
options.server_address,
youtube_id,
last_skip.uuid,
"",
uid_path,
options.user_id,
dir
}
if not legacy then
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
else
utils.subprocess({args = args})
end
mp.osd_message("[sponsorblock] " .. updown .. "vote submitted")
end
function update()
mp.command_native_async({name = "subprocess", playback_only = false, args = {
options.python_path,
sponsorblock,
"update",
database_file,
options.server_address
}}, getranges)
end
function file_loaded()
local initialized = init
ranges = {}
segment = {a = 0, b = 0, progress = 0, first = true}
last_skip = {uuid = "", dir = nil}
local video_path = mp.get_property("path")
local youtube_id1 = string.match(video_path, "https?://youtu%.be/([%a%d%-_]+).*")
local youtube_id2 = string.match(video_path, "https?://w?w?w?%.?youtube%.com/v/([%a%d%-_]+).*")
local youtube_id3 = string.match(video_path, "/watch%?v=([%a%d%-_]+).*")
local youtube_id4 = string.match(video_path, "/embed/([%a%d%-_]+).*")
local local_pattern = nil
if options.local_pattern ~= "" then
local_pattern = string.match(video_path, options.local_pattern)
end
youtube_id = youtube_id1 or youtube_id2 or youtube_id3 or youtube_id4 or local_pattern
if not youtube_id then return end
init = true
if not options.local_database then
getranges(true, true)
else
local exists = file_exists(database_file)
if exists and options.server_fallback then
getranges(true, true)
mp.add_timeout(0, function() getranges(true, true, "", true) end)
elseif exists then
getranges(true, true)
elseif options.server_fallback then
mp.add_timeout(0, function() getranges(true, true, "") end)
end
end
if initialized then return end
if options.skip then
mp.observe_property("time-pos", "native", skip_ads)
end
if options.display_name ~= "" then
local args = {
options.python_path,
sponsorblock,
"username",
database_file,
options.server_address,
youtube_id,
"",
"",
uid_path,
options.user_id,
options.display_name
}
if not legacy then
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
else
utils.subprocess_detached({args = args})
end
end
if not options.local_database or (not options.auto_update and file_exists(database_file)) then return end
update()
end
function set_segment()
if not youtube_id then return end
local pos = mp.get_property_number("time-pos")
if pos == nil then return end
if segment.progress > 1 then
segment.progress = segment.progress - 2
end
if segment.progress == 1 then
segment.progress = 0
segment.b = pos
mp.osd_message("[sponsorblock] segment boundary B set, press again for boundary A", 3)
else
segment.progress = 1
segment.a = pos
mp.osd_message("[sponsorblock] segment boundary A set, press again for boundary B", 3)
end
if options.make_chapters and not segment.first then
local start_time = math.min(segment.a, segment.b)
local end_time = math.max(segment.a, segment.b)
if end_time - start_time ~= 0 and end_time ~= 0 then
clean_chapters()
create_chapter("Preview segment start", start_time)
create_chapter("Preview segment end", end_time)
end
end
segment.first = false
end
function submit_segment()
if not youtube_id then return end
local start_time = math.min(segment.a, segment.b)
local end_time = math.max(segment.a, segment.b)
if end_time - start_time == 0 or end_time == 0 then
mp.osd_message("[sponsorblock] empty segment, not submitting")
elseif segment.progress <= 1 then
mp.osd_message(string.format("[sponsorblock] press Shift+G again to confirm: %.2d:%.2d:%.2d to %.2d:%.2d:%.2d", math.floor(start_time/(60*60)), math.floor(start_time/60%60), math.floor(start_time%60), math.floor(end_time/(60*60)), math.floor(end_time/60%60), math.floor(end_time%60)), 5)
segment.progress = segment.progress + 2
else
mp.osd_message("[sponsorblock] submitting segment...", 30)
local submit
local args = {
options.python_path,
sponsorblock,
"submit",
database_file,
options.server_address,
youtube_id,
tostring(start_time),
tostring(end_time),
uid_path,
options.user_id
}
if not legacy then
submit = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = args})
else
submit = utils.subprocess({args = args})
end
if string.match(submit.stdout, "success") then
segment = {a = 0, b = 0, progress = 0, first = true}
mp.osd_message("[sponsorblock] segment submitted")
if options.make_chapters then
clean_chapters()
create_chapter("Submitted segment start", start_time)
create_chapter("Submitted segment end", end_time)
end
elseif string.match(submit.stdout, "error") then
mp.osd_message("[sponsorblock] segment submission failed, server may be down. try again", 5)
elseif string.match(submit.stdout, "502") then
mp.osd_message("[sponsorblock] segment submission failed, server is down. try again", 5)
elseif string.match(submit.stdout, "400") then
mp.osd_message("[sponsorblock] segment submission failed, impossible inputs", 5)
segment = {a = 0, b = 0, progress = 0, first = true}
elseif string.match(submit.stdout, "429") then
mp.osd_message("[sponsorblock] segment submission failed, rate limited. try again", 5)
elseif string.match(submit.stdout, "409") then
mp.osd_message("[sponsorblock] segment already submitted", 3)
segment = {a = 0, b = 0, progress = 0, first = true}
else
mp.osd_message("[sponsorblock] segment submission failed", 5)
end
end
end
mp.register_event("file-loaded", file_loaded)
mp.add_key_binding("g", "set_segment", set_segment)
mp.add_key_binding("G", "submit_segment", submit_segment)
mp.add_key_binding("h", "upvote_segment", function() return vote("1") end)
mp.add_key_binding("H", "downvote_segment", function() return vote("0") end)
-- Bindings below are for backwards compatibility and could be removed at any time
mp.add_key_binding(nil, "sponsorblock_set_segment", set_segment)
mp.add_key_binding(nil, "sponsorblock_submit_segment", submit_segment)
mp.add_key_binding(nil, "sponsorblock_upvote", function() return vote("1") end)
mp.add_key_binding(nil, "sponsorblock_downvote", function() return vote("0") end)

View File

@ -0,0 +1 @@
text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -collapse_br_tags -dump %s; nametemplate=%s.html; copiousoutput

View File

@ -62,6 +62,8 @@ set sort = 'reverse-date'
#set reverse_name # reply as whomever it was to
#set include # include message in replies
#set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example)
set mailcap_path = ~/.config/neomutt/mailcap
auto_view text/html # automatically show html (mailcap uses w3m)
auto_view application/pgp-encrypted
alternative_order text/plain text/enriched text/html
@ -72,21 +74,30 @@ bind index \Cf noop
# }}}
# General rebindings{{{
# index
#
bind index t next-entry
bind index n previous-entry
bind index G last-entry
bind index gg first-entry
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index h noop
bind index s display-message
bind index <space> tag-entry
bind attach <return> view-mailcap
bind attach l view-mailcap
bind editor <space> noop
bind index G last-entry
bind index gg first-entry
bind pager,attach h exit
bind pager j next-line
bind pager k previous-line
bind pager l view-attachments
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index h noop
bind index l display-message
bind index <space> tag-entry
bind pager t next-line
bind pager n previous-line
bind pager s view-attachments
bind browser h goto-parent
macro browser h '<change-dir><kill-line>..<enter>' "Go to parent folder"
bind index,pager H view-raw-message
@ -103,8 +114,8 @@ bind pager \031 previous-line # Mouse wheel
bind pager \005 next-line # Mouse wheel
bind editor <Tab> complete-query
#macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook"
#macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook"
macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
macro index O "<shell-escape>mbsync -a<enter>" "run mbsync to sync all mail"
#macro index \Cf "<enter-command>unset wait_key<enter><shell-escape>read -p 'Enter a search term to find with notmuch: ' x; echo \$x >~/.cache/mutt_terms<enter><limit>~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"<enter>" "show only messages matching a notmuch pattern"
#macro index A "<limit>all\n" "show all messages (undo limit)"
@ -118,9 +129,9 @@ set sidebar_short_path = yes
set sidebar_next_new_wrap = yes
# set mail_check_stats
set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?'
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next
bind index,pager \Co sidebar-open
bind index,pager \Ct sidebar-next
bind index,pager \Cn sidebar-prev
bind index,pager \Cs sidebar-open
# bind index,pager \Cp sidebar-prev-new
# bind index,pager \Cn sidebar-next-new
bind index,pager B sidebar-toggle-visible
@ -128,22 +139,23 @@ bind index,pager B sidebar-toggle-visible
# }}}
# colors{{{
# {{{
# # Default index colors:
color index yellow default '.*'
color index_author red default '.*'
color index_number blue default
color index_subject cyan default '.*'
#
# # New mail is boldened:
color index brightyellow black "~N"
color index_author brightred black "~N"
color index_subject brightcyan black "~N"
#
# # Tagged mail is highlighted:
# color index brightyellow blue "~T"
# color index_author brightred blue "~T"
# color index_subject brightcyan blue "~T"
#
# # Other colors and aesthetic settings:
mono bold bold
mono underline underline
@ -174,7 +186,7 @@ color signature brightgreen default
color bold black default
color underline black default
color normal default default
#
# # Regex highlighting:
color header blue default ".*"
color header brightmagenta default "^(From)"
@ -199,24 +211,32 @@ color body brightyellow red "^gpg: BAD signature from.*"
mono body bold "^gpg: Good signature"
mono body bold "^gpg: BAD signature from.*"
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
# }}}
# color normal white default
# color hdrdefault blue default
# color quoted blue white
# color signature red white
# color attachment red white
# color prompt brightmagenta default
# color message brightred default
# color error brightwhite brightred
color indicator brightwhite red
color status brightwhite default
# color tree black white
# color markers red white
# color search white black
# color tilde brightmagenta default
color index blue white ~F
color index brightgreen default "~N|~O"
color index_author brightred black "~N"
color index_subject brightcyan black "~N"
# color normal white default
# color hdrdefault blue default
# color quoted blue white
# color signature red white
# color attachment red white
# color prompt brightmagenta default
# color message brightred default
# color error brightwhite brightred
color indicator brightwhite red
# prompt
color status brightwhite default
# color tree black white
# color markers red white
# color search white black
# color tilde brightmagenta default
color index blue white "~F"
# new messages
color index brightgreen default "~N|~O"
color index_author brightred default "~N"
color index_subject brightcyan default "~N"
#sidebar
color sidebar_new green default
color sidebar_highlight default brightred
color sidebar_indicator default red
# }}}
# vim: filetype=neomuttrc:foldmethod=marker

View File

@ -0,0 +1,2 @@
allow-preset-passphrase
max-cache-ttl 86400

View File

@ -0,0 +1,88 @@
{
"languageserver": {
"clangd": {
"command": "clangd",
"rootPatterns": [
"compile_flags.txt", "compile_commands.json"],
"filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"]
},
"vala": {
"command": "vala-language-server",
"filetypes": [
"vala",
"genie"
]
},
"python": {
"command": "python",
"args": [
"-mpyls",
"-vv",
"--log-file",
"/tmp/lsp_python.log"
],
"trace.server": "verbose",
"filetypes": [
"python"
],
"settings": {
"pyls": {
"enable": true,
"trace": {
"server": "verbose"
},
"commandPath": "",
"configurationSources": [
"pycodestyle"
],
"plugins": {
"pyls_mypy": {
"enabled": true,
"live_mode": false
},
"jedi_completion": {
"enabled": true
},
"jedi_hover": {
"enabled": true
},
"jedi_references": {
"enabled": true
},
"jedi_signature_help": {
"enabled": true
},
"jedi_symbols": {
"enabled": true,
"all_scopes": true
},
"mccabe": {
"enabled": true,
"threshold": 15
},
"preload": {
"enabled": true
},
"pycodestyle": {
"enabled": true
},
"pydocstyle": {
"enabled": false,
"match": "(?!test_).*\\.py",
"matchDir": "[^\\.].*"
},
"pyflakes": {
"enabled": true
},
"rope_completion": {
"enabled": true
},
"yapf": {
"enabled": true
}
}
}
}
}
}
}

View File

@ -1,5 +1,5 @@
"
" LEL
" _
" _ ____ _(_)_ __ ___
" | '_ \ \ / / | '_ ` _ \
@ -20,29 +20,37 @@
call plug#begin('~/.config/nvim/plugged')
Plug 'arrufat/vala.vim'
Plug 'NLKNguyen/c-syntax.vim'
Plug 'airblade/vim-gitgutter'
Plug 'chrisbra/Colorizer'
Plug 'junegunn/vim-easy-align'
" Language server support
"
" Plug 'sheerun/vim-polyglot'
" Plug 'dense-analysis/ale'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Plug 'davidhalter/jedi-vim'
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\}
" Plug 'autozimu/LanguageClient-neovim', {
" \ 'branch': 'next',
" \ 'do': 'bash install.sh',
" \}
" Debugger
Plug 'vim-vdebug/vdebug'
" Plug 'vim-vdebug/vdebug'
" Fuzzy find
Plug 'junegunn/fzf'
" Plug 'junegunn/fzf'
" Completions
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Pais
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
" Comments
Plug 'tpope/vim-commentary'
@ -87,6 +95,7 @@
Plug 'vim-scripts/AnsiEsc.vim', { 'for': 'man' }
" Plug 'powerman/vim-plugin-AnsiEsc'
Plug 'mboughaba/i3config.vim'
Plug 'dag/vim-fish'
call plug#end()
"}}}
@ -118,14 +127,14 @@ call plug#end()
"}}}
" Gay colors{{{
if (empty($TMUX))
" if (empty($TMUX))
if (has('nvim'))
let $NVIM_TUI_ENABLE_TRUE_COLOR = 1
endif
if (has('termguicolors'))
set termguicolors
endif
endif
" endif
colorscheme minimalist
@ -140,7 +149,7 @@ call plug#end()
highlight LineNr term=bold ctermfg=9 guifg=#cc5757 guibg=None
"Make whitespace dark
highlight NonText ctermfg=black guifg=#252525 guibg=None
highlight NonText ctermfg=darkgray guifg=#252525 guibg=None
" highlight SpecialKey ctermfg=black guifg=#252525 guibg=None
"Current line
@ -149,8 +158,41 @@ call plug#end()
highlight CursorLineNr term=bold cterm=bold gui=Bold guibg=#191919 guifg=white
"}}}
" Keys{{{
"
"
" Dvorak it!
noremap h h
noremap t j
noremap n k
noremap s l
noremap j d
noremap l n
noremap L N
" Added benefits
noremap - $
noremap _ ^
noremap N <C-w><C-w>
noremap T <C-w><C-r>
noremap H 8<Down>
noremap T 8<Up>
noremap D <C-w><C-r>
" Single charater traversal
imap <C-t> <Left>
imap <C-n> <Right>
" Quickly exit insert mode
imap jj <ESC>
"I deserve the death sentence
nmap <C-s> :w<CR>
"open and close folds
nmap <silent> s <right>:silent! foldopen<CR>
nmap <silent> <right> <right>:silent! foldopen<CR>
" Easy comment toggle
nmap <silent> gc :Commentary<CR>
xmap <silent> gc :Commentary<CR>
@ -163,50 +205,56 @@ call plug#end()
nmap ga <Plug>(EasyAlign)
" Simplify window navigation
nnoremap <silent> <C-h> <C-w><C-h>
nnoremap <silent> <C-j> <C-w><C-j>
nnoremap <silent> <C-k> <C-w><C-k>
nnoremap <silent> <C-l> <C-w><C-l>
" nnoremap <silent> <C-h> <C-w><C-h>
" nnoremap <silent> <C-t> <C-w><C-j>
" nnoremap <silent> <C-n> <C-w><C-k>
" nnoremap <silent> <C-s> <C-w><C-l>
" Interact with language server
" map <silent> <C-Space> :<CR>
" nnoremap <silent> gd :ALEGoToDefinition<CR>
" nnoremap <silent> gh :call LanguageClient#textDocument_hover()<CR>
" nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
" nnoremap <silent> gr :call LanguageClient#textDocument_references()<CR>
" nnoremap <silent> gs :call LanguageClient#textDocument_documentSymbol()<CR>
" nnoremap <silent> gR :call LanguageClient#textDocument_rename()<CR>
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
" Or map each action separately
nnoremap <silent> gh :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
inoremap <C-space> :call LanguageClient#complete()<CR>
" use <tab> for trigger completion and navigate to the next complete item
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
" " Interact with language server
" nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
" nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
" nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
"}}}
" Lanugage Server{{{
"
" Set this variable to 1 to fix files when you save them.
" let g:ale_fix_on_save = 1
set foldmethod=marker
set hidden
" let g:deoplete#enable_at_startup = 1
let g:LanguageClient_serverCommands = {
\ 'rust': ['rustup', 'run', 'stable', 'rls'],
\ 'python': ['/usr/bin/pyls'],
\ 'tex': ['texlab'],
\ 'c': ['cquery', '--log-file=/tmp/cq.log'],
\ 'cpp': ['cquery', '--log-file=/tmp/cq.log'],
\ }
" Auto format on save
autocmd BufWritePre *.py call LanguageClient#textDocument_formatting_sync()
" let g:LanguageClient_serverCommands = {
" \ 'rust': ['rustup', 'run', 'stable', 'rls'],
" \ 'python': ['/usr/bin/pyls'],
" \ 'tex': ['/usr/bin/texlab'],
" \ 'c': ['cquery', '--log-file=/tmp/cq.log'],
" \ 'cpp': ['cquery', '--log-file=/tmp/cq.log'],
" \ }
let g:deoplete#enable_at_startup = 1
call deoplete#custom#source('LanguageClient',
\ 'min_pattern_length',
\ 2)
" Configure deoplete to use language server
" call deoplete#custom#source('LanguageClient',
" \ 'min_pattern_length',
" \ 2)
" " Configure deoplete to use language server
" let g:ale_fix_on_save = 1
" let g:ale_fixers = {
" \ '*': ['remove_trailing_lines', 'trim_whitespace'],
" \ 'javascript': ['eslint'],
" \ 'python': ['black'],
" \}
"python env{{{
" MUST NOT BE INDENTED!
@ -223,6 +271,18 @@ EOF
let g:livepreview_previewer = 'zathura'
autocmd FileType tex LLPStartPreview
"}}}
"groff{{{
augroup filetrype_groff
autocmd VimEnter *.ms set ft=groff
autocmd VimEnter *.ms silent !zathura (string replace --regex .ms\$ .pdf "%" ) & jobs -lp > /tmp/groff-preview
autocmd VimLeave *.ms silent !kill (cat /tmp/groff-preview )
autocmd BufWritePost *.ms silent !compile %
" autocmd FileType groff setlocal commentstring=\\\"\ %s
augroup END
"}}}
"}}}
"Hide statusbar{{{
let s:hidden_all = 0
@ -242,7 +302,7 @@ EOF
endif
endfunction
nnoremap <S-h> :call ToggleHiddenAll()<CR>
" nnoremap <S-h> :call ToggleHiddenAll()<CR>
call ToggleHiddenAll()
"}}}
" vim:foldmethod=marker

View File

@ -1,3 +1,13 @@
map h scroll left
map t scroll down
map n scroll up
map s scroll right
map l search forward
map L search backward
map i set recolor
set recolor
set recolor-keephue
set recolor-lightcolor "#202020"

View File

@ -1,7 +0,0 @@
https://raw.githubusercontent.com/slashbeast/conf-mgmt/master/roles/home_files/files/DOTzshrc https://raw.githubusercontent.com/slashbeast/conf-mgmt/master/roles/home_files/files/DOTzshrc
https://github.com/unixorn/awesome-zsh-plugins GitHub - unixorn/awesome-zsh-plugins: A collection of ZSH frameworks, plugins & themes inspired by the various awesome list collections out there.
https://www.qutebrowser.org/quickstart.html qutebrowser quickstart | qutebrowser
https://web.whatsapp.com/ WhatsApp Web
https://github.com/jakehamilton/dotfiles/blob/master/neovim/init.vim dotfiles/init.vim at master · jakehamilton/dotfiles
https://pt.symbolab.com/ Solucionador matemático Symbolab - calculadora passo a passo
https://www.invidio.us/ Invidious

View File

@ -9,7 +9,7 @@
# Aliases for commands. The keys of the given dictionary are the
# aliases, while the values are the commands they map to.
# Type: Dict
c.aliases = {'q': 'close', 'qa': 'quit', 'w': 'session-save', 'wq': 'quit --save', 'wqa': 'quit --save'}
c.aliases = {'q': 'close', 'qa': 'quit', 'w': 'session-save', 'wq': 'quit --save', 'wqa': 'quit --save', 'cw': 'config-write-py -f'}
# Load a restored tab as soon as it takes focus.
# Type: Bool
@ -19,15 +19,140 @@ c.session.lazy_restore = True
# Type: Bool
c.auto_save.session = True
# User agent to send. Unset to send the default. Note that the value
# read from JavaScript is always the global value.
# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`.
# Type: String
# Valid values:
# - all: Accept all cookies.
# - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
# - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
# - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'chrome-devtools://*')
# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`.
# Type: String
# Valid values:
# - all: Accept all cookies.
# - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
# - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
# - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'devtools://*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value.
# Type: FormatString
c.content.headers.user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36'
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}', 'https://web.whatsapp.com/')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:71.0) Gecko/20100101 Firefox/71.0', 'https://accounts.google.com/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:71.0) Gecko/20100101 Firefox/71.0', 'https://docs.google.com/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:71.0) Gecko/20100101 Firefox/71.0', 'https://drive.google.com/*')
# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'chrome-devtools://*')
# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'file://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome-devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome://*/*')
@ -36,6 +161,14 @@ config.set('content.javascript.enabled', True, 'chrome://*/*')
# Type: Bool
config.set('content.javascript.enabled', True, 'qute://*/*')
# Allow websites to record audio/video.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.media_capture', True, 'https://ca.bbcollab.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
@ -52,6 +185,44 @@ config.set('content.notifications', False, 'https://www.1337x.to')
# - ask
config.set('content.notifications', True, 'https://www.reddit.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications', True, 'https://dev.lemmy.ml')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications', False, 'https://www.duolingo.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications', False, 'https://www.jornalcontabil.com.br')
# Proxy to use. In addition to the listed values, you can use a
# `socks://...` or `http://...` URL.
# Type: Proxy
# Valid values:
# - system: Use the system wide proxy.
# - none: Don't use any proxy
c.content.proxy = 'system'
# Automatically mute tabs. Note that if the `:tab-mute` command is used,
# the mute status for the affected tab is now controlled manually, and
# this setting doesn't have any effect.
# Type: Bool
c.content.mute = True
# Shrink the completion to be smaller than the configured size if there
# are no scrollbars.
# Type: Bool
@ -59,7 +230,15 @@ c.completion.shrink = True
# CSS border value for hints.
# Type: String
c.hints.border = '2px solid #cc5757'
c.hints.border = '2px solid #D9534F'
# Characters used for hint strings.
# Type: UniqueCharString
c.hints.chars = 'aoeuidnths'
# Leave insert mode if a non-editable element is clicked.
# Type: Bool
c.input.insert_mode.auto_leave = False
# Enable smooth scrolling for web pages. Note smooth scrolling does not
# work with the `:scroll-px` command.
@ -68,7 +247,30 @@ c.scrolling.smooth = True
# Hide the statusbar unless a message is shown.
# Type: Bool
c.statusbar.hide = True
c.statusbar.hide = False
# Position of the status bar.
# Type: VerticalPosition
# Valid values:
# - top
# - bottom
c.statusbar.position = 'top'
# List of widgets displayed in the statusbar.
# Type: List of String
# Valid values:
# - url: Current page URL.
# - scroll: Percentage of the current page position like `10%`.
# - scroll_raw: Raw percentage of the current page position like `10`.
# - history: Display an arrow when possible to go back/forward in history.
# - tabs: Current active tab, e.g. `2`.
# - keypress: Display pressed keys when composing a vi command.
# - progress: Progress bar for the current page loading.
c.statusbar.widgets = ['keypress', 'url', 'scroll', 'history', 'tabs']
# Open new tabs (middleclick/ctrl+click) in the background.
# Type: Bool
c.tabs.background = False
# When to show favicons in the tab bar.
# Type: String
@ -76,7 +278,7 @@ c.statusbar.hide = True
# - always: Always show favicons.
# - never: Always hide favicons.
# - pinned: Show favicons only on pinned tabs.
c.tabs.favicons.show = 'never'
c.tabs.favicons.show = 'always'
# How to behave when the last tab is closed.
# Type: String
@ -86,7 +288,15 @@ c.tabs.favicons.show = 'never'
# - startpage: Load the start page.
# - default-page: Load the default page.
# - close: Close the window.
c.tabs.last_close = 'close'
c.tabs.last_close = 'startpage'
# Which tab to select when the focused tab is removed.
# Type: SelectOnRemove
# Valid values:
# - prev: Select the tab which came before the closed one (left in horizontal, above in vertical).
# - next: Select the tab which came after the closed one (right in horizontal, below in vertical).
# - last-used: Select the previously selected tab.
c.tabs.select_on_remove = 'last-used'
# When to show the tab bar.
# Type: String
@ -95,7 +305,7 @@ c.tabs.last_close = 'close'
# - never: Always hide the tab bar.
# - multiple: Hide the tab bar if only one tab is open.
# - switching: Show the tab bar when switching tabs.
c.tabs.show = 'switching'
c.tabs.show = 'multiple'
# Duration (in milliseconds) to show the tab bar before hiding it when
# tabs.show is set to 'switching'.
@ -114,12 +324,41 @@ c.tabs.show_switching_delay = 2000
# `{protocol}`: Protocol (http/https/...) of the current web page. *
# `{audio}`: Indicator for audio/mute status.
# Type: FormatString
c.tabs.title.format = '{current_title}'
c.tabs.title.format = '{audio}{index}: {current_title}'
# Width (in pixels) of the progress indicator (0 to disable).
# Type: Int
c.tabs.indicator.width = 0
# Page to open if :open -t/-b/-w is used without URL. Use `about:blank`
# for a blank page.
# Type: FuzzyUrl
c.url.default_page = 'https://search.disroot.org'
# Search engines which can be used via the address bar. Maps a search
# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}`
# placeholder. The placeholder will be replaced by the search term, use
# `{{` and `}}` for literal `{`/`}` braces. The following further
# placeholds are defined to configure how special characters in the
# search terms are replaced by safe characters (called 'quoting'): *
# `{}` and `{semiquoted}` quote everything except slashes; this is the
# most sensible choice for almost all search engines (for the search
# term `slash/and&amp` this placeholder expands to `slash/and%26amp`).
# * `{quoted}` quotes all characters (for `slash/and&amp` this
# placeholder expands to `slash%2Fand%26amp`). * `{unquoted}` quotes
# nothing (for `slash/and&amp` this placeholder expands to
# `slash/and&amp`). The search engine named `DEFAULT` is used when
# `url.auto_search` is turned on and something else than a URL was
# entered to be opened. Other search engines can be used by prepending
# the search engine name to the search term, e.g. `:open google
# qutebrowser`.
# Type: Dict
c.url.searchengines = {'DEFAULT': 'search.disroot.org?q={}', '!aw': 'wiki.archlinux.org?search={}', '!w': 'pt.wikipedia.org/w?search={}'}
# Page(s) to open at the start.
# Type: List of FuzzyUrl, or FuzzyUrl
c.url.start_pages = 'https://search.disroot.org'
# Background color of the completion widget for odd rows.
# Type: QssColor
c.colors.completion.odd.bg = '#202020'
@ -134,7 +373,7 @@ c.colors.completion.category.bg = '#303030'
# Background color of the selected completion item.
# Type: QssColor
c.colors.completion.item.selected.bg = '#cc5757'
c.colors.completion.item.selected.bg = '#D9534F'
# Top border color of the selected completion item.
# Type: QssColor
@ -175,27 +414,44 @@ c.colors.hints.bg = '#303030'
# Font color for the matched part of hints.
# Type: QtColor
c.colors.hints.match.fg = '#cc5757'
c.colors.hints.match.fg = '#D9534F'
# Highlight color for keys to complete the current keychain.
# Type: QssColor
c.colors.keyhint.suffix.fg = '#cc5757'
c.colors.keyhint.suffix.fg = '#D9534F'
# Background color of the keyhint widget.
# Type: QssColor
c.colors.keyhint.bg = 'rgba(30, 30, 30, 95%)'
# Foreground color of the statusbar.
# Type: QssColor
c.colors.statusbar.normal.fg = 'gray'
# Background color of the statusbar.
# Type: QssColor
c.colors.statusbar.normal.bg = '#202020'
# Foreground color of the statusbar in insert mode.
# Type: QssColor
c.colors.statusbar.insert.fg = '#aaffaa'
# Background color of the statusbar in insert mode.
# Type: QssColor
c.colors.statusbar.insert.bg = '#202020'
# Background color of the statusbar in command mode.
# Type: QssColor
c.colors.statusbar.command.bg = '#202020'
# Background color of the statusbar in caret mode with a selection.
# Type: QssColor
c.colors.statusbar.caret.selection.bg = '#cc5757'
c.colors.statusbar.caret.selection.bg = '#D9534F'
# Foreground color of the URL in the statusbar on successful load
# (https).
# Type: QssColor
c.colors.statusbar.url.success.https.fg = 'white'
# Background color of the tab bar.
# Type: QssColor
@ -215,7 +471,7 @@ c.colors.tabs.selected.odd.fg = 'white'
# Background color of selected odd tabs.
# Type: QtColor
c.colors.tabs.selected.odd.bg = '#cc5757'
c.colors.tabs.selected.odd.bg = '#D9534F'
# Foreground color of selected even tabs.
# Type: QtColor
@ -223,7 +479,7 @@ c.colors.tabs.selected.even.fg = 'white'
# Background color of selected even tabs.
# Type: QtColor
c.colors.tabs.selected.even.bg = '#cc5757'
c.colors.tabs.selected.even.bg = '#D9534F'
# Background color of pinned selected odd tabs.
# Type: QtColor
@ -275,7 +531,7 @@ c.fonts.prompts = '16px Inter'
# Font used in the statusbar.
# Type: Font
c.fonts.statusbar = '16px Hack'
c.fonts.statusbar = '14px Hack'
# Font used in the tab bar.
# Type: QtFont
@ -283,12 +539,21 @@ c.fonts.tabs = '14px Inter'
# Bindings for normal mode
config.bind(',m', 'spawn --userscript view_in_mpv')
config.bind(',r', 'spawn --userscript readability')
config.bind(';e', "hint links spawn deemix '{hint-url}'")
config.bind(';m', 'hint links spawn mpv --fs {hint-url}')
config.bind('J', 'tab-prev')
config.bind('K', 'tab-next')
config.bind('j', 'scroll down')
config.bind('k', 'scroll up')
config.bind('spawn', '--userscript view_in_mpv')
config.bind('E', 'hint all tab')
config.bind('H', 'back')
config.bind('L', 'search-prev')
config.bind('N', 'tab-next')
config.bind('S', 'forward')
config.bind('T', 'tab-prev')
config.bind('e', 'hint all')
config.bind('h', 'scroll left')
config.bind('l', 'search-next')
config.bind('n', 'scroll up')
config.bind('s', 'scroll right')
config.bind('t', 'scroll down')
# Bindings for insert mode
config.bind('<Ctrl+i>', 'spawn --userscript qute-keepass -p ~/Nextcloud/Senhas/Senhas.kdbx', mode='insert')
config.bind('<Ctrl+i>', 'spawn --userscript qute-keepass -p ~/Documentos/senhas/Senhas.kdbx', mode='insert')

View File

@ -0,0 +1,69 @@
#!/usr/bin/env python
#
# Executes python-readability on current page and opens the summary as new tab.
#
# Depends on the python-readability package, or its fork:
#
# - https://github.com/buriy/python-readability
# - https://github.com/bookieio/breadability
#
# Usage:
# :spawn --userscript readability
#
from __future__ import absolute_import
import codecs, os
tmpfile = os.path.join(
os.environ.get('QUTE_DATA_DIR',
os.path.expanduser('~/.local/share/qutebrowser')),
'userscripts/readability.html')
if not os.path.exists(os.path.dirname(tmpfile)):
os.makedirs(os.path.dirname(tmpfile))
# Styling for dynamic window margin scaling and line height
HEADER = """
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>%s</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
body {
background-color: #202020;
color:white;
margin: 40px auto;
max-width: 650px;
line-height: 1.4;
padding: 0 10px;
}
h1, h2, h3 {
line-height: 1.2;
}
a{
color:lightblue;
}
</style>
</head>
"""
with codecs.open(os.environ['QUTE_HTML'], 'r', 'utf-8') as source:
data = source.read()
try:
from breadability.readable import Article as reader
doc = reader(data)
title = doc._original_document.title
content = HEADER % title + doc.readable + "</html>"
except ImportError:
from readability import Document
doc = Document(data)
title = doc.title()
content = doc.summary().replace('<html>', HEADER % title)
with codecs.open(tmpfile, 'w', 'utf-8') as target:
target.write(content.lstrip())
with open(os.environ['QUTE_FIFO'], 'w') as fifo:
fifo.write('open -t %s' % tmpfile)

View File

@ -0,0 +1,19 @@
import ranger.api
from ranger.core.linemode import LinemodeBase
from .devicons import *
@ranger.api.register_linemode
class DevIconsLinemode(LinemodeBase):
name = "devicons"
uses_metadata = False
def filetitle(self, file, metadata):
return devicon(file) + ' ' + file.relative_path
@ranger.api.register_linemode
class DevIconsLinemodeFile(LinemodeBase):
name = "filename"
def filetitle(self, file, metadata):
return devicon(file) + ' ' + file.relative_path

View File

@ -0,0 +1,327 @@
#!/usr/bin/python
# coding=UTF-8
# These glyphs, and the mapping of file extensions to glyphs
# has been copied from the vimscript code that is present in
# https://github.com/ryanoasis/vim-devicons
import re;
import os;
# all those glyphs will show as weird squares if you don't have the correct patched font
# My advice is to use NerdFonts which can be found here:
# https://github.com/ryanoasis/nerd-fonts
file_node_extensions = {
'7z' : '',
'a' : '',
'ai' : '',
'apk' : '',
'asm' : '',
'asp' : '',
'aup' : '',
'avi' : '',
'bat' : '',
'bmp' : '',
'bz2' : '',
'c' : '',
'c++' : '',
'cab' : '',
'cbr' : '',
'cbz' : '',
'cc' : '',
'class' : '',
'clj' : '',
'cljc' : '',
'cljs' : '',
'cmake' : '',
'coffee' : '',
'conf' : '',
'cp' : '',
'cpio' : '',
'cpp' : '',
'cs' : '',
'css' : '',
'cue' : '',
'cvs' : '',
'cxx' : '',
'd' : '',
'dart' : '',
'db' : '',
'deb' : '',
'diff' : '',
'dll' : '',
'doc' : '',
'docx' : '',
'dump' : '',
'edn' : '',
'efi' : '',
'ejs' : '',
'elf' : '',
'elm' : '',
'epub' : '',
'erl' : '',
'ex' : '',
'exe' : '',
'exs' : '',
'eex' : '',
'f#' : '',
'fifo' : '|',
'fish' : '',
'flac' : '',
'flv' : '',
'fs' : '',
'fsi' : '',
'fsscript' : '',
'fsx' : '',
'gem' : '',
'gif' : '',
'go' : '',
'gz' : '',
'gzip' : '',
'h' : '',
'hbs' : '',
'hrl' : '',
'hs' : '',
'htaccess' : '',
'htpasswd' : '',
'htm' : '',
'html' : '',
'ico' : '',
'img' : '',
'ini' : '',
'iso' : '',
'jar' : '',
'java' : '',
'jl' : '',
'jpeg' : '',
'jpg' : '',
'js' : '',
'json' : '',
'jsx' : '',
'key' : '',
'less' : '',
'lha' : '',
'lhs' : '',
'log' : '',
'lua' : '',
'lzh' : '',
'lzma' : '',
'm4a' : '',
'm4v' : '',
'markdown' : '',
'md' : '',
'mkv' : '',
'ml' : 'λ',
'mli' : 'λ',
'mov' : '',
'mp3' : '',
'mp4' : '',
'mpeg' : '',
'mpg' : '',
'msi' : '',
'mustache' : '',
'o' : '',
'ogg' : '',
'pdf' : '',
'php' : '',
'pl' : '',
'pm' : '',
'png' : '',
'pub' : '',
'ppt' : '',
'pptx' : '',
'psb' : '',
'psd' : '',
'py' : '',
'pyc' : '',
'pyd' : '',
'pyo' : '',
'rar' : '',
'rb' : '',
'rc' : '',
'rlib' : '',
'rom' : '',
'rpm' : '',
'rs' : '',
'rss' : '',
'rtf' : '',
's' : '',
'so' : '',
'scala' : '',
'scss' : '',
'sh' : '',
'slim' : '',
'sln' : '',
'sql' : '',
'styl' : '',
'suo' : '',
't' : '',
'tar' : '',
'tgz' : '',
'ts' : '',
'twig' : '',
'vim' : '',
'vimrc' : '',
'wav' : '',
'webm' : '',
'xbps' : '',
'xhtml' : '',
'xls' : '',
'xlsx' : '',
'xml' : '',
'xul' : '',
'xz' : '',
'yaml' : '',
'yml' : '',
'zip' : '',
}
dir_node_exact_matches = {
# English
'.git' : '',
'Desktop' : '',
'Documents' : '',
'Downloads' : '',
'Dotfiles' : '',
'Dropbox' : '',
'Music' : '',
'Pictures' : '',
'Public' : '',
'Templates' : '',
'Videos' : '',
# Spanish
'Escritorio' : '',
'Documentos' : '',
'Descargas' : '',
'Música' : '',
'Imágenes' : '',
'Público' : '',
'Plantillas' : '',
'Vídeos' : '',
# French
'Bureau' : '',
'Documents' : '',
'Images' : '',
'Musique' : '',
'Publique' : '',
'Téléchargements' : '',
'Vidéos' : '',
# Portuguese
'Documentos' : '',
'Imagens' : '',
'Modelos' : '',
'Música' : '',
'Projetos' : '',
'Público' : '',
'Vídeos' : '',
'Área de trabalho' : '',
'Jogos' : '',
# Italian
'Documenti' : '',
'Immagini' : '',
'Modelli' : '',
'Musica' : '',
'Pubblici' : '',
'Scaricati' : '',
'Scrivania' : '',
'Video' : '',
# German
'Bilder' : '',
'Dokumente' : '',
'Musik' : '',
'Schreibtisch' : '',
'Vorlagen' : '',
'Öffentlich' : '',
# Hungarian
'Dokumentumok' : '',
'Képek' : '',
'Modelli' : '',
'Zene' : '',
'Letöltések' : '',
'Számítógép' : '',
'Videók' : '',
}
file_node_exact_matches = {
'.Xauthority' : '',
'.Xdefaults' : '',
'.Xresources' : '',
'.bash_aliases' : '',
'.bashprofile' : '',
'.bash_profile' : '',
'.bash_logout' : '',
'.bash_history' : '',
'.bashrc' : '',
'.dmrc' : '',
'.DS_Store' : '',
'.fasd' : '',
'.fehbg' : '',
'.gitconfig' : '',
'.gitattributes' : '',
'.gitignore' : '',
'.inputrc' : '',
'.jack-settings' : '',
'.mime.types' : '',
'.nvidia-settings-rc' : '',
'.pam_environment' : '',
'.profile' : '',
'.recently-used' : '',
'.selected_editor' : '',
'.vim' : '',
'.vimrc' : '',
'.viminfo' : '',
'.xinitrc' : '',
'.xinputrc' : '',
'config' : '',
'Dockerfile' : '',
'docker-compose.yml' : '',
'dropbox' : '',
'exact-match-case-sensitive-1.txt' : 'X1',
'exact-match-case-sensitive-2' : 'X2',
'favicon.ico' : '',
'a.out' : '',
'bspwmrc' : '',
'sxhkdrc' : '',
'Makefile' : '',
'Makefile.in' : '',
'Makefile.ac' : '',
'config.mk' : '',
'config.m4' : '',
'config.ac' : '',
'configure' : '',
'Rakefile' : '',
'gruntfile.coffee' : '',
'gruntfile.js' : '',
'gruntfile.ls' : '',
'gulpfile.coffee' : '',
'gulpfile.js' : '',
'gulpfile.ls' : '',
'ini' : '',
'ledger' : '',
'package.json' : '',
'package-lock.json' : '',
'.ncmpcpp' : '',
'playlists' : '',
'known_hosts' : '',
'authorized_keys' : '',
'license' : '',
'LICENSE.md' : '',
'LICENSE' : '',
'LICENSE.txt' : '',
'mimeapps.list' : '',
'node_modules' : '',
'procfile' : '',
'react.jsx' : '',
'README.rst' : '',
'README.md' : '',
'README.markdown' : '',
'README' : '',
'README.txt' : '',
'user-dirs.dirs' : '',
'webpack.config.js' : '',
}
def devicon(file):
if file.is_directory:
return ''
# return dir_node_exact_matches.get(file.relative_path, '')
return file_node_exact_matches.get(os.path.basename(file.relative_path), file_node_extensions.get(file.extension, ''))

View File

@ -107,7 +107,7 @@ set preview_images true
# for example during an ssh session.
# Tmux is unsupported.
# set preview_images_method kitty
set preview_images_method kitty
# Delay in seconds before displaying an image with the w3m method.
# Increase it in case of experiencing display corruption.
@ -341,7 +341,7 @@ map i display_file
map ? help
map W display_log
map w taskview_open
map S shell $SHELL
map X shell $SHELL
map : console
map ; console
@ -399,23 +399,23 @@ map <CR> move right=1
map <INSERT> console touch%space
# VIM-like
copymap <UP> k
copymap <DOWN> j
copymap <UP> n
copymap <DOWN> t
copymap <LEFT> h
copymap <RIGHT> l
copymap <RIGHT> s
copymap <HOME> gg
copymap <END> G
copymap <PAGEDOWN> <C-F>
copymap <PAGEUP> <C-B>
map J move down=0.5 pages=True
map K move up=0.5 pages=True
copymap J <C-D>
copymap K <C-U>
map T move down=0.5 pages=True
map N move up=0.5 pages=True
copymap T <C-D>
copymap N <C-U>
# Jumping around
map H history_go -1
map L history_go 1
map S history_go 1
map ] move_parent 1
map [ move_parent -1
map } traverse
@ -492,8 +492,8 @@ map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
# Searching
map / console search%space
map n search_next
map N search_next forward=False
map l search_next
map L search_next forward=False
map ct search_next order=tag
map cs search_next order=size
map ci search_next order=mimetype
@ -674,15 +674,15 @@ pmap <pageup> pager_move up=1.0 pages=True
pmap <C-d> pager_move down=0.5 pages=True
pmap <C-u> pager_move up=0.5 pages=True
copypmap <UP> k <C-p>
copypmap <DOWN> j <C-n> <CR>
copypmap <UP> n <C-p>
copypmap <DOWN> t <C-n> <CR>
copypmap <LEFT> h
copypmap <RIGHT> l
copypmap <RIGHT> s
copypmap <HOME> g
copypmap <END> G
copypmap <C-d> d
copypmap <C-u> u
copypmap <PAGEDOWN> n f <C-F> <Space>
copypmap <PAGEDOWN> l f <C-F> <Space>
copypmap <PAGEUP> p b <C-B>
# Basic
@ -705,8 +705,8 @@ tmap <pageup> taskview_move up=1.0 pages=True
tmap <C-d> taskview_move down=0.5 pages=True
tmap <C-u> taskview_move up=0.5 pages=True
copytmap <UP> k <C-p>
copytmap <DOWN> j <C-n> <CR>
copytmap <UP> n <C-p>
copytmap <DOWN> t <C-n> <CR>
copytmap <HOME> g
copytmap <END> G
copytmap <C-u> u
@ -714,8 +714,8 @@ copytmap <PAGEDOWN> n f <C-F> <Space>
copytmap <PAGEUP> p b <C-B>
# Changing priority and deleting tasks
tmap J eval -q fm.ui.taskview.task_move(-1)
tmap K eval -q fm.ui.taskview.task_move(0)
tmap T eval -q fm.ui.taskview.task_move(-1)
tmap N eval -q fm.ui.taskview.task_move(0)
tmap dd eval -q fm.ui.taskview.task_remove()
tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
tmap <pageup> eval -q fm.ui.taskview.task_move(0)

View File

@ -47,7 +47,9 @@
# implementation may differ.
# Note: When using rifle in ranger, there is an additional flag "c" for
# only running the current file even if you have marked multiple files.
mime ^image, has imv, X, flag f = imv -- "$@"
mime ^video, has mpv, X, flag f = mpv -- "$@"
flag f = xdg-open "$@"
#-------------------------------------------
# Websites
#-------------------------------------------

View File

@ -1,21 +1,33 @@
#!/bin/sh
#!/bin/fish
# wrapper around bemenu
# bmenu * - use as dmenu, -p for custom prompt (man bemenu)
# bmenu run - select from .desktop files and run it
# bmenu start - internal option
if test "$argv[1]" != "start" || test "$argv[1]" = "run"
test -n "$SWAYSOCK" && swaymsg fullscreen off > /dev/null
end
# BEMENU_BACKEND=x11
# BEMENU_BACKEND=wayland
if [ "$1" == "run" ]
then
[ -n "$2" ] && t="$2" || t="kitty"
exec j4-dmenu-desktop --dmenu="bmenu -p Iniciar:" --term "$t"
fi
if test "$argv[1]" = "run"
test -n "$2" && set t "$2" || set t "terminal"
exec j4-dmenu-desktop --dmenu="bmenu start -p Iniciar:" --term "$t"
end
# t title
# f filter
# n normal
# h highlighted
# s selected
# sc scrollbar
bemenu \
--ignorecase\
--bottom\
--no-overlap\
--list 20\
--prefix '->'\
--fn "Fira Code 12"\
--fn "FiraCode 12"\
--tb "#242424" --tf "#cc5757" \
--fb "#242424" --ff "#cccccc" \
--nb "#202020" --nf "#cccccc" \
--hb "#303030" --hf "#cc5757" \
$@
$argv

View File

@ -1,7 +1,19 @@
#!/bin/sh
set -e
mbsync -aq
NEW=$(find ~/.mail/INBOX{,.{Contas,Faculdade,Git,Trabalhos}}/new -type f | wc -l)
getnew(){
find ~/.mail/INBOX{,.{Contas,Faculdade,Git,Trabalhos}}/new -type f | wc -l
}
OLD=$(getnew)
[ "$1" = "update" ] && mbsync -a
NEW=$(getnew)
if [ "$NEW" -gt "$OLD" ];then
notify-send "Novos Emails!"
fi
echo $NEW | sed 's/^0$//'

View File

@ -1,14 +1,19 @@
#!/bin/sh
RED_ON="$(pgrep redshift)"
set -e
RED_ON="$(pgrep redshift)" && pkill redshift
if test -n "$RED_ON";then
pkill redshift
fi
grim -g "$(slurp -b aabbcc00 -p)" - |
convert - txt:- |
grep -oE '#[0-9a-f]{6}' |
convert - txt:- |
grep -oE '#[0-9A-Fa-f]{6}' |
wl-copy
notify-send "$(wl-paste)" "Copied to clipboard"
[ "$RED_ON" ] && redshift &> /dev/null &
test -n "$RED_ON" && redshift &> /dev/null &

38
scripts/.local/bin/compile Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
# This script will compile or run another finishing operation on a document. I
# have this script run via vim.
#
# Compiles .tex. groff (.mom, .ms), .rmd, .md. Opens .sent files as sent
# presentations. Runs scripts based on extention or shebang
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
cd "$dir" || exit
textype() { \
command="pdflatex"
( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex"
$command --output-directory="$dir" "$base" &&
grep -i addbibresource "$file" >/dev/null &&
biber --input-directory "$dir" "$base" &&
$command --output-directory="$dir" "$base" &&
$command --output-directory="$dir" "$base"
}
case "$file" in
*\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf > "$base".pdf ;;
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;;
*\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;;
*\.[rR]md) Rscript -e "require(rmarkdown); rmarkdown::render('$file', quiet=TRUE)" ;;
*\.tex) textype "$file" ;;
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
*config.h) sudo make install ;;
*\.c) cc "$file" -o "$base" && "$base" ;;
*\.py) python "$file" ;;
*\.go) go run "$file" ;;
*\.sent) setsid sent "$file" 2>/dev/null & ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
esac

62
scripts/.local/bin/dzadd Executable file
View File

@ -0,0 +1,62 @@
#!/bin/sh
set -ex
tmpf=$(mktemp)
choose(){
choice=$(grep "$(cat $tmpf | cut -d\| -f1| wdmenu)" $tmpf)
choiceId="$(echo $choice| cut -d\| -f2)"
choiceUrl=http://deezer.com/$sType/$choiceId
choicePreview=$( curl -s "api.deezer.com/$sType/$choiceId/$preview_suffix" |
jq -r '.preview, .data[0].preview | select(. != null)' )
choice=$( echo -e "Preview\nDownload" | wdmenu )
if [ "$choice" = Preview ]
then
mpv --quiet "$choicePreview" &
mpvPid=$!
choice=$(echo -e "Download\nAnother" | wdmenu -p 'Download?')
kill $mpvPid
if test "$choice" = "Another"
then
choose
return
fi
fi
if [ "$choice" = Download ]
then
deemix "$choiceUrl"
fi
}
clean(){
set +e
kill "$mpvPid"
rm -f $tmpf
}
trap clean EXIT
sType=$(echo -e "Track\nAlbum\nArtist" | wdmenu | tr [:upper:] [:lower:] )
query=$(echo -n | wdmenu | sed 's/[^ a-z]//g;s/ /+/g')
case "$sType" in
track)
jqFilter='.data[]|.title+" - "+.album.title+" - "+.artist.name+"|"+( .id | tostring ) '
;;
album)
jqFilter='.data[]| ( .nb_tracks | tostring ) +" - "+.title+" - "+.artist.name+"|"+ ( .id | tostring ) '
preview_suffix=tracks
;;
artist)
jqFilter='.data[]| ( .nb_fan | tostring ) +" - "+.name+"|"+ ( .id | tostring ) '
preview_suffix=top
;;
esac
curl -s "api.deezer.com/search/$sType?q=${query}" |
jq -r "$jqFilter" > $tmpf
choose

View File

@ -36,7 +36,7 @@ format_weather(){
WEATHER=""
;;
"Rain"|"Drizzle")
WEATHER=""
WEATHER=""
;;
"Mist")
WEATHER=""
@ -77,7 +77,7 @@ owm_pango(){
owm_json(){
owm
cat > .forecast.json <<EOF
tee > .forecast.json <<EOF
{
"min":"$MIN",
"max":"$MAX",
@ -93,19 +93,15 @@ wttrin(){
curl -sH "Accept-Language: ${LANG%_*}" --compressed "$request"
}
if [ "$1" == "full" ]
then
wttrin
elif [ "$1" == "short" ]
then
owm_short
elif [ "$1" == "pango" ]
then
owm_pango
elif [ "$1" == "json" ]
then
owm_json
elif [ "$1" == "long" ]
then
owm_long
fi
case "$1" in
short)
owm_short;;
pango)
owm_pango;;
json)
owm_json;;
long)
owm_long;;
full|*)
wttrin;;
esac

View File

@ -1,5 +1,6 @@
#!/bin/sh
set -e
# set -e
# set -x
comment(){
local file="$1";shift
@ -12,33 +13,35 @@ uncomment(){
}
gui_off (){
sudo chsh -s /usr/bin/zsh $(whoami)
# sudo chsh -s /usr/bin/zsh $(whoami)
rm ~/.config/mimeapps.list
cd .dotfiles
cd ~/.dotfiles
stow mime
uncomment /etc/mkinitcpio.conf "HOOKS.* (?!plymouth)"
comment /etc/mkinitcpio.conf "HOOKS.* plymouth"
yay -Rcs plymouth --noconfirm
yay -Rcs plymouth --noconfirm || true
sudo mkinitcpio -P
comment /boot/loader/entries/arch.conf "options quiet"
sudo systemctl disable NetworkManager
sudo systemctl enable netctl-auto@wlp1s0
sudo systemctl enable netctl-ifplugd@enp2s0
sudo systemctl enable netctl
systemctl -q is-active gdm &&
sudo systemctl disable --now gdm &
systemctl -q is-active gdm-plymouth &&
sudo systemctl disable --now gdm-plymouth &
sudo systemctl disable display-manager.service
sudo systemctl start getty@tty1
sudo systemctl enable ly
}
gui_on (){
sudo chsh -s /usr/bin/fish $(whoami)
# sudo chsh -s /usr/bin/fish $(whoami)
rm ~/.config/mimeapps.list
rm -f ~/.config/mimeapps.list
yay -S --noconfirm --needed gnome-defaults-list
cp /usr/share/applications/gnome-mimeapps.list ~/.config/mimeapps.list
kvantummanager --set Materia
@ -46,13 +49,20 @@ gui_on (){
comment /etc/mkinitcpio.conf "HOOKS.* (!?plymouth)"
uncomment /etc/mkinitcpio.conf "HOOKS.* plymouth"
yay -S plymouth --noconfirm
yay -S plymouth plymouth-theme-arch-glow --noconfirm --needed
sudo plymouth-set-default-theme arch-glow
sudo mkinitcpio -P
uncomment /boot/loader/entries/arch.conf "options quiet"
sudo systemctl enable --now gdm-plymouth
sudo systemctl disable netctl-auto@wlp1s0
sudo systemctl disable netctl-ifplugd@enp2s0
sudo systemctl disable netctl
sudo systemctl enable NetworkManager
sudo systemctl disable display-manager.service
sudo systemctl enable gdm-plymouth
}
restart_gdm(){

4
scripts/.local/bin/launcher Executable file
View File

@ -0,0 +1,4 @@
#!/bin/fish
command -qs bmenu && exec bmenu run
command -qs wofi && exec wofi --show drun --allow-images --no-actions --prompt 'Iniciar: '

View File

@ -1,8 +1,10 @@
#!/bin/sh
set -e
menu=wdmenu
search(){
music=$(mpc playlist --format '%artist% : %title%' | sed '/^ : $/d' | wdmenu)
music=$(mpc playlist --format '%artist% : %title%' | sed '/^ : $/d' | $menu)
if [ "$music" == "" ]
then
exit 1
@ -16,7 +18,7 @@ search(){
delete(){
current=~/Música/"$(mpc current -f %file%)"
answer=$(echo -e "nothing\n$current" | wdmenu -p"delete?" )
answer=$(echo -e "nothing\n$current" | $menu -p"delete?" )
if [ "$answer" == "$current" ]
then
trash "$answer"

6
scripts/.local/bin/round-vol Executable file
View File

@ -0,0 +1,6 @@
#!/bin/fish
set cvol (pamixer --get-volume)
set nvol (math round\($cvol/5\)*5)
pamixer --set-volume $nvol

View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -x
if ! lsmod | grep v4l2loopback > /dev/null; then
echo "Adding v42loopback module to kernel"
sudo modprobe v4l2loopback
fi
geometry(){
windowGeometries=$(
# `height - 1` is there because of: https://github.com/ammen99/wf-recorder/pull/56 (I could remove it if it's merged, maybe)
swaymsg -t get_workspaces -r | jq -r '.[] | select(.focused) | .rect | "\(.x),\(.y) \(.width)x\(.height - 1)"'; \
swaymsg -t get_outputs -r | jq -r '.[] | select(.active) | .rect | "\(.x),\(.y) \(.width)x\(.height)"'
)
geometry=$(slurp -b "#45858820" -c "#45858880" -w 3 -d <<< "$windowGeometries") || exit $?
echo $geometry
}
{
if pgrep wf-recorder > /dev/null && pgrep ffplay > /dev/null
then
if pgrep ffplay > /dev/null; then
pkill ffplay > /dev/null
fi
if pgrep wf-recorder > /dev/null; then
pkill wf-recorder > /dev/null
fi
notify-send -t 2000 "Wayland recording has been stopped"
else
if ! pgrep wf-recorder > /dev/null; then
geometry=$(geometry) || exit $?
wf-recorder --muxer=v4l2 --codec=rawvideo --file=/dev/video2 --geometry="$geometry" &
fi
if ! pgrep ffplay; then
swaymsg assign [class=ffplay] workspace 11
unset SDL_VIDEODRIVER
ffplay /dev/video2 -fflags nobuffer &
sleep 0.5
# a hack so FPS is not dropping
swaymsg [class=ffplay] floating enable
# swaymsg [class=ffplay] move position 1900 1000
# swaymsg focus tiling
fi
notify-send -t 2000 "Wayland recording has been started"
fi
} > ~/.wayland-share-screen.log 2>&1

6
scripts/.local/bin/terminal Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
command -v kitty > /dev/null &&
exec kitty $@
command -v alacritty > /dev/null &&
exec alacritty -e $@

9
scripts/.local/bin/transadd Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
# Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running.
# transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep.
pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3)
transmission-remote -a "$@" && notify-send "🔽 Torrent added."

View File

@ -0,0 +1,23 @@
#!/bin/sh
# updates gdm to reflect the curent users monitors configurations
main(){
[ "$USER" = "root" ] && echo "Don't run as root" && exit 1
set -e
sudo cp ~/.config/monitors.xml /var/lib/gdm/.config/
sudo chown gdm:gdm /var/lib/gdm/.config/monitors.xml
}
if [ "$1" = "-h" ] || [ "$1" = "--help" ]
then
echo "Usage:"
echo " \$ $0"
else
main
fi

6
scripts/.local/bin/wdmenu Executable file
View File

@ -0,0 +1,6 @@
#!/bin/fish
command -qs bmenu &&
exec bmenu $argv
command -qs wofi &&
exec wofi -d $argv

21
scripts/.local/bin/windows10 Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/fish
if not command -v qemu-system-x86_64 > /dev/null
echo qemu not installed
exit 1
end
# -cdrom ~/Downloads/win10.iso \
# -boot order=d \
# -nic none\
# -usb -device usb-tablet \
qemu-system-x86_64 \
-enable-kvm \
-m 2G \
-cpu host \
-smp (nproc) \
-display sdl,gl=on \
-vga qxl \
-audiodev pa,id=pa \
-drive file="$HOME/.local/share/windows10.img",format=raw

45
scripts/.local/bin/wpass Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
CACHE=~/.cache/wpass-hist
set -e
shopt -s nullglob globstar
prefix=${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
[ -f $CACHE ] || touch $CACHE
for line in $(cat $CACHE); do
password_files+=( $line )
done
entry=$(printf '%s\n' "${password_files[@]}" |
sort | uniq -c | sort -r |
sed 's/ *[0-9]* //'|
wdmenu -p Password $@)
[ -n "$entry" ] && echo "$entry" >> $CACHE || exit
username=$( pass show "$entry" 2>/dev/null | perl -ne 'print $1 if /^login: (.*)/' )
password=$( pass show "$entry" 2>/dev/null | head -n 1 )
action=$(echo -e "Autotype\nUsername -> $username\nPassword" | wdmenu -p Action)
sleep 1s
swaymsg input \* xkb_layout 'us'
case $action in
Autotype)
ydotool type "$username"
ydotool key tab
ydotool type "$password"
;;
Username*)
printf '%s' "$username" | wl-copy;;
Password)
printf '%s' "$password" | wl-copy;;
esac
swaymsg input \* xkb_layout 'br(dvorak)'

View File

@ -7,17 +7,17 @@ swipe:
up:
command: 'swaymsg fullscreen toggle'
down:
command: 'wofi -S drun -ip"Iniciar: "'
command: 'launcher'
# pinch:
# in:
# command: 'xdotool key ctrl+shift+plus'
# out:
# command: 'xdotool key ctrl+minus'
threshold:
swipe: 1
# pinch: 0.2
# threshold:
# swipe: 1
# # pinch: 0.2
interval:
swipe: 0.5
# pinch: 0.2
# interval:
# swipe: 0.5
# # pinch: 0.2

View File

@ -2,6 +2,7 @@ font=Inter 12
text-color=#aaaaaa
background-color=#202020
border-color=#cc5757
border-size=5
progress-color=#cc5757
icons=1
default-timeout=10000

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

View File

@ -1,5 +1,5 @@
# LEL
#
# LEL
# _____ ____ _ _ _
# / __\ \ /\ / / _` | | | |
# \__ \\ V V / (_| | |_| |
@ -11,31 +11,36 @@
# Logo key.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
set $left h
set $down t
set $up n
set $right s
set $menu e
set $suspend o
set $kill k
set $mus r
set $term kitty
set $menu wofi --show drun --allow-images --insensitive -p'Iniciar: '
set $term terminal
# set $menu wofi --show drun --allow-images --insensitive --term $term -p'Iniciar: '
# set $menu bmenu run $term
# set $menu j4-dmenu-desktop --dmenu 'bmenu -p Iniciar:' --term $term
font Fira Code 14px
# }}}
# Output configuration {{{
#
output * bg '#252525' solid_color
# output * bg /usr/share/backgrounds/gnome/adwaita-night.jpg fill
# output * bg '#252525' solid_color
# output * bg /usr/share/backgrounds/gnome/adwaita-night.jpg fill
output * bg ~/.config/sway/assembly.png fit
# Output HDMI-A-1 resolution 1280x720
# Disable laptop screen if closed, --reload is important
set $laptop eDP-1
bindswitch --reload lid:on output $laptop disable
bindswitch --reload lid:off output $laptop enable
# output $laptop disable
bindsym $mod+o output eDP-1 toggle
exec_always swaymsg -t get_outputs | grep HDMI && swaymsg 'output eDP-1 disable'
# bindsym $mod+o output eDP-1 toggle
# exec_always swaymsg -t get_outputs | grep HDMI || swaymsg 'output eDP-1 enable'
# Backlight settings for laptops
exec sudo light -N 1
@ -47,6 +52,7 @@
#hide the mouse after 10 seconds
seat * hide_cursor 10000
seat * xcursor_theme capitaine-cursors
input "type:touchpad" {
#disable while typing
@ -56,7 +62,7 @@
}
input * {
xkb_layout br
xkb_layout br(dvorak)
xkb_numlock enabled
}
@ -68,28 +74,28 @@
bindsym $mod+Return exec $term
#start web browser
bindsym $mod+q exec qutebrowser
bindsym $mod+b exec qutebrowser
#start file manager
bindsym $mod+m exec nemo
# Kill focused window
bindsym $mod+x kill
bindsym $mod+$kill kill
# Start your launcher
bindsym $mod+d exec $menu
bindsym $mod+$menu exec launcher
# Fill passwords
bindsym Control+$mod+p exec keepmenu
bindsym Control+$mod+p exec wpass
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
bindsym $mod+Shift+c reload; exec pkill kanshi && kanshi
# Lock Sway
bindsym $mod+Control+s exec swaylock
bindsym $mod+Control+$suspend exec sudo systemctl suspend
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit'
@ -100,32 +106,32 @@
# Moving around: {{{
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus 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+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Resizing containers:
bindsym $mod+Control+$left resize shrink width 10px
bindsym $mod+Control+$down resize grow height 10px
bindsym $mod+Control+$up resize shrink height 10px
bindsym $mod+Control+$right resize grow width 10px
bindsym $mod+Control+$left resize shrink width 10px
bindsym $mod+Control+$down resize grow height 10px
bindsym $mod+Control+$up resize shrink height 10px
bindsym $mod+Control+$right resize grow width 10px
#}}}
# Workspaces: {{{
bindsym $mod+Next workspace next
bindsym $mod+Prior workspace prev
bindsym $mod+j workspace next
bindsym $mod+q workspace prev
# Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
@ -150,23 +156,25 @@
bindsym $mod+Shift+0 move container to workspace 10
# Assign programs to their workspace
assign [app_id=.*qutebrowser.*] workspace 2
assign [app_id=.*keepass.*] workspace 8
assign [app_id=qutebrowser] workspace 2
assign [class=qutebrowser] workspace 2
assign [class=Steam] workspace 9
assign [app_id=telegramdesktop] workspace 10
assign [class=TelegramDesktop] workspace 10
assign [class=discord] workspace 10
# }}}
# Layout stuff: {{{
#
# Splits
bindsym $mod+b splith
# bindsym $mod+b splith
bindsym $mod+v splitv
# Layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+o layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
@ -180,21 +188,14 @@
bindsym $mod+z focus child
# }}}
# Scratchpad: {{{
#
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window
bindsym $mod+minus scratchpad show
#}}}
# Screenshots: {{{
#
# Screens to file
bindsym Print exec grim $(xdg-user-dir PICTURES)/$(date +'%Y-%m-%d-%H%M%S_grim.png')
bindsym Print exec grim $(xdg-user-dir PICTURES || Imagens)/$(date +'%Y-%m-%d-%H%M%S_grim.png')
# Screen area to file
bindsym Shift+Print exec grim -g "$(slurp)" $(xdg-user-dir PICTURES)/$(date +'%Y-%m-%d-%H%M%S_grim-slurp.png')
bindsym Shift+Print exec grim -g "$(slurp)" $(xdg-user-dir PICTURES || Imagens)/$(date +'%Y-%m-%d-%H%M%S_grim-slurp.png')
# Screen area to clipboard
bindsym Control+Shift+Print exec grim -g "$(slurp)" - | wl-copy
@ -225,22 +226,28 @@
bindsym --locked XF86AudioPlay exec playerctl -p mpd play-pause
bindsym --locked XF86AudioNext exec playerctl -p mpd next
bindsym --locked XF86AudioPrev exec playerctl -p mpd previous
bindsym $mod+Shift+x exec musmenu delete
bindsym $mod+Shift+s exec musmenu search
bindsym $mod+Shift+$mus exec musmenu delete
bindsym $mod+Control+$mus exec musmenu search
bindsym $mod+Control+Shift+$mus exec dzadd
# }}}
# Special Keys{{{
bindsym XF86Calculator exec $term ipython
bindsym XF86Mail exec $term neomutt
bindsym XF86Explorer exec nemo
bindsym XF86Explorer exec thunar
bindsym XF86HomePage exec xdg-open http://start.duckduckgo.com
mode ignore {
bindsym $mod+escape mode default
}
bindsym $mod+escape mode ignore
# }}}
# }}}
# Visual: {{{
#
set $accent #CC575D
set $accent #D9534F
set $fg_color #ffffff
set $bg_color #191919
set $bg_darker #151515
@ -256,13 +263,13 @@
# bar {
# icon_theme Papirus
# position top
# gaps 5px
# colors {
# background $bg_color
# focused_workspace $accent $bg_color $fg_color
# }
# }
# position top
# gaps 5px
# colors {
# background $bg_color
# focused_workspace $accent $bg_color $fg_color
# }
# }
default_border pixel 2px
gaps inner 5px
@ -288,15 +295,21 @@
# Daemons {{{
#
# Autostart a terminal
exec $term
#Notification Daemon
exec mako
# Block device Mounter to /run/media/<username>
exec udiskie
# Screen manager
exec kanshi
# gesture daemon
exec fusuma
exec sh -c 'pkill fusuma; fusuma'
# exec sh -c 'pkill fusuma; fusuma'
# Blue light filter
exec_always sh -c 'pkill redshift; redshift'
exec redshift
# exec_always sh -c 'pkill redshift;redshift'
# kde connect
exec /usr/lib/kdeconnectd
exec kdeconnect-indicator
@ -313,7 +326,7 @@
timeout 1800 'swaylock -f' \
# timeout 1800 'swaymsg "output * dpms off"' \
# resume 'swaymsg "output * dpms on;reload"' \
#}}}
include /etc/sway/config.d/
include /etc/sway/config.d/
#}}}
# vim:filetype=i3config:foldmethod=marker

View File

@ -1,4 +1,5 @@
{
"layer":"top",
"modules-left": [
"sway/workspaces",
"sway/window"
@ -13,6 +14,8 @@
"custom/spigot",
"tray",
"custom/mail",
"custom/torrentD",
"custom/torrentS",
"custom/updates",
"pulseaudio",
"network",
@ -25,7 +28,6 @@
"1": "",
"2": "",
"3": "",
"8": "",
"9": "",
"10": "",
"urgent": "",
@ -38,12 +40,11 @@
},
"mpd": {
"tooltip":false,
"format": " {stateIcon} {title} - {artist} 🎜 ",
"format-disconnected": " Disconnected 🎜 ",
"format-stopped": " Stopped 🎜 ",
"format": " {stateIcon} {title} - {artist}",
"format-disconnected": " Disconnected",
"format-stopped": "",
"timeout":60,
"unknown-tag": " N/A ",
"tooltip":false,
"interval": 2,
"max-length":40,
"state-icons": {
@ -61,28 +62,27 @@
"tooltip":false
},
"battery": {
"tooltip":false,
"tooltip":true,
"states": {
"full":100,
"good": 95,
"warning": 30,
"critical": 15
"warning": 25
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
"format-good": "{time} {icon}",
"format": "{icon}",
"format-charging": "",
"format-plugged": "",
"format-full": "",
"format-icons": ["", "", "", "", ""]
"format-warning":"{icon} {time}",
"format-icons": ["", "", "", "", "", ""]
},
"network": {
"tooltip":false,
"on-click": "termite -e nmtui",
"format-wifi": "",
"format-ethernet": "",
"format-linked": "",
"format-disconnected": "⚠"
"on-click": "terminal nmtui",
"format-wifi": "{icon}",
"format-icons":[ "", "", "", "", "" ],
"format-ethernet": "",
"format-linked": "",
"format-disconnected": ""
},
"pulseaudio": {
"tooltip":false,
@ -104,27 +104,28 @@
},
"custom/weather": {
"tooltip":false,
"exec": "forecast pango",
"interval": 1800,
"on-click": "kitty --class weather sh -c 'forecast full;read -n1 -p\"Press Any key to quit \"'",
"format": "<b>{}</b>",
"exec": "jq -r '.temp +\"°C \"+ .weather' .forecast.json",
"interval": 30,
"on-click": "terminal --class weather sh -c 'forecast full;read -n1 -p\"Press Any key to quit \"'",
"on-click-right": "xdg-open https://openweathermap.org"
},
"custom/mail": {
"tooltip":false,
"format":"{} ",
"format":"{} <b></b>",
"exec-if":"sleep 30s",
"exec": "checkmail",
"on-click": "kitty neomutt; pkill -SIGRTMIN+4 waybar",
"on-click": "terminal neomutt; pkill -SIGRTMIN+4 waybar",
"signal": 4,
"interval": 1800
"interval": 30
},
"custom/updates": {
"tooltip":false,
"format": "{} ",
"interval": 43200,
"interval": 60,
"exec-if":"sleep 60s",
"exec": "yay -Syuw --noconfirm> /dev/null; yay -Qqu | wc -l | sed 's/^0$//'",
"on-click": "kitty sh -c 'ping -qc1 archlinux.org >/dev/null && yay -Syu || yay -Su; pkill -SIGRTMIN+8 waybar; read'",
"exec": "yay -Qqu | wc -l | sed 's/^0$//'",
"on-click": "terminal sh -c 'ping -qc1 archlinux.org >/dev/null && yay -Syu || yay -Su; pkill -SIGRTMIN+8 waybar; read'",
"signal": 8
},
"custom/recording": {
@ -138,8 +139,19 @@
"format":"{}",
"exec":"pgrep -f spigot.jar>/dev/null && spigot command list | awk '/There are/ {if ($6) print $6}'",
"interval":30,
"on-click":"kitty spigot console"
"on-click":"terminal spigot console"
},
"custom/torrentD":{
"format":" {} ",
"exec":"transmission-remote -l | tail -n+2 | grep Down | wc -l | sed 's/^0$//'",
"interval":180
},
"custom/torrentS":{
"format":" {} ",
"exec":"transmission-remote -l | grep Seeding| wc -l | sed 's/^0$//'",
"interval":180
}
}
# vim:ft=json

View File

@ -27,21 +27,18 @@ window#waybar.empty {
}
#workspaces button.focused {
border-top: 3px solid #cc5757;
border-top: 3px solid #D9534F;
border-bottom: 3px solid transparent;
color: #ffffff;
}
#workspaces button.urgent {
border-top: 3px solid #eb4deb;
}
/*Window Title*/
#window{
color:#aaa;
margin:0 4px;
}
#mpd,
#tray,
#clock,
@ -52,18 +49,24 @@ window#waybar.empty {
#custom-mail,
#custom-spigot,
#custom-updates,
#custom-weather
#custom-weather,
#custom-torrentD,
#custom-torrentS
{
margin: 0 7px;
color: #ffffff;
opacity:.7;
}
#custom-weather,
#clock
#clock,
#custom-weather
{
font-size:15px;
}
#network{
margin-top:-1px;
font-size:16px;
}
#mpd,
#window,

View File

@ -1,2 +1,8 @@
show=drun
prompt=Iniciar:
allow_images=true
allow_markup=true
term=terminal
insensitive=true
width=800
height=400

View File

@ -1,6 +1,28 @@
[Appearance]
color_scheme_path=/usr/share/qt5ct/colors/airy.conf
custom_palette=false
icon_theme=Papirus-Dark
standard_dialogs=default
style=kvantum
[Fonts]
fixed=@Variant(\0\0\0@\0\0\0\n\0I\0n\0t\0\x65\0r@&\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
general=@Variant(\0\0\0@\0\0\0\n\0I\0n\0t\0\x65\0r@&\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
[Interface]
activate_item_on_single_click=1
buttonbox_layout=3
cursor_flash_time=1200
dialog_buttons_have_icons=1
double_click_interval=400
gui_effects=@Invalid()
keyboard_scheme=2
menus_have_icons=true
show_shortcuts_in_context_menus=true
stylesheets=@Invalid()
toolbutton_style=4
underline_shortcut=1
wheel_scroll_lines=3
[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x2u\0\0\x4\xf\0\0\0\0\0\0\0\0\0\0\x2\xde\0\0\x2\x86\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x2u\0\0\x4\xf)
geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x3\xc5\0\0\0%\0\0\ax\0\0\x4\x30\0\0\x1\x34\0\0\x1,\0\0\x4\x12\0\0\x3\xc3\0\0\0\0\x2\0\0\0\a\x80\0\0\x3\xc5\0\0\0%\0\0\ax\0\0\x4\x30)"

View File

@ -0,0 +1,5 @@
# This file is written by LXAppearance. Do not edit.
[Icon Theme]
Name=Default
Comment=Default Cursor Theme
Inherits=capitaine-cursors

View File

@ -8,9 +8,9 @@ set -s escape-time 0
set -g set-titles on
set -g set-titles-string "#T"
#sneaky bar
# set -g status off
# set -g default-terminal "xterm-kitty"
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
set -g status off
set -g default-terminal "tmux-256color"
# set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
# }}}
#Theming# {{{
set -g status-bg default

View File

@ -59,12 +59,12 @@ export PAGER=less
source /etc/X11/xinit/xinitrc.d/30-gtk3-nocsd.sh
export _JAVA_AWT_WM_NONREPARENTING=1
# export _JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
export _JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
export XCURSOR_THEME=capitaine-cursors
export GTK_THEME=materia-custom-accent:dark
# esway &> .swaylog
ei3 &> .i3log
esway &> .swaylog
# ei3 &> .i3log
# ebsp &> .bsplog
fi
fi