1
0
Fork 0

Compare commits

...

25 Commits

Author SHA1 Message Date
urosm b13ef3a62f fuzzel: tweak options 2024-09-13 20:41:54 +02:00
urosm d5748f1e55 foot: tweak options 2024-09-13 20:41:54 +02:00
urosm 64161967d4 vis: tweak markdown lexer 2024-09-13 20:41:54 +02:00
urosm b8f108ce1e vis: tweak theme 2024-09-13 20:41:54 +02:00
urosm 61680a7e93 README.md: update 2024-09-13 20:41:54 +02:00
urosm d241ff8472 .bashrc: drop ff alias 2024-09-13 20:41:54 +02:00
urosm d0fb31c1ca zathura: tweak options 2024-09-13 20:41:54 +02:00
urosm c2a73d46ec sway: formatting 2024-09-13 20:41:54 +02:00
urosm a0b6f992d1 sway: add additional menu scripts 2024-09-13 20:41:54 +02:00
urosm 732cf0b2c3 vis: tweak title 2024-09-13 20:41:54 +02:00
urosm 852aeb11f3 vis: rework statusline 2024-09-13 20:41:54 +02:00
urosm 3dc0c6a102 vis: tweak options 2024-09-13 20:41:54 +02:00
urosm 43f1666d76 vis: rework mappings 2024-09-13 20:41:54 +02:00
urosm 572d07cd3e vis: introduce find_root 2024-09-13 20:41:54 +02:00
urosm 2471d78a02 .profile: formatting 2024-09-13 20:41:54 +02:00
urosm 09c737daf7 .profile: sort HISTFILE 2024-09-13 20:41:54 +02:00
urosm 5ad2cc8743 mimeapps.list: add default app for inode/directory 2024-09-13 20:41:54 +02:00
urosm 450b80924c foot, fuzzel: tweak font size and line height for consistency 2024-09-13 20:41:34 +02:00
urosm 1d5e249027 apt: drop https in favour of http 2024-09-13 20:19:38 +02:00
urosm 660fcdfd80 .bashrc: add persistent history and fix PROMPT_COMMAND 2024-09-13 20:18:45 +02:00
urosm adcefe76ce vis.desktop: add vis.desktop 2024-09-12 23:10:37 +02:00
urosm 019e74ad85 footclient-directory.desktop: add footclient-directory.desktop 2024-09-12 23:09:44 +02:00
urosm c723fec436 .config/vis: add syntax info to statusline 2024-08-26 17:09:41 +02:00
urosm 882c29042a .config/{sway,foot}: integrate sway and foot terminal spawning 2024-08-26 17:04:23 +02:00
urosm 4bfd6003aa .config/vis: update config, theme, use local vis-std.lua 2024-08-26 17:03:12 +02:00
14 changed files with 309 additions and 244 deletions

10
.bashrc
View File

@ -16,7 +16,13 @@ alias grep="grep --color=auto"
alias ls="ls --color=auto"
alias ll="ls -AF1"
alias lll="ls -AFlh"
alias ff="find 2>/dev/null"
# history
HISTCONTROL="ignoreboth:erasedups"
HISTFILESIZE="-1"
HISTIGNORE="q"
shopt -s histappend
PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND%;}; }"history -a; history -c; history -r;"
# bash completion
if ! shopt -oq posix; then
@ -42,4 +48,4 @@ osc7_cwd() {
done
printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}"
}
PROMPT_COMMAND="osc7_cwd; $PROMPT_COMMAND"
PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND%;}; }osc7_cwd

View File

@ -1,4 +1,4 @@
deb https://deb.debian.org/debian testing main non-free-firmware
deb https://security.debian.org/debian-security testing-security main non-free-firmware
deb https://deb.debian.org/debian unstable main non-free-firmware
deb https://deb.debian.org/debian experimental main non-free-firmware
deb http://deb.debian.org/debian testing main non-free-firmware
deb http://security.debian.org/debian-security testing-security main non-free-firmware
deb http://deb.debian.org/debian unstable main non-free-firmware
deb http://deb.debian.org/debian experimental main non-free-firmware

View File

