first commit

This commit is contained in:
2026-02-13 04:20:30 +01:00
commit 2bd6b181f4
159 changed files with 194785 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
[Qt]
style=GTK+
[qt]
GUIEffects=none
KDE\contrast=7
KWinPalette\activeBackground=#272727
KWinPalette\activeBlend=#272727
KWinPalette\activeForeground=#dfdfdf
KWinPalette\activeTitleBtnBg=#121212
KWinPalette\frame=#121212
KWinPalette\inactiveBackground=#1e1e1e
KWinPalette\inactiveBlend=#1e1e1e
KWinPalette\inactiveForeground=#8b8b8b
KWinPalette\inactiveFrame=#121212
KWinPalette\inactiveTitleBtnBg=#121212
Palette\active=#dfdfdf, #2e2e2e, #dbdbdb, #b2b2b2, #949494, #6d6d6d, #dfdfdf, #ffffff, #ffffff, #1e1e1e, #121212, #b2b2b2, #285616, #ffffff, #5be026, #ad65af, #2d2d2d, #000000, #616161, #dfdfdf, #696969, #285616
Palette\disabled=#565656, #2c2c2c, #dbdbdb, #b2b2b2, #949494, #6d6d6d, #5d5d5d, #ffffff, #727272, #1d1d1d, #111111, #b2b2b2, #111111, #565656, #315d1f, #4c344d, #2b2b2b, #000000, #616161, #dfdfdf, #363636, #111111
Palette\inactive=#dfdfdf, #2e2e2e, #dbdbdb, #b2b2b2, #949494, #6d6d6d, #dfdfdf, #ffffff, #ffffff, #1e1e1e, #121212, #b2b2b2, #15290d, #dfdfdf, #5be026, #ad65af, #2d2d2d, #000000, #616161, #dfdfdf, #696969, #15290d
font="Noto Sans,10,-1,0,400,0,0,0,0,0,0,0,0,0,0,1"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
priority bat
set chafasixel

View File

@@ -0,0 +1,25 @@
[global]
font = Hack Nerd Font 12
enable_recursive_icon_lookup = true
icon_theme = "Numix-Circle"
width = 550
offset = 10x10
gap_size = 5
[urgency_low]
background = "#066d01"
foreground = "#eeeeee"
frame_color = "#044201"
timeout = 5
[urgency_normal]
background = "#066d01"
foreground = "#eeeeee"
frame_color = "#044201"
timeout = 10
[urgency_critical]
background = "#6d0a01"
foreground = "#eeeeee"
frame_color = "#420601"
timeout = 20

View File

@@ -0,0 +1,37 @@
[main]
font=Hack Nerd Font Mono:size=15
font-bold=Hack Nerd Font Mono:size=15:style=Bold
font-italic=Hack Nerd Font Mono:size=15:style=Italic
font-bold-italic=Hack Nerd Font Mono:size=15:style=Bold Italic
line-height=17
letter-spacing=-1
[cursor]
style=underline
[key-bindings]
clipboard-paste=Control+Alt+v XF86Paste
clipboard-copy=Control+Alt+c XF86Copy
[colors]
background=000000
foreground=efefef
selection-background=b5d5ff
selection-foreground=000000
regular0=000000
regular1=e1321a
regular2=6ab017
regular3=ffc005
regular4=004f9e
regular5=ec0048
regular6=2aa7e7
regular7=f2f2f2
bright0=5d5d5d
bright1=ff361e
bright2=7bc91f
bright3=ffd00a
bright4=0071ff
bright5=ff1d62
bright6=4bb8fd
bright7=ffffff
alpha=0.8

View File

@@ -0,0 +1,25 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-button-images=true
gtk-cursor-blink=true
gtk-cursor-blink-time=1000
gtk-cursor-theme-name=Vimix-cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-font-name=Noto Sans, 10
gtk-icon-theme-name=Numix-Circle
gtk-menu-images=true
gtk-modules=colorreload-gtk-module
gtk-primary-button-warps-slider=true
gtk-sound-theme-name=ocean
gtk-theme-name=Materia-dark-compact
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=3
gtk-xft-antialias=1
gtk-xft-dpi=98304
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight
gtk-xft-rgba=rgb

View File

@@ -0,0 +1,14 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-cursor-blink=true
gtk-cursor-blink-time=1000
gtk-cursor-theme-name=Vimix-cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-font-name=Noto Sans, 10
gtk-icon-theme-name=Numix-Circle
gtk-primary-button-warps-slider=true
gtk-sound-theme-name=ocean
gtk-theme-name=Materia-dark-compact
gtk-xft-dpi=98304

View File

@@ -0,0 +1,7 @@
{
"term": "alacritty",
"shells": {
"shell": "zsh -c 'tmuxinator start quake'"
},
"ratio": 0.5
}

View File

@@ -0,0 +1,314 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
set $Locker ~/.config/i3/i3lock-multimonitor/lock -i ~/.config/i3/lockscreen.png
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Iosevka,Font Awesome 7 Free,Font Awesome 7 Brands 9
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 12
# prevent blank screen & auto lock
exec --no-startup-id xset s off -dpms
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- $Locker
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
# exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym $mod+F4 exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# Pipewire-pulse
bindsym $mod+F3 exec pactl set-sink-mute 0 toggle
bindsym $mod+F3 --release exec pkill -RTMIN+1 i3blocks
bindsym $mod+F1 exec pactl set-sink-volume 0 -1%
bindsym $mod+F1 --release exec pkill -RTMIN+1 i3blocks
bindsym $mod+F2 exec pactl set-sink-volume 0 +1%
bindsym $mod+F2 --release exec pkill -RTMIN+1 i3blocks
# Media player controls
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioPause exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
# don't follow focus with mouse
focus_follows_mouse no
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar
# start a terminal
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
#bindsym $mod+d exec --no-startup-id dmenu_run
# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+Control+h split h
# split in vertical orientation
bindsym $mod+Control+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1: "
set $ws2 "2: "
set $ws3 "3: "
set $ws4 "4: "
set $ws5 "5: Torrenty"
set $ws6 "6: Libreoffice"
set $ws7 "7: Wirtualki"
set $ws8 "8: Emacs"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
#bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
set $mode_system (l)ock, l(o)gout, (s)uspend, (h)ibernate, (r)eboot, shu(t)down
mode "$mode_system" {
bindsym l exec --no-startup-id $Locker, mode "default"
bindsym o exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym h exec --no-startup-id systemctl hibernate, mode "default"
bindsym t exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+e mode "$mode_system"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf
position top
i3bar_command i3bar --transparency
tray_output none
colors {
background #00000099
statusline #ffffff
separator #000000
focused_workspace #34003f #6e0284 #ffffff
#active_workspace #333333 #5f676a #ffffff
inactive_workspace #220028 #35013f #888888
urgent_workspace #470801 #630000 #ffffff
#binding_mode #2f343a #900000 #ffffff
}
}
# gnome-keyring
exec --no-startup-id dbus-update-activation-environment --systemd --all
exec --no-startup-id gnome-keyring-daemon --start --components=secrets
# picom
exec --no-startup-id picom
# dunst
exec --no-startup-id dunst
# display wallpaper
exec --no-startup-id feh --bg-fill ~/.config/i3/wallpaper.png
# shortcut for lockscreen
bindsym $mod+x exec $Locker
# set default workspace layout
workspace_layout tabbed
# window assignments
assign [class="[Ff]irefox.*"] $ws2
assign [class="[Ll]ibre[Ww]olf"] $ws2
assign [class="[Cc]hromium"] $ws3
assign [class="[Gg]oogle[ -]*[Cc]hrome.*"] $ws3
assign [class="[Tt]hunderbird.*"] $ws4
assign [class="[Tt]or\s*[Bb]rowser"] $ws10
assign [class="[Nn]yxt"] $ws10
assign [class="qutebrowser"] $ws10
assign [class="[Ll]uakit"] $ws10
assign [class="[Vv]irt[ -]*manager"] $ws7
assign [class="[Vv]irt[ -]*viewer"] $ws7
assign [class="[Qq]emu"] $ws7
assign [class="q[Bb]ittorrent"] $ws5
assign [class="[Nn]icotine"] $ws5
assign [class="[Ll]ibreoffice.*"] $ws6
assign [class="[Mm]ullvad.*"] $ws10
assign [class="[Qq]t[ -]*[Cc]reator"] $ws10
assign [class="[Ee]macs"] $ws8
assign [class="[Kk]iwix"] $ws10
assign [class="[Gg]alaxy[ -]*[Bb]uds[ -]*[Cc]lient"] $ws10
assign [class="[Kk]ee[Pp]ass.*"] $ws10
assign [class="[Tt]hunar"] $ws10
assign [class="[Pp][Hh][Pp][Ss]torm"] $ws10
assign [class="[Rr]uby[Mm]ine"] $ws10
assign [class="[Dd]ata[Gg]rip"] $ws10
assign [class="[Ww]eb[Ss]torm"] $ws10
assign [class="[Jj]etbrains.*"] $ws10
for_window [class="[Tt]or\s*[Bb]rowser"] floating enable, border normal
for_window [class="[Ff]lame[Ss]hot"] floating enable, border normal
# color scheme for windows
# border background text indicator (a line which shows where the next window will be placed)
client.focused #0b4701 #044f00 #ffffff #0b4701
client.unfocused #072d00 #023000 #969696 #072d00
client.focused_inactive #072d00 #023000 #969696 #072d00
client.urgent #630000 #630000 #ffffff #630000
# hide title bar
default_border pixel 1
default_floating_border pixel 1
# start rofi
bindsym $mod+d exec --no-startup-id rofi -show combi
bindsym $mod+p exec --no-startup-id ~/.local/bin/rofi-pass
# i3-quickterm
bindsym $mod+b exec i3-quickterm shell
# flameshot (for screenshots)
bindsym $mod+Print exec flameshot full -u -p ~/Pictures/Screenshots
bindsym $mod+Shift+Print exec flameshot gui -u -p ~/Pictures/Screenshots
bindsym Print exec flameshot full -p ~/Pictures/Screenshots
bindsym Shift+Print exec flameshot gui -p ~/Pictures/Screenshots

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 KiB

View File

@@ -0,0 +1,76 @@
# Global properties
separator=false
separator_block_width=15
#[essid]
#command=~/.config/i3blocks/i3blocks-contrib/essid/essid
#interval=60
#INTERFACE=wlo1
#label=
#separator=false
#
#[wifi]
#command=~/.config/i3blocks/i3blocks-contrib/wifi/wifi
#INTERFACE=wlo1
#interval=60
#
[iface]
command=~/.config/i3blocks/i3blocks-contrib/iface/iface
LABEL=
ADDRESS_FAMILY=inet6?
color=#00FF00
interval=10
# set this to 1 to display the name of the connected WIFI interface instead of the IP address.
display_wifi_name=1
[load_average]
command=~/.config/i3blocks/i3blocks-contrib/load_average/load_average
interval=10
min_width= 99.99
align=center
[memory]
command=~/.config/i3blocks/i3blocks-contrib/memory/memory
label=
interval=30
separator=false
# [memory]
# command=~/.config/i3blocks/i3blocks-contrib/memory/memory
# label=
# instance=swap
# interval=30
[temperature]
command=~/.config/i3blocks/i3blocks-contrib/temperature/temperature
label=
interval=10
T_WARN=70
T_CRIT=90
SENSOR_CHIP=coretemp-isa-0000
min_width=  100.0°C
align=center
[volume-pipewire]
command=~/.config/i3blocks/i3blocks-contrib/volume-pipewire/volume-pipewire
interval=persist
signal=1
SUBSCRIBE=1
[battery]
command=~/.config/i3blocks/i3blocks-contrib/battery/battery
interval=30
#LABEL=BAT
LABEL=⚡
#BAT_NUMBER=0
[time]
label=
command=date '+%d %b %Y %a'
interval=1
separator=false
[time]
label=
command=date '+%H:%M'
interval=1

View File

@@ -0,0 +1,114 @@
# interpreter for shell commands
set shell sh
# set '-eu' options for shell commands
# These options are used to have safer shell commands. Option '-e' is used to
# exit on error and option '-u' is used to give error for unset variables.
# Option '-f' disables pathname expansion which can be useful when $f, $fs, and
# $fx variables contain names with '*' or '?' characters. However, this option
# is used selectively within individual commands as it can be limiting at
# times.
set shellopts '-eu'
# set internal field separator (IFS) to "\n" for shell commands
# This is useful to automatically split file names in $fs and $fx properly
# since default file separator used in these variables (i.e. 'filesep' option)
# is newline. You need to consider the values of these options and create your
# commands accordingly.
set ifs "\n"
# leave some space at the top and the bottom of the screen
set scrolloff 10
# Use the `dim` attribute instead of underline for the cursor in the preview pane
set cursorpreviewfmt "\033[7;2m"
# use enter for shell commands
map <enter> shell
# show the result of execution of previous commands
map ` !true
# execute current file (must be executable)
map x $$f
map X !$f
# dedicated keys for file opener actions
map o &mimeopen $f
map O $mimeopen --ask $f
# define a custom 'open' command
# This command is called when current file is not a directory. You may want to
# use either file extensions and/or mime types here. Below uses an editor for
# text files and a file opener for the rest.
cmd open &{{
case $(file --mime-type -Lb $f) in
text/*) lf -remote "send $id \$$EDITOR \$fx";;
*) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;;
esac
}}
# mkdir command. See wiki if you want it to select created dir
map a :push %mkdir<space>
# define a custom 'rename' command without prompt for overwrite
# cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1
# map r push :rename<space>
# make sure trash folder exists
# %mkdir -p ~/.trash
# move current file or selected files to trash folder
# (also see 'man mv' for backup/overwrite options)
cmd trash %set -f; mv -t ~/.trash $fx
# define a custom 'delete' command
# cmd delete ${{
# set -f
# printf "$fx\n"
# printf "delete? [y/N] "
# read ans
# [ "$ans" = "y" ] && rm -rf $fx
# }}
# use '<delete>' key for either 'trash' or 'delete' command
# map <delete> trash
# map <delete> delete
# extract the current file with the right command
# (xkcd link: https://xkcd.com/1168/)
cmd extract ${{
set -f
case $f in
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
*.tar.gz|*.tgz) tar xzvf $f;;
*.tar.xz|*.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
esac
}}
# compress current file or selected files with tar and gunzip
cmd tar ${{
set -f
mkdir $1
cp -r $fx $1
tar czf $1.tar.gz $1
rm -rf $1
}}
# compress current file or selected files with zip
cmd zip ${{
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
}}
# set previewer
set previewer ctpv
set cleaner ctpvclear
&ctpv -s $id
&ctpvquit $id

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
## ~/.config/lf/previewer_sandbox
set -euo pipefail
(
exec bwrap \
--ro-bind /usr/bin /usr/bin \
--ro-bind /usr/share/ /usr/share/ \
--ro-bind /usr/lib /usr/lib \
--ro-bind /usr/lib64 /usr/lib64 \
--symlink /usr/bin /bin \
--symlink /usr/bin /sbin \
--symlink /usr/lib /lib \
--symlink /usr/lib64 /lib64 \
--proc /proc \
--dev /dev \
--ro-bind /etc /etc \
--ro-bind ~/.config ~/.config \
--ro-bind ~/.cache ~/.cache \
--ro-bind "$PWD" "$PWD" \
--unshare-all \
--new-session \
ctpv "$@"
)

View File

@@ -0,0 +1,18 @@
font=Hack Nerd Font 12
icon-path=/usr/share/icons/Numix-Circle
width=550
border-size=3
padding=10,10,10,10
background-color=#055d01
text-color=#eeeeee
border-color=#044201
default-timeout=10000
[urgency="low"]
default-timeout=5000
[urgency="critical"]
background-color=#6d0a01
text-color=#eeeeee
border-color=#420601
default-timeout=20000

View File

@@ -0,0 +1,30 @@
# Recommended location for database
db_file "~/.config/mpd/database"
# If running mpd using systemd, delete this line to log directly to systemd.
#log_file "syslog"
# The music directory is by default the XDG directory, uncomment to amend and choose a different directory
music_directory "~/Music"
# Uncomment to refresh the database whenever files in the music_directory are changed
#auto_update "yes"
#auto_update_depth "5"
# Uncomment to enable the functionalities
playlist_directory "~/.config/mpd/playlists"
#pid_file "~/.config/mpd/pid"
state_file "~/.config/mpd/state"
sticker_file "~/.config/mpd/sticker.sql"
bind_to_address "~/.config/mpd/socket"
restore_paused "yes"
#max_output_buffer_size "32768"
audio_output {
type "pipewire"
name "Pipewire Output"
}

View File

@@ -0,0 +1,30 @@
def_key "j"
scroll_down
def_key "k"
scroll_up
def_key "h"
previous_column
def_key "h"
volume_down
def_key "l"
next_column
def_key "l"
volume_up
def_key "ctrl-b"
page_up
def_key "ctrl-u"
page_up
def_key "ctrl-f"
page_down
def_key "ctrl-d"
page_down
def_key "g"
move_home
def_key "G"
move_end
def_key "n"
next_found_item
def_key "N"
previous_found_item
def_key ";"
show_lyrics

View File

@@ -0,0 +1,2 @@
seek_time = "2"
lyrics_fetchers = tekstowo

View File

@@ -0,0 +1,7 @@
line_endings = 'Unix'
indent_type = 'Spaces'
indent_width = 2
quote_style = 'AutoPreferSingle'
call_parentheses = 'Always'
[sort_requires]
enabled = true

View File

@@ -0,0 +1,4 @@
-- set default tab width to 2 spaces
vim.opt_local.tabstop = 2 -- number of spaces that a tab counts for
vim.opt_local.shiftwidth = 2 -- size of an autoindented shift
vim.opt_local.softtabstop = 0 -- indentation size

View File

@@ -0,0 +1 @@
vim.opt_local.expandtab = false -- use tabs instead of spaces

View File

@@ -0,0 +1,4 @@
-- set default tab width to 2 spaces
vim.opt_local.tabstop = 2 -- number of spaces that a tab counts for
vim.opt_local.shiftwidth = 2 -- size of an autoindented shift
vim.opt_local.softtabstop = 0 -- indentation size

View File

@@ -0,0 +1,8 @@
-- load settings
require('config.settings')
-- load plugins
require('config.lazy')
-- load keybindings
require('config.keybindings')

View File

@@ -0,0 +1,36 @@
{
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
"catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" },
"gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "c953789db7fd28eafe5eb5659846d34b5024b3cc" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
"nvim-config-local": { "branch": "main", "commit": "990f3e35e0fba8fb83012d7e85f9a6a77de7f87f" },
"nvim-lint": { "branch": "master", "commit": "bcd1a44edbea8cd473af7e7582d3f7ffc60d8e81" },
"nvim-lspconfig": { "branch": "master", "commit": "3f58aeca0c6ece8a9fb8782ea3fcb6024f285be3" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-treesitter": { "branch": "main", "commit": "4967fa48b0fe7a7f92cee546c76bb4bb61bb14d5" },
"nvim-ts-autotag": { "branch": "main", "commit": "db15f2e0df2f5db916e511e3fffb682ef2f6354f" },
"nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" },
"orgmode": { "branch": "master", "commit": "c421c7677b7332f5fd543023283a2290cf8dd4ff" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
"undotree": { "branch": "master", "commit": "fc28931fbfba66ab75d9af23fe46ffbbb9de6e8c" },
"vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" },
"vim-tmux-clipboard": { "branch": "master", "commit": "d4774dc7dfdd4b8a60613355ed32e6a1c18220cf" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}

View File

@@ -0,0 +1,3 @@
-- keep in visual mode after indenting
vim.keymap.set('v', '<', '<gv')
vim.keymap.set('v', '>', '>gv')

View File

@@ -0,0 +1,37 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
{ out, 'WarningMsg' },
{ '\nPress any key to exit...' },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'
-- Setup lazy.nvim
require('lazy').setup({
spec = {
-- import your plugins
{ import = 'plugins' },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { 'catppuccin' } },
-- configure ui
ui = { border = 'rounded' },
-- automatically check for plugin updates
checker = { enabled = true, notify = false },
})

View File

@@ -0,0 +1,101 @@
-- true color support
vim.o.termguicolors = true
-- fix transparency issues with alacritty
local highlights = {
'Normal',
'LineNr',
'Folded',
'NonText',
'SpecialKey',
'VertSplit',
'SignColumn',
'EndOfBuffer',
'TablineFill', -- this is specific to how I like my tabline to look like
}
for _, name in pairs(highlights) do
vim.cmd.highlight(name .. ' guibg=none ctermbg=none')
end
-- disable arrow keys
local all_modes = { 'n', 'i', 'v', 'o' }
vim.keymap.set(all_modes, '<Up>', '<Nop>', { noremap = true, silent = true })
vim.keymap.set(all_modes, '<Down>', '<Nop>', { noremap = true, silent = true })
vim.keymap.set(all_modes, '<Left>', '<Nop>', { noremap = true, silent = true })
vim.keymap.set(all_modes, '<Right>', '<Nop>', { noremap = true, silent = true })
vim.o.number = true -- display line numbers
vim.opt.clipboard:append({ 'unnamedplus', 'unnamed' }) -- always use clipboard in x11
vim.o.encoding = 'UTF-8' -- sets the character encoding used inside vim
vim.o.title = true -- when on, the title of the window will be set to the value of 'titlestring'
vim.o.signcolumn = 'yes'
-- spell checking
vim.o.spell = true
vim.opt.spelllang:append({ 'en_us', 'en_gb', 'pl' })
vim.opt.spelloptions:append({ 'camel' })
vim.o.spellcapcheck = ''
-- persistent undo
local undodir = vim.fn.stdpath('state') .. 'undo'
vim.fn.mkdir(undodir, 'p', '0700')
vim.o.undodir = undodir
vim.o.undofile = true
-- set proper file types for files in ~/ansible directory
vim.filetype.add({
pattern = {
[os.getenv('HOME') .. '/ansible/.*%.yml'] = 'yaml.ansible',
},
})
-- neovim terminal configuration
local augroup_term = vim.api.nvim_create_augroup('augroup_term', { clear = true })
vim.api.nvim_create_autocmd('TermOpen', { -- enter insert mode automatically
group = augroup_term,
pattern = '*',
callback = vim.cmd.startinsert,
})
vim.api.nvim_create_autocmd('TermOpen', { -- disable number lines on terminal buffers
group = augroup_term,
pattern = '*',
callback = function()
vim.o.number = false
vim.o.relativenumber = false
end,
})
vim.api.nvim_create_autocmd('TermOpen', { -- allow use ctrl-c on terminal windows
group = augroup_term,
pattern = '*',
callback = function(args)
vim.keymap.set('n', '<C-c>', 'i<C-c>', { buffer = args.buf })
end,
})
vim.api.nvim_create_autocmd('TermEnter', { -- no sign column
group = augroup_term,
pattern = '*',
callback = function()
vim.opt_local.signcolumn = false
end,
})
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>') -- esc to exit insert mode
-- set default tab width to 4 spaces
vim.o.tabstop = 4 -- number of spaces that a tab counts for
vim.o.shiftwidth = 4 -- number of spaces that are inserted during indent operations
vim.o.softtabstop = 4 -- number of spaces that are inserted after pressing tab
vim.o.expandtab = true -- use spaces instead of tabs
-- c/c++ settings
vim.opt.cinoptions:append({ 'N-s' })
-- web dev settings
vim.g.html_indent_autotags = 'html,thead,tbody,tfoot'
vim.g.html_indent_script1 = 'auto'
vim.g.html_indent_style1 = 'auto'
-- set cursor shape to underline in the normal and command mode,
-- in the insert mode change shape to vertical bar, and disable
-- blinking in all modes
vim.opt.guicursor:append({ 'n-c:hor20', 'i:ver20', 'a:blinkon0' })

View File

@@ -0,0 +1,15 @@
return {
'catppuccin/nvim',
name = 'catppuccin',
priority = 1000,
lazy = false,
config = function()
require('catppuccin').setup({
flavour = 'mocha', -- latte, frappe, macchiato, mocha
transparent_background = true, -- disables setting the background color.
})
-- setup must be called before loading
vim.cmd.colorscheme('catppuccin')
end,
}

View File

@@ -0,0 +1,6 @@
return {
-- 'norcalli/nvim-colorizer.lua',
-- config = function()
-- require('colorizer').setup({ '*' })
-- end,
}

View File

@@ -0,0 +1,37 @@
return {
'stevearc/conform.nvim',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local conform = require('conform')
conform.setup({
formatters_by_ft = {
lua = { 'stylua' },
cpp = { 'clang-format' },
c = { 'clang-format' },
html = { 'prettier' },
css = { 'prettier' },
javascript = { 'prettier' },
python = { 'autopep8', 'isort' },
bash = { 'beautysh' },
csh = { 'beautysh' },
ksh = { 'beautysh' },
sh = { 'beautysh' },
zsh = { 'beautysh' },
},
-- format_on_save = {
-- lsp_fallback = true,
-- async = false,
-- timeout_ms = 1000,
-- },
})
vim.keymap.set({ 'n', 'v' }, '<leader>cf', function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = 'Format file or range (in visual mode)' })
end,
}

View File

@@ -0,0 +1,48 @@
return {
'lewis6991/gitsigns.nvim',
config = function()
local gitsigns = require('gitsigns')
gitsigns.setup({
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1,
},
-- yadm = {
-- enable = false,
-- },
})
end,
}

View File

@@ -0,0 +1,4 @@
return {
'nmac427/guess-indent.nvim',
config = true,
}

View File

@@ -0,0 +1,102 @@
return {
'neovim/nvim-lspconfig',
event = { 'BufReadPre', 'BufNewFile' },
dependencies = {
'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp,
{ 'folke/neodev.nvim', config = true },
},
config = function()
require('vim.lsp.protocol')
require('mason-lspconfig').setup({
automatic_enable = true,
})
vim.lsp.config('*', {
capabilities = {
textDocument = {
completion = {
completionItem = {
snippetSupport = false,
},
},
},
},
})
vim.lsp.config('lua_ls', {
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath('config')
and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc'))
then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using (most
-- likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Tell the language server how to find Lua modules same way as Neovim
-- (see `:h lua-module-load`)
path = {
'lua/?.lua',
'lua/?/init.lua',
},
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
-- Depending on the usage, you might want to add additional paths
-- here.
'${3rd}/luv/library'
-- '${3rd}/busted/library'
},
-- Or pull in all of 'runtimepath'.
-- NOTE: this is a lot slower and will cause issues when working on
-- your own configuration.
-- See https://github.com/neovim/nvim-lspconfig/issues/3189
-- library = {
-- vim.api.nvim_get_runtime_file('', true),
-- }
},
})
end,
settings = {
Lua = {},
},
})
vim.diagnostic.config({
virtual_text = {
prefix = '', -- Could be '■', '●', '▎', 'x'
},
signs = {
text = {
[vim.diagnostic.severity.ERROR] = '󰅚 ',
[vim.diagnostic.severity.WARN] = '󰀪 ',
[vim.diagnostic.severity.INFO] = '',
[vim.diagnostic.severity.HINT] = '󰌶 ',
},
texthl = {
[vim.diagnostic.severity.ERROR] = 'DiagnosticSignError',
[vim.diagnostic.severity.WARN] = 'DiagnosticSignWarn',
[vim.diagnostic.severity.INFO] = 'DiagnosticSignInfo',
[vim.diagnostic.severity.HINT] = 'DiagnosticSignHint',
},
numhl = {
[vim.diagnostic.severity.ERROR] = 'DiagnosticSignError',
[vim.diagnostic.severity.WARN] = 'DiagnosticSignWarn',
[vim.diagnostic.severity.INFO] = 'DiagnosticSignInfo',
[vim.diagnostic.severity.HINT] = 'DiagnosticSignHint',
},
},
})
end,
}

View File

@@ -0,0 +1,11 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
options = {
theme = 'catppuccin',
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
},
},
}

View File

@@ -0,0 +1,75 @@
return {
'williamboman/mason.nvim',
dependencies = {
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
},
config = function()
require('mason').setup({
ui = { border = 'rounded' },
})
require('mason-lspconfig').setup({
automatic_enable = true,
})
require('mason-tool-installer').setup({
ensure_installed = {
-- lua scripting
'stylua', -- lua formatter
'lua_ls',
-- vimrc editing
'vimls',
-- editorconfig stuff
'editorconfig-checker',
-- system administration's related stuff
'ansiblels',
'yamllint',
'systemdlint',
-- 'nginx_language_server',
'dockerls',
'docker_compose_language_service',
-- shell scripting
'shellcheck',
'bashls',
'beautysh',
-- python
'python-lsp-server',
'pylint',
'autopep8',
'mypy',
'isort',
-- c/c++
'clangd',
'clang-format',
'cmakelang',
'cmakelint',
'checkmake',
-- latex
'texlab',
'latexindent',
-- web development
'html',
'cssls',
'stylelint',
'eslint',
'standardjs',
'jsonlint',
-- databases
'sqlfluff',
-- misc
'jinja_lsp',
},
})
end,
}

View File

@@ -0,0 +1,9 @@
return {
'rcarriga/nvim-notify',
config = function()
vim.notify = require("notify")
vim.notify.setup({
background_colour = "#000000",
})
end
}

View File

@@ -0,0 +1,10 @@
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
opts = {
disable_filetype = { 'TelescopePrompt', 'spectre_panel', 'snacks_picker_input', 'vim' },
enable_afterquote = false,
enable_bracket_in_quote = false,
ignored_next_char = '[%w%.]', -- will ignore alphanumeric and `.` symbol
},
}

View File

@@ -0,0 +1,76 @@
return {
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-buffer', -- source for text in buffer
'hrsh7th/cmp-path', -- source for file system paths
'saadparwaiz1/cmp_luasnip', -- snippets source for nvim-cmp
{ 'L3MON4D3/LuaSnip', config = true }, -- snippets plugin
'onsails/lspkind.nvim', -- vs-code like pictograms
},
config = function()
local cmp = require('cmp')
local luasnip = require('luasnip')
local window_style = cmp.config.window.bordered({
winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu,Search:None',
col_offset = -3,
side_padding = 0,
})
cmp.setup({
view = {
docs = { auto_open = false },
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- use luasnip engine
end,
},
window = {
completion = window_style,
documentation = window_style,
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-g>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = false }),
['<C-d>'] = cmp.mapping(function(fallback)
if cmp.visible_docs() then
cmp.close_docs()
elseif cmp.visible() then
cmp.open_docs()
else
fallback()
end
end),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp', max_item_count = 10, keyword_length = 1 },
{ name = 'luasnip', max_item_count = 10, keyword_length = 1 },
{ name = 'buffer', max_item_count = 10, keyword_length = 1 },
{ name = 'path', max_item_count = 10, keyword_length = 1 },
}),
formatting = {
fields = { 'kind', 'abbr', 'menu' },
format = function(entry, vim_item)
local kind = require('lspkind').cmp_format({ mode = 'symbol_text', maxwidth = 50 })(entry, vim_item)
local strings = vim.split(kind.kind, '%s', { trimempty = true })
kind.kind = ' ' .. (strings[1] or '') .. ' '
kind.menu = ' (' .. (strings[2] or '') .. ')'
return kind
end,
},
enabled = function()
-- disable completion in comments
local context = require('cmp.config.context')
-- keep command mode completion enabled when cursor is in a comment
if vim.api.nvim_get_mode().mode == 'c' then
return true
else
return not context.in_treesitter_capture('comment') and not context.in_syntax_group('Comment')
end
end,
})
end,
}

View File

@@ -0,0 +1,19 @@
return {
'klen/nvim-config-local',
config = function()
require('config-local').setup({
-- Default options (optional)
-- Config file patterns to load (lua supported)
config_files = { '.nvim.lua', '.nvimrc', '.exrc' },
-- Where the plugin keeps files data
hashfile = vim.fn.stdpath('data') .. '/config-local',
autocommands_create = true, -- Create autocommands (VimEnter, DirectoryChanged)
commands_create = true, -- Create commands (ConfigLocalSource, ConfigLocalEdit, ConfigLocalTrust, ConfigLocalDeny)
silent = true, -- Disable plugin messages (Config loaded/denied)
lookup_parents = false, -- Lookup config files in parent directories
})
end,
}

View File

@@ -0,0 +1,30 @@
return {
'mfussenegger/nvim-lint',
config = function()
require('lint').linters_by_ft = {
['yaml.ansible'] = { 'ansible_lint' },
bash = { 'shellcheck' },
make = { 'checkmake' },
cmake = { 'cmakelint' },
cpp = { 'clangtidy' },
c = { 'clangtidy' },
editorconfig = { 'editorconfig-checker' },
html = { 'tidy' },
json = { 'jsonlint' },
sql = { 'sqlfluff' },
js = { 'standardjs' },
css = { 'stylelint' },
systemd = { 'systemdlint' },
yaml = { 'yamllint' },
zsh = { 'zsh' },
python = { 'pylint', 'mypy' },
}
vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
callback = function()
-- try_lint without arguments runs the linters defined in `linters_by_ft`
-- for the current filetype
require('lint').try_lint()
end,
})
end,
}

View File

@@ -0,0 +1,22 @@
return {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
lazy = false,
config = function()
local treesitter = require('nvim-treesitter')
treesitter.setup({})
treesitter.install({
'c',
'cpp',
'lua',
'bash',
'json',
'yaml',
'vim',
'dockerfile',
'gitignore',
'html',
'css',
})
end,
}

View File

@@ -0,0 +1,13 @@
return {
'windwp/nvim-ts-autotag',
config = function()
require('nvim-ts-autotag').setup({
opts = {
-- Defaults
enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of tags
enable_close_on_slash = false, -- Auto close on trailing </
},
})
end,
}

View File

@@ -0,0 +1,11 @@
return {
'nvim-orgmode/orgmode',
event = 'VeryLazy',
config = function()
-- Setup orgmode
require('orgmode').setup({
org_agenda_files = '~/orgfiles/**/*',
org_default_notes_file = '~/orgfiles/refile.org',
})
end,
}

View File

@@ -0,0 +1,21 @@
return {
'nvim-telescope/telescope.nvim',
tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require('telescope').setup({
pickers = {
find_files = { theme = 'dropdown' },
grep_string = { theme = 'dropdown' },
live_grep = { theme = 'dropdown' },
},
})
-- key bindings
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
end,
}

View File

@@ -0,0 +1,5 @@
return {
'folke/todo-comments.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = true,
}

View File

@@ -0,0 +1,37 @@
return {
'folke/trouble.nvim',
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = 'Trouble',
keys = {
{
'<leader>xx',
'<cmd>Trouble diagnostics toggle<cr>',
desc = 'Diagnostics (Trouble)',
},
{
'<leader>xX',
'<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
desc = 'Buffer Diagnostics (Trouble)',
},
{
'<leader>cs',
'<cmd>Trouble symbols toggle focus=false<cr>',
desc = 'Symbols (Trouble)',
},
{
'<leader>cl',
'<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
desc = 'LSP Definitions / references / ... (Trouble)',
},
{
'<leader>xL',
'<cmd>Trouble loclist toggle<cr>',
desc = 'Location List (Trouble)',
},
{
'<leader>xQ',
'<cmd>Trouble qflist toggle<cr>',
desc = 'Quickfix List (Trouble)',
},
},
}

View File

@@ -0,0 +1,6 @@
return {
'mbbill/undotree',
config = function()
vim.keymap.set('n', '<leader>ut', vim.cmd.UndotreeToggle)
end,
}

View File

@@ -0,0 +1,4 @@
return {
'michaeljsmith/vim-indent-object',
config = function() end,
}

View File

@@ -0,0 +1,4 @@
return {
'roxma/vim-tmux-clipboard',
config = function() end,
}

View File

@@ -0,0 +1,18 @@
return {
'folke/which-key.nvim',
event = 'VeryLazy',
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
keys = {
{
'<leader>?',
function()
require('which-key').show({ global = false })
end,
desc = 'Buffer Local Keymaps (which-key)',
},
},
}

View File

@@ -0,0 +1,39 @@
#
# $PARU_CONF
# /etc/paru.conf
# ~/.config/paru/paru.conf
#
# See the paru.conf(5) manpage for options
#
# GENERAL OPTIONS
#
[options]
PgpFetch
Devel
Provides
DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil
#AurOnly
#BottomUp
#RemoveMake
SudoLoop
#UseAsk
#SaveChanges
#CombinedUpgrade
#CleanAfter
#UpgradeMenu
#NewsOnUpgrade
LocalRepo
Chroot
Sign
SignDb
#KeepRepoCache
#
# Binary OPTIONS
#
[bin]
#FileManager = vifm
MFlags = --nosign
#Sudo = doas

View File

@@ -0,0 +1,14 @@
[github.com*]
target=github.com/whiteman808
[gitlab.com*]
target=gitlab.com/whiteman809
[bitbucket.org*]
target=bitbucket.org/whiteman808@paraboletancza.org
[codeberg.org*]
target=codeberg.org/whiteman808
[git.paraboletancza.org*]
target=git.paraboletancza.org/whiteman808

View File

@@ -0,0 +1,319 @@
#################################
# Shadows #
#################################
# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# Can be set per-window using rules.
#
# Default: false
shadow = false;
# The blur radius for shadows, in pixels.
#
# Default: 12
shadow-radius = 7;
# The opacity of shadows.
#
# Range: 0.0 - 1.0
# Default: 0.75
# shadow-opacity = .75
# The left offset for shadows, in pixels.
#
# Default: -15
shadow-offset-x = -7;
# The top offset for shadows, in pixels.
#
# Default: -15
shadow-offset-y = -7;
# Hex string color value of shadow. Formatted like "#RRGGBB", e.g. "#C0FFEE".
#
# Default: #000000
# shadow-color = "#000000"
# Crop shadow of a window fully on a particular monitor to that monitor. This is
# currently implemented using the X RandR extension.
#
# Default: false
# crop-shadow-to-monitor = false
#################################
# Fading #
#################################
# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used. Can be set per-window using rules.
#
# Default: false
fading = false;
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
fade-in-step = 0.03;
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
fade-out-step = 0.03;
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
# fade-delta = 10
# Do not fade on window open/close.
# no-fading-openclose = false
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false
#################################
# Transparency / Opacity #
#################################
# Opacity of window titlebars and borders.
#
# Range: 0.1 - 1.0
# Default: 1.0 (disabled)
frame-opacity = 0.7;
# Use fixed inactive dim value, instead of adjusting according to window opacity.
#
# Default: false
# inactive-dim-fixed = true
#################################
# Corners #
#################################
# Sets the radius of rounded window corners. When > 0, the compositor will
# round the corners of windows. Does not interact well with
# `transparent-clipping`.
#
# Default: 0 (disabled)
corner-radius = 0
#################################
# Blur #
#################################
# Parameters for background blurring, see BLUR section in the man page for more information.
# blur-method =
# blur-size = 12
#
# blur-deviation = false
#
# blur-strength = 5
# Blur background of semi-transparent / ARGB windows.
# Can be set per-window using rules.
#
# Default: false
# blur-background = false
# Blur background of windows when the window frame is not opaque.
# Implies:
# blur-background
#
# Default: false
# blur-background-frame = false
# Use fixed blur strength rather than adjusting according to window opacity.
#
# Default: false
# blur-background-fixed = false
# Specify the blur convolution kernel, with the following format:
# example:
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
# Can also be a pre-defined kernel, see the man page.
#
# Default: ""
blur-kern = "3x3box";
#################################
# General Settings #
#################################
# Enable remote control via D-Bus. See the man page for more details.
#
# Default: false
# dbus = true
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false
# Specify the backend to use: `xrender`, `glx`, or `egl`.
#
# Default: "xrender"
backend = "glx"
# Use higher precision during rendering, and apply dither when presenting the
# rendered screen. Reduces banding artifacts, but may cause performance
# degradation. Only works with OpenGL.
dithered-present = false;
# Enable/disable VSync.
#
# Default: false
vsync = true;
# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# Has nothing to do with `corner-radius`.
#
# Default: false
detect-rounded-corners = true;
# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
#
# Default: false
detect-client-opacity = true;
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. May be more accurate,
# provided that the WM supports it.
#
# Default: false
# use-ewmh-active-win = false
# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# Default: false
unredir-if-possible = false
# Delay before unredirecting the window, in milliseconds.
#
# Default: 0.
# unredir-if-possible-delay = 0
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# Default: false
detect-transient = true;
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. This usually means windows from the same application
# will be considered focused or unfocused at the same time.
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
#
# Default: false
# detect-client-leader = false
# Use of damage information for rendering. This cause the only the part of the
# screen that has actually changed to be redrawn, instead of the whole screen
# every time. Should improve performance.
#
# Default: false
use-damage = true;
# Use X Sync fence to wait for the completion of rendering of other windows,
# before using their content to render the current screen.
#
# Required for explicit sync drivers, such as nvidia.
#
# Default: false
# xrender-sync-fence = false
# GLX backend: Use specified GLSL fragment shader for rendering window
# contents. Read the man page for a detailed explanation of the interface.
#
# Can be set per-window using rules.
#
# window-shader-fg = "default"
# Force all windows to be painted with blending. Useful if you
# have a `window-shader-fg` that could turn opaque pixels transparent.
#
# Default: false
# force-win-blend = false
# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# Default: false
# no-ewmh-fullscreen = false
# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled.
#
# Default: 1.0 (disabled)
# max-brightness = 1.0
# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them. e.g. placing a transparent window on top
# of another window will cut a "hole" in that window, and show the desktop background
# underneath.
#
# Default: false
# transparent-clipping = false
# Set the log level. Possible values are:
# "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case insensitive.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# Default: "warn"
# log-level = "warn";
# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = "/path/to/your/log/file"
# Write process ID to a file.
# write-pid-path = "/path/to/your/log/file"
# Rule-based per-window options.
#
# See WINDOW RULES section in the man page for how these work.
rules: ({
match = "window_type = 'tooltip'";
fade = false;
shadow = true;
shadow = false;
#opacity = 0.75;
opacity = 1;
full-shadow = false;
}, {
match = "window_type = 'dock' || "
"window_type = 'desktop' || "
"_GTK_FRAME_EXTENTS@";
blur-background = false;
}, {
match = "window_type != 'dock'";
# shader = "my_shader.frag";
}, {
match = "window_type = 'dock' || "
"window_type = 'desktop'";
corner-radius = 0;
}, {
match = "name = 'Notification' || "
"class_g = 'Conky' || "
"class_g ?= 'Notify-osd' || "
"class_g = 'Cairo-clock' || "
"_GTK_FRAME_EXTENTS@";
shadow = false;
})
# `@include` directive can be used to include additional configuration files.
# Relative paths are search either in the parent of this configuration file
# (when the configuration is loaded through a symlink, the symlink will be
# resolved first). Or in `$XDG_CONFIG_HOME/picom/include`.
#
# @include "extra.conf"

View File

@@ -0,0 +1,41 @@
## browser config
# don't load autoconfig
config.load_autoconfig(False)
# appearance
config.source('gruvbox.py')
# editor
c.editor.command = ['alacritty', '-T', 'auxiliary text edit', '-e', 'nvim', '{file}', '+call cursor({line}, {column})']
# auto save session
c.auto_save.session = True
# set dark mode
c.colors.webpage.darkmode.enabled = True
# spell checking
c.spellcheck.languages = ['en-US', 'en-GB', 'pl-PL']
# built-in adblocker
c.content.blocking.method = 'both'
## key bindings
# swap J and K
config.bind('J', 'tab-prev')
config.bind('K', 'tab-next')
# toggle dark mode
config.bind('td', 'config-cycle colors.webpage.darkmode.enabled true false')
# source config
config.bind('cs', 'config-source')
# unfocus text field after exiting insert mode
config.bind('<Escape>', 'mode-leave ;; jseval -q document.activeElement.blur()', mode='insert')
# view videos in mpv
config.bind(',m', 'spawn mpv {url}')
config.bind(',M', 'hint links spawn mpv {hint-url}')

View File

@@ -0,0 +1,332 @@
# gruvbox dark hard qutebrowser theme by Florian Bruhin <me@the-compiler.org>
#
# Originally based on:
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# Gruvbox dark, hard scheme by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
bg0_hard = "#1d2021"
bg0_soft = '#32302f'
bg0_normal = '#282828'
bg0 = bg0_normal
bg1 = "#3c3836"
bg2 = "#504945"
bg3 = "#665c54"
bg4 = "#7c6f64"
fg0 = "#fbf1c7"
fg1 = "#ebdbb2"
fg2 = "#d5c4a1"
fg3 = "#bdae93"
fg4 = "#a89984"
bright_red = "#fb4934"
bright_green = "#b8bb26"
bright_yellow = "#fabd2f"
bright_blue = "#83a598"
bright_purple = "#d3869b"
bright_aqua = "#8ec07c"
bright_gray = "#928374"
bright_orange = "#fe8019"
dark_red = "#cc241d"
dark_green = "#98971a"
dark_yellow = "#d79921"
dark_blue = "#458588"
dark_purple = "#b16286"
dark_aqua = "#689d6a"
dark_gray = "#a89984"
dark_orange = "#d65d0e"
### Completion
# Text color of the completion widget. May be a single color to use for
# all columns or a list of three colors, one for each column.
c.colors.completion.fg = [fg1, bright_aqua, bright_yellow]
# Background color of the completion widget for odd rows.
c.colors.completion.odd.bg = bg0
# Background color of the completion widget for even rows.
c.colors.completion.even.bg = c.colors.completion.odd.bg
# Foreground color of completion widget category headers.
c.colors.completion.category.fg = bright_blue
# Background color of the completion widget category headers.
c.colors.completion.category.bg = bg1
# Top border color of the completion widget category headers.
c.colors.completion.category.border.top = c.colors.completion.category.bg
# Bottom border color of the completion widget category headers.
c.colors.completion.category.border.bottom = c.colors.completion.category.bg
# Foreground color of the selected completion item.
c.colors.completion.item.selected.fg = fg0
# Background color of the selected completion item.
c.colors.completion.item.selected.bg = bg4
# Top border color of the selected completion item.
c.colors.completion.item.selected.border.top = bg2
# Bottom border color of the selected completion item.
c.colors.completion.item.selected.border.bottom = c.colors.completion.item.selected.border.top
# Foreground color of the matched text in the selected completion item.
c.colors.completion.item.selected.match.fg = bright_orange
# Foreground color of the matched text in the completion.
c.colors.completion.match.fg = c.colors.completion.item.selected.match.fg
# Color of the scrollbar handle in the completion view.
c.colors.completion.scrollbar.fg = c.colors.completion.item.selected.fg
# Color of the scrollbar in the completion view.
c.colors.completion.scrollbar.bg = c.colors.completion.category.bg
### Context menu
# Background color of disabled items in the context menu.
c.colors.contextmenu.disabled.bg = bg3
# Foreground color of disabled items in the context menu.
c.colors.contextmenu.disabled.fg = fg3
# Background color of the context menu. If set to null, the Qt default is used.
c.colors.contextmenu.menu.bg = bg0
# Foreground color of the context menu. If set to null, the Qt default is used.
c.colors.contextmenu.menu.fg = fg2
# Background color of the context menus selected item. If set to null, the Qt default is used.
c.colors.contextmenu.selected.bg = bg2
#Foreground color of the context menus selected item. If set to null, the Qt default is used.
c.colors.contextmenu.selected.fg = c.colors.contextmenu.menu.fg
### Downloads
# Background color for the download bar.
c.colors.downloads.bar.bg = bg0
# Color gradient start for download text.
c.colors.downloads.start.fg = bg0
# Color gradient start for download backgrounds.
c.colors.downloads.start.bg = bright_blue
# Color gradient end for download text.
c.colors.downloads.stop.fg = c.colors.downloads.start.fg
# Color gradient stop for download backgrounds.
c.colors.downloads.stop.bg = bright_aqua
# Foreground color for downloads with errors.
c.colors.downloads.error.fg = bright_red
### Hints
# Font color for hints.
c.colors.hints.fg = bg0
# Background color for hints.
c.colors.hints.bg = 'rgba(250, 191, 47, 200)' # bright_yellow
# Font color for the matched part of hints.
c.colors.hints.match.fg = bg4
### Keyhint widget
# Text color for the keyhint widget.
c.colors.keyhint.fg = fg4
# Highlight color for keys to complete the current keychain.
c.colors.keyhint.suffix.fg = fg0
# Background color of the keyhint widget.
c.colors.keyhint.bg = bg0
### Messages
# Foreground color of an error message.
c.colors.messages.error.fg = bg0
# Background color of an error message.
c.colors.messages.error.bg = bright_red
# Border color of an error message.
c.colors.messages.error.border = c.colors.messages.error.bg
# Foreground color of a warning message.
c.colors.messages.warning.fg = bg0
# Background color of a warning message.
c.colors.messages.warning.bg = bright_purple
# Border color of a warning message.
c.colors.messages.warning.border = c.colors.messages.warning.bg
# Foreground color of an info message.
c.colors.messages.info.fg = fg2
# Background color of an info message.
c.colors.messages.info.bg = bg0
# Border color of an info message.
c.colors.messages.info.border = c.colors.messages.info.bg
### Prompts
# Foreground color for prompts.
c.colors.prompts.fg = fg2
# Border used around UI elements in prompts.
c.colors.prompts.border = f'1px solid {bg1}'
# Background color for prompts.
c.colors.prompts.bg = bg3
# Background color for the selected item in filename prompts.
c.colors.prompts.selected.bg = bg2
### Statusbar
# Foreground color of the statusbar.
c.colors.statusbar.normal.fg = fg2
# Background color of the statusbar.
c.colors.statusbar.normal.bg = bg0
# Foreground color of the statusbar in insert mode.
c.colors.statusbar.insert.fg = bg0
# Background color of the statusbar in insert mode.
c.colors.statusbar.insert.bg = dark_aqua
# Foreground color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.fg = bg0
# Background color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.bg = dark_blue
# Foreground color of the statusbar in private browsing mode.
c.colors.statusbar.private.fg = bright_purple
# Background color of the statusbar in private browsing mode.
c.colors.statusbar.private.bg = bg0
# Foreground color of the statusbar in command mode.
c.colors.statusbar.command.fg = fg3
# Background color of the statusbar in command mode.
c.colors.statusbar.command.bg = bg1
# Foreground color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.fg = c.colors.statusbar.private.fg
# Background color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.bg = c.colors.statusbar.command.bg
# Foreground color of the statusbar in caret mode.
c.colors.statusbar.caret.fg = bg0
# Background color of the statusbar in caret mode.
c.colors.statusbar.caret.bg = dark_purple
# Foreground color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.fg = c.colors.statusbar.caret.fg
# Background color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.bg = bright_purple
# Background color of the progress bar.
c.colors.statusbar.progress.bg = bright_blue
# Default foreground color of the URL in the statusbar.
c.colors.statusbar.url.fg = fg4
# Foreground color of the URL in the statusbar on error.
c.colors.statusbar.url.error.fg = dark_red
# Foreground color of the URL in the statusbar for hovered links.
c.colors.statusbar.url.hover.fg = bright_orange
# Foreground color of the URL in the statusbar on successful load
# (http).
c.colors.statusbar.url.success.http.fg = bright_red
# Foreground color of the URL in the statusbar on successful load
# (https).
c.colors.statusbar.url.success.https.fg = fg0
# Foreground color of the URL in the statusbar when there's a warning.
c.colors.statusbar.url.warn.fg = bright_purple
### tabs
# Background color of the tab bar.
c.colors.tabs.bar.bg = bg0
# Color gradient start for the tab indicator.
c.colors.tabs.indicator.start = bright_blue
# Color gradient end for the tab indicator.
c.colors.tabs.indicator.stop = bright_aqua
# Color for the tab indicator on errors.
c.colors.tabs.indicator.error = bright_red
# Foreground color of unselected odd tabs.
c.colors.tabs.odd.fg = fg2
# Background color of unselected odd tabs.
c.colors.tabs.odd.bg = bg2
# Foreground color of unselected even tabs.
c.colors.tabs.even.fg = c.colors.tabs.odd.fg
# Background color of unselected even tabs.
c.colors.tabs.even.bg = bg3
# Foreground color of selected odd tabs.
c.colors.tabs.selected.odd.fg = fg2
# Background color of selected odd tabs.
c.colors.tabs.selected.odd.bg = bg0
# Foreground color of selected even tabs.
c.colors.tabs.selected.even.fg = c.colors.tabs.selected.odd.fg
# Background color of selected even tabs.
c.colors.tabs.selected.even.bg = bg0
# Background color of pinned unselected even tabs.
c.colors.tabs.pinned.even.bg = bright_green
# Foreground color of pinned unselected even tabs.
c.colors.tabs.pinned.even.fg = bg2
# Background color of pinned unselected odd tabs.
c.colors.tabs.pinned.odd.bg = bright_green
# Foreground color of pinned unselected odd tabs.
c.colors.tabs.pinned.odd.fg = c.colors.tabs.pinned.even.fg
# Background color of pinned selected even tabs.
c.colors.tabs.pinned.selected.even.bg = bg0
# Foreground color of pinned selected even tabs.
c.colors.tabs.pinned.selected.even.fg = c.colors.tabs.selected.odd.fg
# Background color of pinned selected odd tabs.
c.colors.tabs.pinned.selected.odd.bg = c.colors.tabs.pinned.selected.even.bg
# Foreground color of pinned selected odd tabs.
c.colors.tabs.pinned.selected.odd.fg = c.colors.tabs.selected.odd.fg
# Background color for webpages if unset (or empty to use the theme's
# color).
# c.colors.webpage.bg = bg4

View File

@@ -0,0 +1,62 @@
# This is a sample commands.py. You can add your own commands here.
#
# Please refer to commands_full.py for all the default commands and a complete
# documentation. Do NOT add them all here, or you may end up with defunct
# commands when upgrading ranger.
# A simple command for demonstration purposes follows.
# -----------------------------------------------------------------------------
from __future__ import (absolute_import, division, print_function)
# You can import any python module as needed.
import os
# You always need to import ranger.api.commands here to get the Command class:
from ranger.api.commands import Command
# Any class that is a subclass of "Command" will be integrated into ranger as a
# command. Try typing ":my_edit<ENTER>" in ranger!
class my_edit(Command):
# The so-called doc-string of the class will be visible in the built-in
# help that is accessible by typing "?c" inside ranger.
""":my_edit <filename>
A sample command for demonstration purposes that opens a file in an editor.
"""
# The execute method is called when you run this command in ranger.
def execute(self):
# self.arg(1) is the first (space-separated) argument to the function.
# This way you can write ":my_edit somefilename<ENTER>".
if self.arg(1):
# self.rest(1) contains self.arg(1) and everything that follows
target_filename = self.rest(1)
else:
# self.fm is a ranger.core.filemanager.FileManager object and gives
# you access to internals of ranger.
# self.fm.thisfile is a ranger.container.file.File object and is a
# reference to the currently selected file.
target_filename = self.fm.thisfile.path
# This is a generic function to print text in ranger.
self.fm.notify("Let's edit the file " + target_filename + "!")
# Using bad=True in fm.notify allows you to print error messages:
if not os.path.exists(target_filename):
self.fm.notify("The given file does not exist!", bad=True)
return
# This executes a function from ranger.core.acitons, a module with a
# variety of subroutines that can help you construct commands.
# Check out the source, or run "pydoc ranger.core.actions" for a list.
self.fm.edit_file(target_filename)
# The tab method is called when you press tab, and should return a list of
# suggestions that the user will tab through.
# tabnum is 1 for <TAB> and -1 for <S-TAB> by default
def tab(self, tabnum):
# This is a generic tab-completion function that iterates through the
# content of the current directory.
return self._tab_directory_content()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
(
exec bwrap \
--ro-bind /usr/bin /usr/bin \
--ro-bind /usr/share/ /usr/share/ \
--ro-bind /usr/lib /usr/lib \
--ro-bind /usr/lib64 /usr/lib64 \
--symlink /usr/bin /bin \
--symlink /usr/bin /sbin \
--symlink /usr/lib /lib \
--symlink /usr/lib64 /lib64 \
--proc /proc \
--dev /dev \
--ro-bind /etc /etc \
--ro-bind ~/.config ~/.config \
--ro-bind ~/.cache ~/.cache \
--ro-bind "$PWD" "$PWD" \
--unshare-all \
--new-session \
bash ~/.config/ranger/scope.sh "$@"
)

View File

@@ -0,0 +1,759 @@
# ===================================================================
# This file contains the default startup commands for ranger.
# To change them, it is recommended to create either /etc/ranger/rc.conf
# (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom
# commands there.
#
# If you copy this whole file there, you may want to set the environment
# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
#
# The purpose of this file is mainly to define keybindings and settings.
# For running more complex python code, please create a plugin in "plugins/" or
# a command in "commands.py".
#
# Each line is a command that will be run before the user interface
# is initialized. As a result, you can not use commands which rely
# on the UI such as :delete or :mark.
# ===================================================================
# ===================================================================
# == Options
# ===================================================================
# Which viewmode should be used? Possible values are:
# miller: Use miller columns which show multiple levels of the hierarchy
# multipane: Midnight-commander like multipane view showing all tabs next
# to each other
set viewmode miller
#set viewmode multipane
# How many columns are there, and what are their relative widths?
set column_ratios 1,3,4
# Which files should be hidden? (regular expression)
set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
# Show hidden files? You can toggle this by typing 'zh'
set show_hidden false
# Ask for a confirmation when running the "delete" command?
# Valid values are "always", "never", "multiple" (default)
# With "multiple", ranger will ask only if you delete multiple files at once.
set confirm_on_delete multiple
# Use non-default path for file preview script?
# ranger ships with scope.sh, a script that calls external programs (see
# README.md for dependencies) to preview images, archives, etc.
set preview_script ~/.config/ranger/scope.sh
# Use the external preview script or display simple plain text or image previews?
set use_preview_script true
# Automatically count files in the directory, even before entering them?
set automatically_count_files true
# Open all images in this directory when running certain image viewers
# like feh or sxiv? You can still open selected files by marking them.
set open_all_images true
# Be aware of version control systems and display information.
set vcs_aware false
# State of the four backends git, hg, bzr, svn. The possible states are
# disabled, local (only show local info), enabled (show local and remote
# information).
set vcs_backend_git enabled
set vcs_backend_hg disabled
set vcs_backend_bzr disabled
set vcs_backend_svn disabled
# Truncate the long commit messages to this length when shown in the statusbar.
set vcs_msg_length 50
# Use one of the supported image preview protocols
set preview_images true
# Set the preview image method. Supported methods:
#
# * w3m (default):
# Preview images in full color with the external command "w3mimgpreview"?
# This requires the console web browser "w3m" and a supported terminal.
# It has been successfully tested with "xterm" and "urxvt" without tmux.
#
# * iterm2:
# Preview images in full color using iTerm2 image previews
# (http://iterm2.com/images.html). This requires using iTerm2 compiled
# with image preview support.
#
# This feature relies on the dimensions of the terminal's font. By default, a
# width of 8 and height of 11 are used. To use other values, set the options
# iterm2_font_width and iterm2_font_height to the desired values.
#
# * terminology:
# Previews images in full color in the terminology terminal emulator.
# Supports a wide variety of formats, even vector graphics like svg.
#
# * urxvt:
# Preview images in full color using urxvt image backgrounds. This
# requires using urxvt compiled with pixbuf support.
#
# * urxvt-full:
# The same as urxvt but utilizing not only the preview pane but the
# whole terminal window.
#
# * kitty:
# Preview images in full color using kitty image protocol.
# Requires python PIL or pillow library.
# If ranger does not share the local filesystem with kitty
# the transfer method is changed to encode the whole image;
# while slower, this allows remote previews,
# for example during an ssh session.
# Tmux is unsupported.
#
# * ueberzug:
# Preview images in full color with the external command "ueberzug".
# Images are shown by using a child window.
# Only for users who run X11 in GNU/Linux.
set preview_images_method ueberzug
# Delay in seconds before displaying an image with the w3m method.
# Increase it in case of experiencing display corruption.
set w3m_delay 0.02
# Manually adjust the w3mimg offset when using a terminal which needs this
set w3m_offset 0
# Default iTerm2 font size (see: preview_images_method: iterm2)
set iterm2_font_width 8
set iterm2_font_height 11
# Use a unicode "..." character to mark cut-off filenames?
set unicode_ellipsis false
# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).
# Requires the python-bidi pip package
set bidi_support false
# Show dotfiles in the bookmark preview box?
set show_hidden_bookmarks true
# Which colorscheme to use? These colorschemes are available by default:
# default, jungle, snow, solarized
set colorscheme default
# Preview files on the rightmost column?
# And collapse (shrink) the last column if there is nothing to preview?
set preview_files true
set preview_directories true
set collapse_preview true
# Wrap long lines in plain text previews?
set wrap_plaintext_previews false
# Save the console history on exit?
set save_console_history true
# Draw the status bar on top of the browser window (default: bottom)
set status_bar_on_top false
# Draw a progress bar in the status bar which displays the average state of all
# currently running tasks which support progress bars?
set draw_progress_bar_in_status_bar true
# Draw borders around columns? (separators, outline, both, or none)
# Separators are vertical lines between columns.
# Outline draws a box around all the columns.
# Both combines the two.
set draw_borders none
# Display the directory name in tabs?
set dirname_in_tabs false
# Enable the mouse support?
set mouse_enabled true
# Display the file size in the main column or status bar?
set display_size_in_main_column true
set display_size_in_status_bar true
# Display the free disk space in the status bar?
set display_free_space_in_status_bar true
# Display files tags in all columns or only in main column?
set display_tags_in_all_columns true
# Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME`
set update_title false
# Set the tmux/screen window-name to "ranger"?
set update_tmux_title true
# Shorten the title if it gets long? The number defines how many
# directories are displayed at once, 0 turns off this feature.
set shorten_title 3
# Show hostname in titlebar?
set hostname_in_titlebar true
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
set tilde_in_titlebar false
# How many directory-changes or console-commands should be kept in history?
set max_history_size 20
set max_console_history_size 50
# Try to keep so much space between the top/bottom border when scrolling:
set scroll_offset 8
# Flush the input after each key hit? (Noticeable when ranger lags)
set flushinput true
# Padding on the right when there's no preview?
# This allows you to click into the space to run the file.
set padding_right true
# Save bookmarks (used with mX and `X) instantly?
# This helps to synchronize bookmarks between multiple ranger
# instances but leads to *slight* performance loss.
# When false, bookmarks are saved when ranger is exited.
set autosave_bookmarks true
# Save the "`" bookmark to disk. This can be used to switch to the last
# directory by typing "``".
set save_backtick_bookmark true
# You can display the "real" cumulative size of directories by using the
# command :get_cumulative_size or typing "dc". The size is expensive to
# calculate and will not be updated automatically. You can choose
# to update it automatically though by turning on this option:
set autoupdate_cumulative_size false
# Turning this on makes sense for screen readers:
set show_cursor false
# One of: size, natural, basename, atime, ctime, mtime, type, random
set sort natural
# Additional sorting options
set sort_reverse false
set sort_case_insensitive true
set sort_directories_first true
set sort_unicode false
# Enable this if key combinations with the Alt Key don't work for you.
# (Especially on xterm)
set xterm_alt_key false
# Whether to include bookmarks in cd command
set cd_bookmarks true
# Changes case sensitivity for the cd command tab completion
set cd_tab_case sensitive
# Use fuzzy tab completion with the "cd" command. For example,
# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
set cd_tab_fuzzy false
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to
# disable this feature.
set preview_max_size 0
# The key hint lists up to this size have their sublists expanded.
# Otherwise the submaps are replaced with "...".
set hint_collapse_threshold 10
# Add the highlighted file to the path in the titlebar
set show_selection_in_titlebar true
# The delay that ranger idly waits for user input, in milliseconds, with a
# resolution of 100ms. Lower delay reduces lag between directory updates but
# increases CPU load.
set idle_delay 2000
# When the metadata manager module looks for metadata, should it only look for
# a ".metadata.json" file in the current directory, or do a deep search and
# check all directories above the current one as well?
set metadata_deep_search false
# Clear all existing filters when leaving a directory
set clear_filters_on_dir_change false
# Disable displaying line numbers in main column.
# Possible values: false, absolute, relative.
set line_numbers false
# When line_numbers=relative show the absolute line number in the
# current line.
set relative_current_zero false
# Start line numbers from 1 instead of 0
set one_indexed false
# Save tabs on exit
set save_tabs_on_exit false
# Enable scroll wrapping - moving down while on the last item will wrap around to
# the top and vice versa.
set wrap_scroll false
# Set the global_inode_type_filter to nothing. Possible options: d, f and l for
# directories, files and symlinks respectively.
set global_inode_type_filter
# This setting allows to freeze the list of files to save I/O bandwidth. It
# should be 'false' during start-up, but you can toggle it by pressing F.
set freeze_files false
# Print file sizes in bytes instead of the default human-readable format.
set size_in_bytes false
# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
# give a warning when you nest ranger in a subshell started by ranger.
# Special value "error" makes the warning more visible.
set nested_ranger_warning true
# ===================================================================
# == Local Options
# ===================================================================
# You can set local options that only affect a single directory.
# Examples:
# setlocal path=~/downloads sort mtime
# ===================================================================
# == Command Aliases in the Console
# ===================================================================
alias e edit
alias q quit
alias q! quit!
alias qa quitall
alias qa! quitall!
alias qall quitall
alias qall! quitall!
alias setl setlocal
alias filter scout -prts
alias find scout -aets
alias mark scout -mr
alias unmark scout -Mr
alias search scout -rs
alias search_inc scout -rts
alias travel scout -aefklst
# ===================================================================
# == Define keys for the browser
# ===================================================================
# Basic
map Q quitall
map q quit
copymap q ZZ ZQ
map R reload_cwd
map F set freeze_files!
map <C-r> reset
map <C-l> redraw_window
map <C-c> abort
map <esc> change_mode normal
map ~ set viewmode!
map i display_file
map <A-j> scroll_preview 1
map <A-k> scroll_preview -1
map ? help
map W display_log
map w taskview_open
map S shell $SHELL
map : console
map ; console
map ! console shell%space
map @ console -p6 shell %%s
map # console shell -p%space
map s console shell%space
map r chain draw_possible_programs; console open_with%space
map f console find%space
map cd console cd%space
map <C-p> chain console; eval fm.ui.console.history_move(-1)
# Change the line mode
map Mf linemode filename
map Mi linemode fileinfo
map Mm linemode mtime
map Mh linemode humanreadablemtime
map Mp linemode permissions
map Ms linemode sizemtime
map MH linemode sizehumanreadablemtime
map Mt linemode metatitle
# Tagging / Marking
map t tag_toggle
map ut tag_remove
map "<any> tag_toggle tag=%any
map <Space> mark_files toggle=True
map v mark_files all=True toggle=True
map uv mark_files all=True val=False
map V toggle_visual_mode
map uV toggle_visual_mode reverse=True
# For the nostalgics: Midnight Commander bindings
map <F1> help
map <F2> rename_append
map <F3> display_file
map <F4> edit
map <F5> copy
map <F6> cut
map <F7> console mkdir%space
map <F8> console delete
#map <F8> console trash
map <F10> exit
# In case you work on a keyboard with dvorak layout
map <UP> move up=1
map <DOWN> move down=1
map <LEFT> move left=1
map <RIGHT> move right=1
map <HOME> move to=0
map <END> move to=-1
map <PAGEDOWN> move down=1 pages=True
map <PAGEUP> move up=1 pages=True
map <CR> move right=1
#map <DELETE> console delete
map <INSERT> console touch%space
# VIM-like
copymap <UP> k
copymap <DOWN> j
copymap <LEFT> h
copymap <RIGHT> l
copymap <HOME> gg
copymap <END> G
copymap <PAGEDOWN> <C-F>
copymap <PAGEUP> <C-B>
map J move down=0.5 pages=True
map K move up=0.5 pages=True
copymap J <C-D>
copymap K <C-U>
# Jumping around
map H history_go -1
map L history_go 1
map ] move_parent 1
map [ move_parent -1
map } traverse
map { traverse_backwards
map ) jump_non
map gh cd ~
map ge cd /etc
map gu cd /usr
map gd cd /dev
map gl cd -r .
map gL cd -r %f
map go cd /opt
map gv cd /var
map gm cd /media
map gi eval fm.cd('/run/media/' + os.getenv('USER'))
map gM cd /mnt
map gs cd /srv
map gp cd /tmp
map gr cd /
map gR eval fm.cd(ranger.RANGERDIR)
map g/ cd /
map g? cd /usr/share/doc/ranger
# External Programs
map E edit
map du shell -p du --max-depth=1 -h --apparent-size
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
map yp yank path
map yd yank dir
map yn yank name
map y. yank name_without_extension
# Filesystem Operations
map = chmod
map cw console rename%space
map a rename_append
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
map pp paste
map po paste overwrite=True
map pP paste append=True
map pO paste overwrite=True append=True
map pl paste_symlink relative=False
map pL paste_symlink relative=True
map phl paste_hardlink
map pht paste_hardlinked_subtree
map pd console paste dest=
map p`<any> paste dest=%any_path
map p'<any> paste dest=%any_path
map dD console delete
map dT console trash
map dd cut
map ud uncut
map da cut mode=add
map dr cut mode=remove
map dt cut mode=toggle
map yy copy
map uy uncut
map ya copy mode=add
map yr copy mode=remove
map yt copy mode=toggle
# Temporary workarounds
map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
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 ct search_next order=tag
map cs search_next order=size
map ci search_next order=mimetype
map cc search_next order=ctime
map cm search_next order=mtime
map ca search_next order=atime
# Tabs
map <C-n> tab_new
map <C-w> tab_close
map <TAB> tab_move 1
map <S-TAB> tab_move -1
map <A-Right> tab_move 1
map <A-Left> tab_move -1
map gt tab_move 1
map gT tab_move -1
map gn tab_new
map gc tab_close
map uq tab_restore
map <a-1> tab_open 1
map <a-2> tab_open 2
map <a-3> tab_open 3
map <a-4> tab_open 4
map <a-5> tab_open 5
map <a-6> tab_open 6
map <a-7> tab_open 7
map <a-8> tab_open 8
map <a-9> tab_open 9
map <a-r> tab_shift 1
map <a-l> tab_shift -1
# Sorting
map or set sort_reverse!
map oz set sort=random
map os chain set sort=size; set sort_reverse=False
map ob chain set sort=basename; set sort_reverse=False
map on chain set sort=natural; set sort_reverse=False
map om chain set sort=mtime; set sort_reverse=False
map oc chain set sort=ctime; set sort_reverse=False
map oa chain set sort=atime; set sort_reverse=False
map ot chain set sort=type; set sort_reverse=False
map oe chain set sort=extension; set sort_reverse=False
map oS chain set sort=size; set sort_reverse=True
map oB chain set sort=basename; set sort_reverse=True
map oN chain set sort=natural; set sort_reverse=True
map oM chain set sort=mtime; set sort_reverse=True
map oC chain set sort=ctime; set sort_reverse=True
map oA chain set sort=atime; set sort_reverse=True
map oT chain set sort=type; set sort_reverse=True
map oE chain set sort=extension; set sort_reverse=True
map dc get_cumulative_size
# Settings
map zc set collapse_preview!
map zd set sort_directories_first!
map zh set show_hidden!
map <C-h> set show_hidden!
copymap <C-h> <backspace>
copymap <backspace> <backspace2>
map zI set flushinput!
map zi set preview_images!
map zm set mouse_enabled!
map zp set preview_files!
map zP set preview_directories!
map zs set sort_case_insensitive!
map zu set autoupdate_cumulative_size!
map zv set use_preview_script!
map zf console filter%space
copymap zf zz
# Filter stack
map .d filter_stack add type d
map .f filter_stack add type f
map .l filter_stack add type l
map .m console filter_stack add mime%space
map .n console filter_stack add name%space
map .# console filter_stack add hash%space
map ." filter_stack add duplicate
map .' filter_stack add unique
map .| filter_stack add or
map .& filter_stack add and
map .! filter_stack add not
map .r filter_stack rotate
map .c filter_stack clear
map .* filter_stack decompose
map .p filter_stack pop
map .. filter_stack show
# Bookmarks
map `<any> enter_bookmark %any
map '<any> enter_bookmark %any
map m<any> set_bookmark %any
map um<any> unset_bookmark %any
map m<bg> draw_bookmarks
copymap m<bg> um<bg> `<bg> '<bg>
# Generate all the chmod bindings with some python help:
eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
# ===================================================================
# == Define keys for the console
# ===================================================================
# Note: Unmapped keys are passed directly to the console.
# Basic
cmap <tab> eval fm.ui.console.tab()
cmap <s-tab> eval fm.ui.console.tab(-1)
cmap <ESC> eval fm.ui.console.close()
cmap <CR> eval fm.ui.console.execute()
cmap <C-l> redraw_window
copycmap <ESC> <C-c>
copycmap <CR> <C-j>
# Move around
cmap <up> eval fm.ui.console.history_move(-1)
cmap <down> eval fm.ui.console.history_move(1)
cmap <left> eval fm.ui.console.move(left=1)
cmap <right> eval fm.ui.console.move(right=1)
cmap <home> eval fm.ui.console.move(right=0, absolute=True)
cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
cmap <a-b> eval fm.ui.console.move_word(left=1)
cmap <a-f> eval fm.ui.console.move_word(right=1)
copycmap <a-b> <a-left>
copycmap <a-f> <a-right>
# Line Editing
cmap <backspace> eval fm.ui.console.delete(-1)
cmap <delete> eval fm.ui.console.delete(0)
cmap <C-w> eval fm.ui.console.delete_word()
cmap <A-d> eval fm.ui.console.delete_word(backward=False)
cmap <C-k> eval fm.ui.console.delete_rest(1)
cmap <C-u> eval fm.ui.console.delete_rest(-1)
cmap <C-y> eval fm.ui.console.paste()
# And of course the emacs way
copycmap <ESC> <C-g>
copycmap <up> <C-p>
copycmap <down> <C-n>
copycmap <left> <C-b>
copycmap <right> <C-f>
copycmap <home> <C-a>
copycmap <end> <C-e>
copycmap <delete> <C-d>
copycmap <backspace> <C-h>
# Note: There are multiple ways to express backspaces. <backspace> (code 263)
# and <backspace2> (code 127). To be sure, use both.
copycmap <backspace> <backspace2>
# This special expression allows typing in numerals:
cmap <allow_quantifiers> false
# ===================================================================
# == Pager Keybindings
# ===================================================================
# Movement
pmap <down> pager_move down=1
pmap <up> pager_move up=1
pmap <left> pager_move left=4
pmap <right> pager_move right=4
pmap <home> pager_move to=0
pmap <end> pager_move to=-1
pmap <pagedown> pager_move down=1.0 pages=True
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 <LEFT> h
copypmap <RIGHT> l
copypmap <HOME> g
copypmap <END> G
copypmap <C-d> d
copypmap <C-u> u
copypmap <PAGEDOWN> n f <C-F> <Space>
copypmap <PAGEUP> p b <C-B>
# Basic
pmap <C-l> redraw_window
pmap <ESC> pager_close
copypmap <ESC> q Q i <F3>
pmap E edit_file
# ===================================================================
# == Taskview Keybindings
# ===================================================================
# Movement
tmap <up> taskview_move up=1
tmap <down> taskview_move down=1
tmap <home> taskview_move to=0
tmap <end> taskview_move to=-1
tmap <pagedown> taskview_move down=1.0 pages=True
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 <HOME> g
copytmap <END> G
copytmap <C-u> u
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 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)
tmap <delete> eval -q fm.ui.taskview.task_remove()
# Basic
tmap <C-l> redraw_window
tmap <ESC> taskview_close
copytmap <ESC> q Q w <C-c>

View File

@@ -0,0 +1,284 @@
# vim: ft=cfg
#
# This is the configuration file of "rifle", ranger's file executor/opener.
# Each line consists of conditions and a command. For each line the conditions
# are checked and if they are met, the respective command is run.
#
# Syntax:
# <condition1> , <condition2> , ... = command
#
# The command can contain these environment variables:
# $1-$9 | The n-th selected file
# $@ | All selected files
#
# If you use the special command "ask", rifle will ask you what program to run.
#
# Prefixing a condition with "!" will negate its result.
# These conditions are currently supported:
# match <regexp> | The regexp matches $1
# ext <regexp> | The regexp matches the extension of $1
# mime <regexp> | The regexp matches the mime type of $1
# name <regexp> | The regexp matches the basename of $1
# path <regexp> | The regexp matches the absolute path of $1
# has <program> | The program is installed (i.e. located in $PATH)
# env <variable> | The environment variable "variable" is non-empty
# file | $1 is a file
# directory | $1 is a directory
# number <n> | change the number of this command to n
# terminal | stdin, stderr and stdout are connected to a terminal
# X | A graphical environment is available (darwin, Xorg, or Wayland)
#
# There are also pseudo-conditions which have a "side effect":
# flag <flags> | Change how the program is run. See below.
# label <label> | Assign a label or name to the command so it can
# | be started with :open_with <label> in ranger
# | or `rifle -p <label>` in the standalone executable.
# else | Always true.
#
# Flags are single characters which slightly transform the command:
# f | Fork the program, make it run in the background.
# | New command = setsid $command >& /dev/null &
# r | Execute the command with root permissions
# | New command = sudo $command
# t | Run the program in a new terminal. If $TERMCMD is not defined,
# | rifle will attempt to extract it from $TERM.
# | New command = $TERMCMD -e $command
# Note: The "New command" serves only as an illustration, the exact
# 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.
#-------------------------------------------
# Websites
#-------------------------------------------
# Rarely installed browsers get higher priority; It is assumed that if you
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
# other hand are often only installed as fallback browsers.
ext x?html?, has surf, X, flag f = surf -- file://"$1"
ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has dwb, X, flag f = dwb -- "$@"
ext x?html?, has jumanji, X, flag f = jumanji -- "$@"
ext x?html?, has luakit, X, flag f = luakit -- "$@"
ext x?html?, has uzbl, X, flag f = uzbl -- "$@"
ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@"
ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@"
ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@"
ext x?html?, has midori, X, flag f = midori -- "$@"
ext x?html?, has opera, X, flag f = opera -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
ext x?html?, has chromium, X, flag f = chromium -- "$@"
ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
ext x?html?, has epiphany, X, flag f = epiphany -- "$@"
ext x?html?, has konqueror, X, flag f = konqueror -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has links2, terminal = links2 "$@"
ext x?html?, has links, terminal = links "$@"
ext x?html?, has lynx, terminal = lynx -- "$@"
ext x?html?, has w3m, terminal = w3m "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
# Define the "editor" for text files as first action
mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
mime ^text, label pager = "$PAGER" -- "$@"
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
ext 1 = man "$1"
ext s[wmf]c, has zsnes, X = zsnes "$1"
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
ext nes, has fceux, X = fceux "$1"
ext exe = wine "$1"
name ^[mM]akefile$ = make
#--------------------------------------------
# Scripts
#-------------------------------------------
ext py = python -- "$1"
ext pl = perl -- "$1"
ext rb = ruby -- "$1"
ext js = node -- "$1"
ext sh = sh -- "$1"
ext php = php -- "$1"
#--------------------------------------------
# Audio without X
#-------------------------------------------
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
#--------------------------------------------
# Video/Audio with a GUI
#-------------------------------------------
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
mime ^video, has mpv, X, flag f = mpv -- "$@"
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
mime ^video, has mplayer, X, flag f = mplayer -- "$@"
mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
mime ^video|audio, has totem, X, flag f = totem -- "$@"
mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
#--------------------------------------------
# Video without X
#-------------------------------------------
mime ^video, terminal, !X, has mpv = mpv -- "$@"
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
#-------------------------------------------
# Documents
#-------------------------------------------
ext pdf, has llpp, X, flag f = llpp "$@"
ext pdf, has zathura, X, flag f = zathura -- "$@"
ext pdf, has mupdf, X, flag f = mupdf "$@"
ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
ext pdf, has apvlv, X, flag f = apvlv -- "$@"
ext pdf, has xpdf, X, flag f = xpdf -- "$@"
ext pdf, has evince, X, flag f = evince -- "$@"
ext pdf, has atril, X, flag f = atril -- "$@"
ext pdf, has okular, X, flag f = okular -- "$@"
ext pdf, has epdfview, X, flag f = epdfview -- "$@"
ext pdf, has qpdfview, X, flag f = qpdfview "$@"
ext pdf, has open, X, flag f = open "$@"
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
ext djvu, has zathura,X, flag f = zathura -- "$@"
ext djvu, has evince, X, flag f = evince -- "$@"
ext djvu, has atril, X, flag f = atril -- "$@"
ext djvu, has djview, X, flag f = djview -- "$@"
ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
ext epub, has zathura, X, flag f = zathura -- "$@"
ext epub, has mupdf, X, flag f = mupdf -- "$@"
ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
ext cbr, has zathura, X, flag f = zathura -- "$@"
ext cbz, has zathura, X, flag f = zathura -- "$@"
#-------------------------------------------
# Images
#-------------------------------------------
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
mime ^image/svg, has display, X, flag f = display -- "$@"
mime ^image, has imv, X, flag f = imv -- "$@"
mime ^image, has pqiv, X, flag f = pqiv -- "$@"
mime ^image, has sxiv, X, flag f = sxiv -- "$@"
mime ^image, has feh, X, flag f = feh -- "$@"
mime ^image, has mirage, X, flag f = mirage -- "$@"
mime ^image, has ristretto, X, flag f = ristretto "$@"
mime ^image, has eog, X, flag f = eog -- "$@"
mime ^image, has eom, X, flag f = eom -- "$@"
mime ^image, has nomacs, X, flag f = nomacs -- "$@"
mime ^image, has geeqie, X, flag f = geeqie -- "$@"
mime ^image, has gpicview, X, flag f = gpicview -- "$@"
mime ^image, has gwenview, X, flag f = gwenview -- "$@"
mime ^image, has gimp, X, flag f = gimp -- "$@"
ext xcf, X, flag f = gimp -- "$@"
#-------------------------------------------
# Archives
#-------------------------------------------
# avoid password prompt by providing empty password
ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
# This requires atool
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
# Listing and extracting archives without atool:
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
ext zip, has unzip = unzip -l "$1" | less
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
ext ace, has unace = unace l "$1" | less
ext ace, has unace = for file in "$@"; do unace e "$file"; done
ext rar, has unrar = unrar l "$1" | less
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
#-------------------------------------------
# Fonts
#-------------------------------------------
mime ^font, has fontforge, X, flag f = fontforge "$@"
#-------------------------------------------
# Flag t fallback terminals
#-------------------------------------------
# Rarely installed terminal emulators get higher priority; It is assumed that
# if you install a rare terminal emulator, you probably use it.
# gnome-terminal/konsole/xterm on the other hand are often installed as part of
# a desktop environment or as fallback terminal emulators.
mime ^ranger/x-terminal-emulator, has terminology = terminology -e "$@"
mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@"
mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"
mime ^ranger/x-terminal-emulator, has sakura = sakura -e "$@"
mime ^ranger/x-terminal-emulator, has lilyterm = lilyterm -e "$@"
#mime ^ranger/x-terminal-emulator, has cool-retro-term = cool-retro-term -e "$@"
mime ^ranger/x-terminal-emulator, has termite = termite -x '"$@"'
#mime ^ranger/x-terminal-emulator, has yakuake = yakuake -e "$@"
mime ^ranger/x-terminal-emulator, has guake = guake -ne "$@"
mime ^ranger/x-terminal-emulator, has tilda = tilda -c "$@"
mime ^ranger/x-terminal-emulator, has st = st -e "$@"
mime ^ranger/x-terminal-emulator, has terminator = terminator -x "$@"
mime ^ranger/x-terminal-emulator, has urxvt = urxvt -e "$@"
mime ^ranger/x-terminal-emulator, has pantheon-terminal = pantheon-terminal -e "$@"
mime ^ranger/x-terminal-emulator, has lxterminal = lxterminal -e "$@"
mime ^ranger/x-terminal-emulator, has mate-terminal = mate-terminal -x "$@"
mime ^ranger/x-terminal-emulator, has xfce4-terminal = xfce4-terminal -x "$@"
mime ^ranger/x-terminal-emulator, has konsole = konsole -e "$@"
mime ^ranger/x-terminal-emulator, has gnome-terminal = gnome-terminal -- "$@"
mime ^ranger/x-terminal-emulator, has xterm = xterm -e "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
#-------------------------------------------
# Generic file openers
#-------------------------------------------
label open, has xdg-open = xdg-open "$@"
label open, has open = open -- "$@"
# Define the editor for non-text files + pager as last action
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
######################################################################
# The actions below are left so low down in this file on purpose, so #
# they are never triggered accidentally. #
######################################################################
# Execute a file as program/script.
mime application/x-executable = "$1"
# Move the file to trash using trash-cli.
label trash, has trash-put = trash-put -- "$@"
label trash = mkdir -p -- ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash; mv -- "$@" ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash

View File

@@ -0,0 +1,350 @@
#!/usr/bin/env bash
set -o noclobber -o noglob -o nounset -o pipefail
IFS=$'\n'
## If the option `use_preview_script` is set to `true`,
## then this script will be called and its output will be displayed in ranger.
## ANSI color codes are supported.
## STDIN is disabled, so interactive scripts won't work properly
## This script is considered a configuration file and must be updated manually.
## It will be left untouched if you upgrade ranger.
## Because of some automated testing we do on the script #'s for comments need
## to be doubled up. Code that is commented out, because it's an alternative for
## example, gets only one #.
## Meanings of exit codes:
## code | meaning | action of ranger
## -----+------------+-------------------------------------------
## 0 | success | Display stdout as preview
## 1 | no preview | Display no preview at all
## 2 | plain text | Display the plain content of the file
## 3 | fix width | Don't reload when width changes
## 4 | fix height | Don't reload when height changes
## 5 | fix both | Don't ever reload
## 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
## 7 | image | Display the file directly as an image
## Script arguments
FILE_PATH="${1}" # Full path of the highlighted file
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
## shellcheck disable=SC2034 # PV_HEIGHT is provided for convenience and unused
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
FILE_EXTENSION="${FILE_PATH##*.}"
FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')"
## Settings
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
HIGHLIGHT_TABWIDTH=${HIGHLIGHT_TABWIDTH:-8}
HIGHLIGHT_STYLE=${HIGHLIGHT_STYLE:-pablo}
HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}"
PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn}
OPENSCAD_IMGSIZE=${RNGR_OPENSCAD_IMGSIZE:-1000,1000}
OPENSCAD_COLORSCHEME=${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night}
handle_extension() {
case "${FILE_EXTENSION_LOWER}" in
## Archive
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
atool --list -- "${FILE_PATH}" && exit 5
bsdtar --list --file "${FILE_PATH}" && exit 5
exit 1;;
rar)
## Avoid password prompt by providing empty password
unrar lt -p- -- "${FILE_PATH}" && exit 5
exit 1;;
7z)
## Avoid password prompt by providing empty password
7z l -p -- "${FILE_PATH}" && exit 5
exit 1;;
## PDF
pdf)
## Preview as text conversion
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \
fmt -w "${PV_WIDTH}" && exit 5
mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \
fmt -w "${PV_WIDTH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
exit 1;;
## BitTorrent
torrent)
transmission-show -- "${FILE_PATH}" && exit 5
exit 1;;
## OpenDocument
odt|ods|odp|sxw)
## Preview as text conversion
odt2txt "${FILE_PATH}" && exit 5
## Preview as markdown conversion
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
exit 1;;
## XLSX
xlsx)
## Preview as csv conversion
## Uses: https://github.com/dilshod/xlsx2csv
xlsx2csv -- "${FILE_PATH}" && exit 5
exit 1;;
## HTML
htm|html|xhtml)
## Preview as text conversion
w3m -dump "${FILE_PATH}" && exit 5
lynx -dump -- "${FILE_PATH}" && exit 5
elinks -dump "${FILE_PATH}" && exit 5
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
;;
## JSON
json)
jq --color-output . "${FILE_PATH}" && exit 5
python -m json.tool -- "${FILE_PATH}" && exit 5
;;
## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
## by file(1).
dff|dsf|wv|wvc)
mediainfo "${FILE_PATH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
;; # Continue with next handler on failure
esac
}
handle_image() {
## Size of the preview if there are multiple options or it has to be
## rendered from vector graphics. If the conversion program allows
## specifying only one dimension while keeping the aspect ratio, the width
## will be used.
local DEFAULT_SIZE="1920x1080"
local mimetype="${1}"
case "${mimetype}" in
## SVG
# image/svg+xml|image/svg)
# convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
# exit 1;;
## DjVu
# image/vnd.djvu)
# ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \
# - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \
# && exit 6 || exit 1;;
## Image
image/*)
local orientation
orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
## If orientation data is present and the image actually
## needs rotating ("1" means no rotation)...
if [[ -n "$orientation" && "$orientation" != 1 ]]; then
## ...auto-rotate the image according to the EXIF data.
convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
fi
## `w3mimgdisplay` will be called for all images (unless overriden
## as above), but might fail for unsupported types.
exit 7;;
## Video
video/*)
# Thumbnail
ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
exit 1;;
## PDF
application/pdf)
pdftoppm -f 1 -l 1 \
-scale-to-x "${DEFAULT_SIZE%x*}" \
-scale-to-y -1 \
-singlefile \
-jpeg -tiffcompression jpeg \
-- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
&& exit 6 || exit 1;;
## ePub, MOBI, FB2 (using Calibre)
# application/epub+zip|application/x-mobipocket-ebook|\
# application/x-fictionbook+xml)
# # ePub (using https://github.com/marianosimone/epub-thumbnailer)
# epub-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" \
# "${DEFAULT_SIZE%x*}" && exit 6
# ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FILE_PATH}" \
# >/dev/null && exit 6
# exit 1;;
## Font
application/font*|application/*opentype)
preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png"
if fontimage -o "${preview_png}" \
--pixelsize "120" \
--fontname \
--pixelsize "80" \
--text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \
--text " abcdefghijklmnopqrstuvwxyz " \
--text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \
--text " The quick brown fox jumps over the lazy dog. " \
"${FILE_PATH}";
then
convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \
&& rm "${preview_png}" \
&& exit 6
else
exit 1
fi
;;
## Preview archives using the first image inside.
## (Very useful for comic book collections for example.)
# application/zip|application/x-rar|application/x-7z-compressed|\
# application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar)
# local fn=""; local fe=""
# local zip=""; local rar=""; local tar=""; local bsd=""
# case "${mimetype}" in
# application/zip) zip=1 ;;
# application/x-rar) rar=1 ;;
# application/x-7z-compressed) ;;
# *) tar=1 ;;
# esac
# { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \
# { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \
# { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \
# { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return
#
# fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \
# [ print(l, end='') for l in sys.stdin if \
# (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\
# sort -V | head -n 1)
# [ "$fn" = "" ] && return
# [ "$bsd" ] && fn=$(printf '%b' "$fn")
#
# [ "$tar" ] && tar --extract --to-stdout \
# --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6
# fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g')
# [ "$bsd" ] && bsdtar --extract --to-stdout \
# --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6
# [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}"
# [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \
# "${IMAGE_CACHE_PATH}" && exit 6
# [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \
# "${IMAGE_CACHE_PATH}" && exit 6
# [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}"
# ;;
esac
# openscad_image() {
# TMPPNG="$(mktemp -t XXXXXX.png)"
# openscad --colorscheme="${OPENSCAD_COLORSCHEME}" \
# --imgsize="${OPENSCAD_IMGSIZE/x/,}" \
# -o "${TMPPNG}" "${1}"
# mv "${TMPPNG}" "${IMAGE_CACHE_PATH}"
# }
# case "${FILE_EXTENSION_LOWER}" in
# ## 3D models
# ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH}
# ## is hardcoded as jpeg. So we make a tempfile.png and just
# ## move/rename it to jpg. This works because image libraries are
# ## smart enough to handle it.
# csg|scad)
# openscad_image "${FILE_PATH}" && exit 6
# ;;
# 3mf|amf|dxf|off|stl)
# openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6
# ;;
# esac
}
handle_mime() {
local mimetype="${1}"
case "${mimetype}" in
## RTF and DOC
text/rtf|*msword)
## Preview as text conversion
## note: catdoc does not always work for .doc files
## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/
catdoc -- "${FILE_PATH}" && exit 5
exit 1;;
## DOCX, ePub, FB2 (using markdown)
## You might want to remove "|epub" and/or "|fb2" below if you have
## uncommented other methods to preview those formats
*wordprocessingml.document|*/epub+zip|*/x-fictionbook+xml)
## Preview as markdown conversion
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
exit 1;;
## XLS
*ms-excel)
## Preview as csv conversion
## xls2csv comes with catdoc:
## http://www.wagner.pp.ru/~vitus/software/catdoc/
xls2csv -- "${FILE_PATH}" && exit 5
exit 1;;
## Text
text/* | */xml)
## Syntax highlight
if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
exit 2
fi
if [[ "$( tput colors )" -ge 256 ]]; then
local pygmentize_format='terminal256'
local highlight_format='xterm256'
else
local pygmentize_format='terminal'
local highlight_format='ansi'
fi
# env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
# --out-format="${highlight_format}" \
# --force -- "${FILE_PATH}" && exit 5
env COLORTERM=8bit bat --color=always --style="plain" --wrap=character \
-- "${FILE_PATH}" && exit 5
pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\
-- "${FILE_PATH}" && exit 5
exit 2;;
## DjVu
image/vnd.djvu)
## Preview as text conversion (requires djvulibre)
djvutxt "${FILE_PATH}" | fmt -w "${PV_WIDTH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
exit 1;;
## Image
image/*)
## Preview as text conversion
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
exiftool "${FILE_PATH}" && exit 5
exit 1;;
## Video and audio
video/* | audio/*)
mediainfo "${FILE_PATH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
exit 1;;
esac
}
handle_fallback() {
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
exit 1
}
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
handle_image "${MIMETYPE}"
fi
handle_extension
handle_mime "${MIMETYPE}"
handle_fallback
exit 1

View File

@@ -0,0 +1,7 @@
/*-*- mode: css; -*-*/
configuration {
modi: "drun,run,combi";
combi-modi: "drun,run";
show-icons: true;
}
@theme "~/.config/rofi/rounded-purple-dark.rasi"

View File

@@ -0,0 +1,95 @@
/* ROUNDED THEME FOR ROFI */
/* Author: Newman Sanchez (https://github.com/newmanls) */
* {
font: "Roboto 14";
background-color: transparent;
text-color: @fg0;
margin: 0px;
padding: 0px;
spacing: 0px;
}
window {
location: north;
y-offset: calc(50% - 176px);
width: 480;
border-radius: 24px;
background-color: @bg0;
}
mainbox {
padding: 12px;
}
inputbar {
background-color: @bg1;
border-color: @bg3;
border: 2px;
border-radius: 16px;
padding: 8px 16px;
spacing: 8px;
children: [ prompt, entry ];
}
prompt {
text-color: @fg2;
}
entry {
placeholder: "Search";
placeholder-color: @fg3;
}
message {
margin: 12px 0 0;
border-radius: 16px;
border-color: @bg2;
background-color: @bg2;
}
textbox {
padding: 8px 24px;
}
listview {
background-color: transparent;
margin: 12px 0 0;
lines: 8;
columns: 1;
fixed-height: false;
}
element {
padding: 8px 16px;
spacing: 8px;
border-radius: 16px;
}
element normal active {
text-color: @bg3;
}
element alternate active {
text-color: @bg3;
}
element selected normal, element selected active {
background-color: @bg3;
}
element-icon {
size: 1em;
vertical-align: 0.5;
}
element-text {
text-color: inherit;
}

View File

@@ -0,0 +1,15 @@
/* ROUNDED THEME FOR ROFI */
/* Author: Newman Sanchez (https://github.com/newmanls) */
* {
bg0: #212121F2;
bg1: #2A2A2A;
bg2: #3D3D3D80;
bg3: #AB47BCF2;
fg0: #E6E6E6;
fg1: #FFFFFF;
fg2: #969696;
fg3: #3D3D3D;
}
@import "rounded-common.rasi"

View File

@@ -0,0 +1,318 @@
## variables ##
# Logo key. Use Mod1 for Alt.
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term foot
set $menu "rofi -modi drun,run -show drun"
set $locker "swaylock -f -i ~/.config/sway/lockscreen.png --indicator-radius 100"
## output configuration ##
# default wallpaper
output * bg ~/.config/sway/wallpaper.png fill
## sway session ##
# lock sway session after closing laptop lid
bindswitch --locked lid:toggle exec $locker && systemctl sleep
## input configuration ##
input type:touchpad {
dwt enabled
tap enabled
natural_scroll disabled
middle_emulation enabled
}
input type:keyboard {
xkb_layout "pl"
}
## basic key bindings ##
# start a terminal
bindsym $mod+Return exec $term
# kill focused window
bindsym $mod+Shift+q kill
# start your launcher
bindsym $mod+d exec $menu
# rofi-pass
bindsym $mod+p exec ~/.local/bin/rofi-pass
# drop-down terminal
# bindsym $mod+b exec foot
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# shortcut for locking screen
bindsym $mod+x exec $locker
# reload the configuration file
bindsym $mod+Shift+r reload
# exit sway (logs you out of your Wayland session)
set $mode_system (l)ock, l(o)gout, (s)uspend, (h)ibernate, (r)eboot, shu(t)down
mode "$mode_system" {
bindsym l exec --no-startup-id $locker, mode "default"
bindsym o exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id $locker && systemctl suspend, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym h exec --no-startup-id systemctl hibernate, mode "default"
bindsym t exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+e mode "$mode_system"
# special keys to adjust volume via PulseAudio
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -1%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +1%
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
# special keys to adjust brightness via brightnessctl
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
# special key to take a screenshot with grim
bindsym Print exec grim
## moving around ##
# move your focus around
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
## workspaces ##
# define workspaces
set $ws1 "1: "
set $ws2 "2: "
set $ws3 "3: "
set $ws4 "4: "
set $ws5 "5: "
set $ws6 "6: Libreoffice"
set $ws7 "7: Wirtualki"
set $ws8 "8: Torrenty"
set $ws9 "9: Soulseek"
set $ws10 "10: Seamonkey"
set $wsF1 "11"
set $wsF2 "12"
set $wsF3 "13"
set $wsF4 "14"
set $wsF5 "15"
set $wsF6 "16"
set $wsF7 "17"
set $wsF8 "18"
set $wsF9 "19: Tor Browser"
set $wsF10 "20: "
set $wsF11 "21: KeePass"
set $wsF12 "22: Inne"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
bindsym $mod+F1 workspace number $wsF1
bindsym $mod+F2 workspace number $wsF2
bindsym $mod+F3 workspace number $wsF3
bindsym $mod+F4 workspace number $wsF4
bindsym $mod+F5 workspace number $wsF5
bindsym $mod+F6 workspace number $wsF6
bindsym $mod+F7 workspace number $wsF7
bindsym $mod+F8 workspace number $wsF8
bindsym $mod+F9 workspace number $wsF9
bindsym $mod+F10 workspace number $wsF10
bindsym $mod+F11 workspace number $wsF11
bindsym $mod+F12 workspace number $wsF12
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+Shift+F1 move container to workspace number $wsF1
bindsym $mod+Shift+F2 move container to workspace number $wsF2
bindsym $mod+Shift+F3 move container to workspace number $wsF3
bindsym $mod+Shift+F4 move container to workspace number $wsF4
bindsym $mod+Shift+F5 move container to workspace number $wsF5
bindsym $mod+Shift+F6 move container to workspace number $wsF6
bindsym $mod+Shift+F7 move container to workspace number $wsF7
bindsym $mod+Shift+F8 move container to workspace number $wsF8
bindsym $mod+Shift+F9 move container to workspace number $wsF9
bindsym $mod+Shift+F10 move container to workspace number $wsF10
bindsym $mod+Shift+F11 move container to workspace number $wsF11
bindsym $mod+Shift+F12 move container to workspace number $wsF12
# window assignments
assign [app_id="[Ff]irefox"] $ws2
assign [app_id="[Ll]ibre[Ww]olf"] $ws2
assign [app_id="[Cc]hromium"] $ws3
assign [app_id="[Tt]hunderbird"] $ws4
assign [class="[Ee]macs"] $ws5
assign [app_id="[Ll]ibreoffice.*"] $ws6
assign [app_id="[Vv]irt.*[Mm]anager"] $ws7
assign [app_id="[Vv]irt.*[Vv]iewer"] $ws7
assign [app_id="[Qq]emu"] $ws7
assign [app_id="q[Bb]ittorrent"] $ws8
assign [app_id="[Nn]icotine"] $ws9
assign [class="[Ss]ea[Mm]onkey"] $ws10
assign [app_id="[Tt]or.*[Bb]rowser"] $wsF9
assign [app_id="[Kk]iwix"] $wsF10
assign [app_id="[Kk]ee[Pp]ass"] $wsF11
assign [app_id="[Mm]ullvad.*"] $wsF12
assign [app_id="[Gg]alaxy.*[Bb]uds.*[Cc]lient"] $wsF12
assign [app_id="qutebrowser"] $wsF12
assign [app_id="[Tt]hunar"] $wsF12
assign [app_id="[Ll]uakit"] $wsF12
for_window [app_id="[Tt]or\s*[Bb]rowser"] floating enable, border normal
for_window [app_id="[Ff]lame[Ss]hot"] floating enable, border normal
for_window [class="[Pp]inentry"] floating enable, border normal
## layout ##
# set default workspace layout
workspace_layout tabbed
# changing layout
bindsym $mod+Control+h splith
bindsym $mod+Control+v splitv
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# make the current focus fullscreen
bindsym $mod+f fullscreen
# toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# move focus to the parent container
bindsym $mod+a focus parent
## scratchpad ##
# move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# show the next scratchpad window or hide the focused scratchpad window.
# if there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
## resizing containers ##
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
## hide title bar ##
font pango:Iosevka,Font Awesome 7 Free,Font Awesome 7 Brands 11
titlebar_border_thickness 0
titlebar_padding 0
hide_edge_borders --smart-titles both
## status bar ##
bar {
position top
status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf
font pango:Iosevka,Font Awesome 7 Free,Font Awesome 7 Brands 13
colors {
statusline #ffffff
background #00000099
separator #000000
focused_workspace #34003f #6e0284 #ffffff
#active_workspace #333333 #5f676a #ffffff
inactive_workspace #220028 #35013f #888888
urgent_workspace #470801 #630000 #ffffff
#binding_mode #2f343a #900000 #ffffff
}
}
## color scheme for windows ##
# border background text indicator (a line which shows where the next window will be placed)
client.focused #0b4701 #044f00 #ffffff #0b4701
client.unfocused #072d00 #023000 #969696 #072d00
client.focused_inactive #072d00 #023000 #969696 #072d00
client.urgent #630000 #630000 #ffffff #630000
## don't follow focus with mouse ##
focus_follows_mouse no
## run pure wayland session ##
# xwayland disable
## autostart ##
exec chromium
exec firefox
exec thunderbird
workspace number $ws1
exec foot
include /etc/sway/config.d/*

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 KiB

View File

@@ -0,0 +1,17 @@
---
name: misc
root: ~/
windows:
# - portage:
# layout: 2b75,159x42,0,0{79x42,0,0[79x21,0,0,1,79x20,0,22,14],79x42,80,0[79x13,80,0,9,79x13,80,14,10,79x14,80,28,11]}
# panes:
# - sudo -i
# - sudo -i
# - sudo watch -c -n 5 genlop -c -i
# - sudo tail -f /var/log/emerge-fetch.log
# - cd ~/whiteman808_overlay
# - poczta: neomutt
# - irc: weechat
# - kpop: ncmpcpp
- irc: weechat
- zsh:

View File

@@ -0,0 +1,4 @@
name: quake
root: ~/
windows:
- jabber: profanity