@ -1,6 +1,10 @@
[main]
font=monospace:size=13.5
line-height=15
dpi-aware=no
font=monospace:size=13
[bell]
visual=yes
[colors]
foreground=e2e2e2
@ -21,6 +25,11 @@ bright4=ac9fff
bright5=ffb1c0
bright6=92ccff
bright7=ffffff
flash=d06600
flash-alpha=1.0
[key-bindings]
spawn-terminal=Mod4+Shift+Return
[search-bindings]
find-prev=Control+n

View File

@ -1,9 +1,10 @@
[main]
layer=overlay
font=monospace:size=13.5
dpi-aware=no
font=monospace:size=13
icons-enabled=no
width=72
width=80
line-height=15
layer=overlay
[colors]
background=000000ff

View File

@ -1,6 +1,7 @@
[Default Applications]
text/plain=vis.desktop;
text/markdown=vis.desktop;
inode/directory=footclient-directory.desktop;
application/pdf=org.pwmt.zathura.desktop;
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;

View File

@ -1,23 +1,23 @@
# set ##########################################################################
# keys
set $mod mod4
set $left h
set $down j
set $up k
set $mod mod4
set $left h
set $down j
set $up k
set $right l
# colors
set $black #000000
set $white #e2e2e2
set $blue #856cff
set $black #000000
set $white #e2e2e2
set $blue #856cff
set $magenta #ff1170
set $red #fa3500
set $orange #d06600
set $green #009843
set $red #fa3500
set $orange #d06600
set $green #009843
# workspaces
set $wsq 0:q:cmd
set $wsq 0:q:bot
set $wsw 1:w:www
set $wse 2:e:txt
set $wsr 3:r:doc
@ -26,46 +26,44 @@ set $wsy 5:y:cmd
set $wsu 6:u:cmd
set $wsi 7:i:cmd
set $wso 8:o:cmd
set $wsp 9:p:rdp
set $wsp 9:p:top
# modes
set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend (h)ibernate re(b)oot (p)oweroff"
set $layout_mode "layout: split(h) split(v) (s)tacking (t)abbed"
set $layout_mode "layout: split(h) split(v) (s)tacking (t)abbed"
set $find_exclude_expr \( -path "$HOME/.cache" -o -path "$HOME/.mozilla" -o -path "$HOME/.thunderbird" -o -name .git \)
# commands
set $swaylock swaylock -f \
--color=$black \
--indicator-radius 1200 \
--inside-color=$blue \
--inside-clear-color=$green \
--inside-caps-lock-color=$orange \
--inside-ver-color=$magenta \
--inside-wrong-color=$red \
--text-color=#00000000 \
--text-clear-color=#00000000 \
--text-ver-color=#00000000 \
--text-wrong-color=#00000000
# strings
set $mounted "Mounted %f at %d"
set $unmounted "Unmounted %s"
--color=$black \
--indicator-radius 1200 \
--inside-color=$blue \
--inside-clear-color=$green \
--inside-caps-lock-color=$orange \
--inside-ver-color=$magenta \
--inside-wrong-color=$red \
--text-color=#00000000 \
--text-clear-color=#00000000 \
--text-ver-color=#00000000 \
--text-wrong-color=#00000000
# bar ##########################################################################
bar {
separator_symbol " | "
status_command status.sh
strip_workspace_numbers yes
wrap_scroll yes
colors {
background $black
statusline $blue
separator $blue
# border background text
focused_workspace $black $black $magenta
active_workspace $black $black $white
inactive_workspace $black $black $blue
urgent_workspace $black $black $red
}
separator_symbol " | "
status_command status.sh
strip_workspace_numbers yes
wrap_scroll yes
colors {
background $black
statusline $blue
separator $blue
# border background text
focused_workspace $black $black $magenta
active_workspace $black $black $white
inactive_workspace $black $black $blue
urgent_workspace $black $black $red
}
}
# workspace_layout #############################################################
@ -80,44 +78,77 @@ bindsym $mod+shift+f floating toggle
# focus
bindsym {
$mod+$up focus up
$mod+$down focus down
$mod+$left focus left
$mod+$right focus right
$mod+a focus parent
$mod+s focus child
$mod+g focus mode_toggle
$mod+$up focus up
$mod+$down focus down
$mod+$left focus left
$mod+$right focus right
$mod+a focus parent
$mod+s focus child
$mod+g focus mode_toggle
}
# fullscreen
bindsym $mod+f fullscreen toggle
# mark
bindsym {
$mod+shift+grave mark --toggle '`'
$mod+shift+1 mark --toggle '1'
$mod+shift+2 mark --toggle '2'
$mod+shift+3 mark --toggle '3'
$mod+shift+4 mark --toggle '4'
$mod+shift+5 mark --toggle '5'
$mod+shift+6 mark --toggle '6'
$mod+shift+7 mark --toggle '7'
$mod+shift+8 mark --toggle '8'
$mod+shift+9 mark --toggle '9'
$mod+shift+0 mark --toggle '0'
$mod+shift+minus mark --toggle '-'
$mod+shift+equal mark --toggle '='
}
bindsym {
$mod++grave [con_mark="`"] focus
$mod++1 [con_mark="1"] focus
$mod++2 [con_mark="2"] focus
$mod++3 [con_mark="3"] focus
$mod++4 [con_mark="4"] focus
$mod++5 [con_mark="5"] focus
$mod++6 [con_mark="6"] focus
$mod++7 [con_mark="7"] focus
$mod++8 [con_mark="8"] focus
$mod++9 [con_mark="9"] focus
$mod++0 [con_mark="0"] focus
$mod++minus [con_mark="-"] focus
$mod++equal [con_mark="="] focus
}
# mode
bindsym {
$mod+d mode $layout_mode, fullscreen disable
$mod+escape mode $session_mode, fullscreen disable
$mod+d mode $layout_mode, fullscreen disable
$mod+escape mode $session_mode, fullscreen disable
}
# move
bindsym --to-code {
$mod+shift+$up move up
$mod+shift+$down move down
$mod+shift+$left move left
$mod+shift+$right move right
$mod+shift+tab move workspace back_and_forth, workspace back_and_forth
$mod+shift+q move workspace $wsq, workspace $wsq
$mod+shift+w move workspace $wsw, workspace $wsw
$mod+shift+e move workspace $wse, workspace $wse
$mod+shift+r move workspace $wsr, workspace $wsr
$mod+shift+t move workspace $wst, workspace $wst
$mod+shift+y move workspace $wsy, workspace $wsy
$mod+shift+u move workspace $wsu, workspace $wsu
$mod+shift+i move workspace $wsi, workspace $wsi
$mod+shift+o move workspace $wso, workspace $wso
$mod+shift+p move workspace $wsp, workspace $wsp
$mod+shift+bracketleft move workspace prev, workspace prev
$mod+shift+$up move up
$mod+shift+$down move down
$mod+shift+$left move left
$mod+shift+$right move right
$mod+shift+tab move workspace back_and_forth, workspace back_and_forth
$mod+shift+q move workspace $wsq, workspace $wsq
$mod+shift+w move workspace $wsw, workspace $wsw
$mod+shift+e move workspace $wse, workspace $wse
$mod+shift+r move workspace $wsr, workspace $wsr
$mod+shift+t move workspace $wst, workspace $wst
$mod+shift+y move workspace $wsy, workspace $wsy
$mod+shift+u move workspace $wsu, workspace $wsu
$mod+shift+i move workspace $wsi, workspace $wsi
$mod+shift+o move workspace $wso, workspace $wso
$mod+shift+p move workspace $wsp, workspace $wsp
$mod+shift+bracketleft move workspace prev, workspace prev
$mod+shift+bracketright move workspace next, workspace next
$mod+colon move scratchpad
$mod+colon move scratchpad
}
# scratchpad
@ -128,53 +159,54 @@ bindsym $mod+shift+g sticky toggle
# exec
bindsym --to-code {
$mod+return exec footclient
$mod+shift+return exec foot
$mod+space exec fuzzel
$mod+slash exec xdg-open "$(find * -type f | fuzzel -dp'open > ')"
$mod+home exec footclient nmtui connect
$mod+shift+home exec footclient nmtui
$mod+end exec devmon -c
$mod+n exec makoctl dismiss
$mod+shift+n exec makoctl restore
print exec grim - | wl-copy
$mod+return exec "$TERMINAL"
$mod+space exec fuzzel
$mod+slash exec find "$HOME" $find_exclude_expr -prune -o -print | fuzzel -dp'open > ' | xargs -r xdg-open
$mod+question exec find "$HOME" $find_exclude_expr -prune -o -type f -print0 | xargs -0r grep -in "$(wl-paste)" 2>/dev/null | awk -F: '{ printf("%8s %-62s\t%-80s\\n","+"$2,"\\""$1"\\"",$3) }' | fuzzel -dw160 -p"open > " | cut -f1 | xargs -r "$TERMINAL" "$EDITOR"
$mod+apostrophe exec swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.nodes==[] and .type=="con" and .focused==false) | (.id|tostring) + "\t" + .name' | fuzzel -dp'focus > ' | cut -f1 | xargs -rI{} swaymsg [con_id={}] focus
$mod+home exec "$TERMINAL" nmtui connect
$mod+shift+home exec "$TERMINAL" nmtui
$mod+end exec devmon -c
$mod+n exec makoctl dismiss
$mod+shift+n exec makoctl restore
print exec grim - | wl-copy
}
# exec (laptop)
bindsym {
XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
XF86MonBrightnessUp exec brightnessctl -n set +1%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86MonBrightnessDown exec brightnessctl -n set 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessUp exec brightnessctl -n set +10%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessDown exec brightnessctl -n set 10%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
XF86MonBrightnessUp exec brightnessctl -n set +1%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86MonBrightnessDown exec brightnessctl -n set 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessUp exec brightnessctl -n set +10%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessDown exec brightnessctl -n set 10%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
}
# resize
bindsym {
$mod+control+$left resize shrink width
$mod+control+$down resize grow height
$mod+control+$up resize shrink height
$mod+control+$right resize grow width
$mod+control+$left resize shrink width
$mod+control+$down resize grow height
$mod+control+$up resize shrink height
$mod+control+$right resize grow width
}
# workspace
bindsym --to-code {
$mod+tab workspace back_and_forth
$mod+q workspace $wsq
$mod+w workspace $wsw
$mod+e workspace $wse
$mod+r workspace $wsr
$mod+t workspace $wst
$mod+y workspace $wsy
$mod+u workspace $wsu
$mod+i workspace $wsi
$mod+o workspace $wso
$mod+p workspace $wsp
$mod+bracketleft workspace prev
$mod+bracketright workspace next
$mod+tab workspace back_and_forth
$mod+q workspace $wsq
$mod+w workspace $wsw
$mod+e workspace $wse
$mod+r workspace $wsr
$mod+t workspace $wst
$mod+y workspace $wsy
$mod+u workspace $wsu
$mod+i workspace $wsi
$mod+o workspace $wso
$mod+p workspace $wsp
$mod+bracketleft workspace prev
$mod+bracketright workspace next
}
# client.* #####################################################################
@ -192,23 +224,23 @@ default_floating_border normal 0
# exec #########################################################################
exec {
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
swayidle -w \
timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \
timeout 600 '$swaylock' \
timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
timeout 1800 'systemctl suspend-then-hibernate' \
before-sleep '$swaylock'
wlsunset -l 45 -L 15
mako --max-visible=0
devmon \
--exec-on-drive 'notify-send "Mounted %f at %d"' \
--exec-on-unmount 'notify-send "Unmounted %f"'
foot -s
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway
swayidle -w \
timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \
timeout 600 '$swaylock' \
timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
timeout 1800 'systemctl suspend-then-hibernate' \
before-sleep '$swaylock'
wlsunset -l 45 -L 15
mako --max-visible=0
devmon --exec-on-drive 'notify-send "Mounted %f at %d"' --exec-on-unmount 'notify-send "Unmounted %f"'
foot -s
wayneko --layer overlay --type inu --background-colour 0xe2e2e2 --outline-colour 0x856cff
}
# focus_wrapping ###############################################################
focus_wrapping yes
@ -219,42 +251,40 @@ font monospace 13
# keyboard
input "type:keyboard" {
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle,compose:ralt
repeat_delay 200
repeat_rate 30
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle,compose:ralt
repeat_delay 200
repeat_rate 30
}
# touchpad
input "type:touchpad" {
tap enabled
}
input "type:touchpad" tap enabled
# mode #########################################################################
# session
mode $session_mode {
bindsym {
r reload, mode default
l exec $swaylock, mode default
q exit, mode default
s exec systemctl suspend, mode default
h exec systemctl hibernate, mode default
b exec systemctl reboot, mode default
p exec systemctl poweroff, mode default
escape mode default
}
bindsym {
r reload, mode default
l exec $swaylock, mode default
q exit, mode default
s exec systemctl suspend, mode default
h exec systemctl hibernate, mode default
b exec systemctl reboot, mode default
p exec systemctl poweroff, mode default
escape mode default
}
}
# layout
mode $layout_mode {
bindsym {
h layout splith, mode default
v layout splitv, mode default
s layout stacking, mode default
t layout tabbed, mode default
escape mode default
}
bindsym {
h layout splith, mode default
v layout splitv, mode default
s layout stacking, mode default
t layout tabbed, mode default
escape mode default
}
}
# seat #########################################################################

View File

@ -23,7 +23,7 @@ lex:add_rule('heading',
-- Blockquote.
lex:add_rule('blockquote',
lex:tag(lexer.COMMENT,
lexer.starts_line(P('> ')^1)))
lexer.starts_line(P('>' + P(' '))^1)))
-- Horizontal rule.
lex:add_rule('hr',
@ -109,8 +109,10 @@ lex:embed(html, html_start_rule, html_end_rule)
-- Embedded YAML.
local yaml = lexer.load('yaml')
local yaml_start_rule = yaml:get_rule('doc_bounds') - B(bl) * P(P('---') + '...') * #bl
local yaml_end_rule = yaml:get_rule('doc_bounds') - B(bl) * P(P('---') + '...') * #bl
local doc_bounds_rule = yaml:get_rule('doc_bounds')
local hr_rule = lex:get_rule('hr')
local yaml_start_rule = doc_bounds_rule - hr_rule
local yaml_end_rule = doc_bounds_rule - hr_rule
lex:embed(yaml, yaml_start_rule, yaml_end_rule)
return lex

View File

@ -25,6 +25,7 @@ end)
-- apply additional cursor styles on WIN_STATUS
vis.events.subscribe(vis.events.WIN_STATUS, function(win)
local pos = win.selection.pos
if not pos then return end
local style_id = win ~= vis.win and
win['STYLE_CURSOR'] or
win['STYLE_CURSOR_'..vis.mode] or
@ -41,7 +42,7 @@ lexers.STYLE_CURSOR_LINE = 'underlined'
lexers.STYLE_COLOR_COLUMN = 'fore:black,back:blue'
lexers.STYLE_SELECTION = 'fore:black,back:white'
lexers.STYLE_STATUS = 'fore:blue'
lexers.STYLE_STATUS_FOCUSED = 'fore:magenta'
lexers.STYLE_STATUS_FOCUSED = 'fore:blue'
lexers.STYLE_SEPARATOR = 'fore:blue'
lexers.STYLE_INFO = 'fore:red'
lexers.STYLE_EOF = 'fore:blue'

View File

@ -12,10 +12,15 @@ local mode_strings = {
local e = vis.events
-- editor options
-- init
e.subscribe(e.INIT, function()
require("themes.basic")
-- load theme
require("themes/basic")
local lexers = vis.lexers
lexers.lexers = {}
if lexers.load and not lexers.property then lexers.load("text") end
-- mappings
vis:map(m.NORMAL, 'y', '<vis-register>+<vis-operator-yank>')
vis:map(m.VISUAL, 'y', '<vis-register>+<vis-operator-yank>')
vis:map(m.NORMAL, 'y', '<vis-register>+<vis-operator-yank>')
@ -29,64 +34,37 @@ e.subscribe(e.INIT, function()
vis:map(m.VISUAL, 'P', '<vis-register>+<vis-put-before>')
vis:map(m.VISUAL_LINE, 'P', '<vis-register>+<vis-put-before>')
vis:map(m.NORMAL, '<C-w>o', function()
local unclosed
for win in vis:windows() do
if win == vis.win then goto continue end
if win:close() then goto continue end
unclosed = win
::continue::
end
if unclosed then
vis.win = unclosed
vis:info('No write since last change')
end
end)
vis:map(m.NORMAL, ' w', function() vis:command('w') end)
vis:map(m.NORMAL, ' q', function() vis:command('q') end)
vis:map(m.NORMAL, ' Q', function() vis:command('q!') end)
vis:map(m.NORMAL, ' e', function()
local _, f = vis:pipe('find -type f | vis-menu -l 5 -p ":e"')
if f == nil then return end
local s, f = vis:pipe('find -type f | vis-menu -l 5 -p "Edit file"')
if s ~= 0 or not f then return end
cmd = ('e "%s"'):format(f:sub(1, -2))
vis:info(cmd)
vis:command(cmd)
end)
end, 'Edit file')
vis:map(m.NORMAL, ' o', function()
local _, f = vis:pipe('find -type f | vis-menu -l 5 -p ":o"')
if file == nil then return end
cmd = ('vsplit "%s"'):format(f:sub(1, -2))
vis:map(m.NORMAL, ' cd', function()
local s, f = vis:pipe('find -type d | vis-menu -l 5 -p "Change directory"')
if s ~= 0 or not f then return end
cmd = ('cd "%s"'):format(f:sub(1, -2))
vis:info(cmd)
vis:command(cmd)
end)
vis:map(m.NORMAL, ' g', function()
local _, w = vis:pipe(
vis.win.file or nil,
vis.win.viewport.bytes,
'grep -Eo "\\w\\w\\w+" | sort | uniq | vis-menu -l 5 -p "grep"')
if w == nil then return end
w = w:sub(1, -2)
local _, f = vis:pipe(('grep -n "%s" ** | tr "\\t" " " | vis-menu -l 5 -p ":o"'):format(w))
if f == nil then return end
local file, lineno, line = f:match("^(.+):(%d+):(.*)$")
if file == nil then return end -- TODO report error
cmd = ('vsplit "%s"'):format(file)
vis:info(cmd)
vis:command(cmd)
vis.win.selection:to(tonumber(lineno), line:find(w))
end)
end, 'Change directory')
-- editor options
vis.options.autoindent = true
end)
-- window options
-- window open
e.subscribe(e.WIN_OPEN, function(win)
win.options.colorcolumn = 81
win.options.relativenumbers = true
win.options.numbers = true
if win.syntax == 'markdown' then
win.options.breakat = " ])}_"
win.options.breakat = " ,]_"
win.options.expandtab = true
win.options.tabwidth = 2
win.options.wrapcolumn = 81
@ -99,59 +77,56 @@ e.subscribe(e.WIN_OPEN, function(win)
end)
-- statusline
function set_statusline(win, mode_string)
e.subscribe(e.WIN_STATUS, function(win)
local left_parts = {}
local right_parts = {}
local file = win.file
local selection = win.selection
local file_info = (file.name or '[No Name]')..(file.modified and '[+]' or '')
-- file info
table.insert(left_parts,
(file.name or '[No Name]')..(file.modified and '[+]' or ''))
-- selection
table.insert(right_parts, selection.number..'/'..#win.selections)
if vis.win == win then
-- mode
table.insert(left_parts, mode_string)
table.insert(left_parts, 1, mode_strings[vis.mode])
-- selection
table.insert(left_parts, selection.number..'/'..#win.selections)
-- syntax
table.insert(left_parts, win.syntax)
-- file info
file_info =
file_info
..':'
-- input info
table.insert(left_parts,
'<'
..(vis.count or '')
..(vis.input_queue or '')
..(vis.recording and '@' or '')
..'>')
-- character under cursor
table.insert(right_parts,
'<'
..(string.byte(file:content(selection.pos, 1)) or '0')
..'>')
-- line and column count
table.insert(right_parts, #file.lines..'/'..selection.line)
table.insert(right_parts, selection.col)
end
table.insert(left_parts, file_info)
-- line and column count
table.insert(right_parts, #file.lines..'/'..selection.line)
table.insert(right_parts, selection.col)
-- fillchars
local left = table.concat(left_parts, " ")
local right = table.concat(right_parts, " ")
local left = table.concat(left_parts, ' ')
local right = table.concat(right_parts, ' ')
win:status(table.concat({ left, ('^'):rep(win.width - #left - #right - 2)}, ' '), right)
end
e.subscribe(e.WIN_STATUS, function(win)
set_statusline(win, mode_strings[vis.mode])
end)
-- title
-- set title
local modified = false
local function set_title(title)
os.execute('printf "\\e];vis: '..title..(modified and '[+]' or '')..'\\e"')
os.execute('printf "\\e];'..title..(modified and '[+]' or '')..'\\e"')
end
e.subscribe(e.WIN_OPEN, function(win)
@ -169,3 +144,21 @@ e.subscribe(e.WIN_STATUS, function(win)
set_title(win.file.name or '[No Name]')
end
end)
-- find root
e.subscribe(e.WIN_OPEN, function(win)
if not win.file.path then return end
local dir = win.file.path
local home = os.getenv('HOME')
if not dir:find(home) then return end
while true do
dir = dir:match('^(.+)/[^/]+$') or home
local _, find = vis:pipe(('find %s ! -path %s -prune -type d -name .git'):format(dir, dir))
if find or dir == home then
local cmd = ('cd "%s"'):format(dir)
vis:info(cmd)
vis:command(cmd)
break
end
end
end)

View File

@ -18,6 +18,7 @@ set notification-warning-fg "#d06600"
set statusbar-bg "#000000"
set statusbar-fg "#856cff"
set font "monospace 13"
set guioptions ""
# zathura
set highlight-active-color rgba(255,17,112,0.5)

View File

@ -0,0 +1,5 @@
[Desktop Entry]
Type=Application
Exec=footclient -D %f
Name=Foot Client Working Directory
MimeType=inode/directory;

View File

@ -0,0 +1,11 @@
[Desktop Entry]
Name=Vis
GenericName=Text Editor
TryExec=vis
Exec=vis %F
Terminal=true
Type=Application
Keywords=Text;editor;
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;

View File

@ -28,9 +28,8 @@ export XDG_CONFIG_DIRS=/etc/xdg
# .bash_history
export HISTFILE="$XDG_STATE_HOME"/bash/history
if [ ! -d "$(dirname "${HISTFILE}")" ]; then
mkdir -p "$(dirname "${HISTFILE}")"
fi
[ ! -d "$(dirname "${HISTFILE}")" ] && mkdir -p "$(dirname "${HISTFILE}")"
[ -f "$HISTFILE" ] && sort -uo $HISTFILE $HISTFILE
# .inputrc
export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
@ -50,14 +49,14 @@ export EDITOR=vi
# desktop
if [ "$(tty)" = "/dev/tty1" ] && command -v sway >/dev/null; then
# locale
export LANG=sl_SI.UTF-8
export LC_MESSAGES=en_US.UTF-8
# defaults
export TERMINAL=footclient
export BROWSER=firefox
# run sway
export XDG_CURRENT_DESKTOP=sway
export WLR_RENDERER=vulkan
exec systemd-cat -t sway sway
# locale
export LANG=sl_SI.UTF-8
export LC_MESSAGES=en_US.UTF-8
# defaults
export TERMINAL=footclient
export BROWSER=firefox
# run sway
export XDG_CURRENT_DESKTOP=sway
export WLR_RENDERER=vulkan
exec systemd-cat -t sway sway
fi

View File

@ -1,8 +1,6 @@
# dot
This repo tracks user and system configuration files, installed packages
and initial command history for setting-up a desktop environment running Debian
testing/unstable with `sway`, `foot`, `fuzzel` and `neovim`.
This repo tracks user and system configuration files, installed packages and initial command history for setting-up a desktop environment running Debian testing/unstable with `sway`, `foot`, `fuzzel` and `vis`.
## bootstrap the dotfiles
@ -33,9 +31,11 @@ sudo apt install git
sudo apt install udevil
sudo apt install jq
sudo apt install tlp
sudo apt install neovim wl-clipboard
sudo apt install vis
sudo apt install rsync
# install desktop packages
sudo apt install sway swayidle swaylock
sudo apt install wl-clipboard
sudo apt install fuzzel
sudo apt install brightnessctl wlsunset grim
sudo apt install mako-notifier libnotify-bin
@ -52,8 +52,6 @@ sudo apt install aspell-sl hunspell-sl hyphen-sl mythes-sl
sudo apt install mpv
sudo apt install zathura
sudo apt install inkscape
sudo apt install blender
sudo apt install scribus
# install rdp packages
sudo apt install remmina
# install printing and scanning packages
@ -68,3 +66,11 @@ sudo apt install pandoc
# install pdf processing packages
#sudo apt install qpdf ocrmypdf
```
## using systemd-nspawn
```
sudo apt install systemd-container debootstrap
sudo debootstrap --include=systemd,dbus,libnss-systemd,sudo testing /var/lib/machines/<machine-name>
machinectl start <machine-name>
```