~chimo/dotfiles

6e6d6869e1434c976ce89ec6bf59552de6f4e6de — chimo 4 months ago 19db1c1
.local/bin: `lxc` -> `incus`
M .config/irssi/config => .config/irssi/config +25 -14
@@ 21,13 21,26 @@ servers = (
    port = "6697";
    use_tls = "yes";
    tls_verify = "yes";
  },
  {
    address = "znc.chromic.org";
    chatnet = "znc_libera";
    password = "chimo/libera:<ZNC_PASS>";
    port = "6697";
    use_tls = "yes";
    tls_verify = "yes";
  },
  {
    address = "znc.chromic.org";
    chatnet = "znc_oftc";
    password = "chimo/oftc:<ZNC_PASS>";
    port = "6697";
    use_tls = "yes";
    tls_verify = "yes";
  }
);

aliases = {
  wc = "WINDOW CLOSE";
  znc = "msg *status";
};
aliases = { wc = "WINDOW CLOSE"; znc = "msg *status"; };

chatnets = {
  twitch = {


@@ 37,6 50,10 @@ chatnets = {
    autosendcmd = "/quote CAP REQ :twitch.tv/membership";
  };

  znc_libera = { nick = "chimo"; type = "IRC"; username = "chimo"; };

  znc_oftc = { nick = "chimo"; type = "IRC"; username = "chimo"; };

  liberachat = {
    type = "IRC";
    max_kicks = "1";


@@ 44,9 61,7 @@ chatnets = {
    max_whois = "1";
  };

  oftc = {
    type = "IRC";
  };
  oftc = { type = "IRC"; };
};

statusbar = {


@@ 179,12 194,8 @@ settings = {
  };
};

hilights = (
  {
    color = "%M";
    nick = "yes";
    text = "chimo";
    word = "yes";
  }
hilights = ( 
  { color = "%M"; nick = "yes"; text = "chimo"; word = "yes"; }
);

logs = { };

M .config/qutebrowser/config.py => .config/qutebrowser/config.py +2 -4
@@ 30,14 30,12 @@ js_whitelist = [
    "*://*.brub.ca/*",
    "*://chromic.org/*",
    "*://*.chromic.org/*",
    "*://github.com/*",
    "*://news.ycombinator.com/*",
    "*://duckduckgo.com/*"
    "*://github.com/*"
]

for site in js_whitelist:
    with config.pattern(site) as p:
        p.content.javascript.enabled = True

config.source('pyconfig/redirectors.py')
# config.source('pyconfig/redirectors.py')


M .local/bin/libs/_main.sh => .local/bin/libs/_main.sh +2 -2
@@ 2,10 2,10 @@

start_container() (
    container_name="${1}"
    state=$(lxc list -c s "${container_name}" --format csv)
    state=$(incus list -c s "${container_name}" --format csv)

    if [ "${state}" = "STOPPED" ]; then
        lxc start "${container_name}"
        incus start "${container_name}"

        # TODO: find a better way to wait for container
        #       while state != AVAILABLE (?)

M .local/bin/libs/aerc.sh => .local/bin/libs/aerc.sh +2 -2
@@ 1,12 1,12 @@
#!/bin/sh -eu

# Launch mail client
lxc exec aerc -- aerc
incus exec aerc -- aerc

# Run this in the background after quitting `aerc`
(
    # Sync IMAP in case there were any changes
    lxc exec mbsync -- sh -c "/etc/periodic/15min/refresh_mail" < /dev/null
    incus exec mbsync -- sh -c "/etc/periodic/15min/refresh_mail" < /dev/null

    # Force swaybar status update
    ~/.config/sway/swaybar/bin/run_block.sh -b mail.sh -c "-1" -p json

M .local/bin/libs/bemoji.sh => .local/bin/libs/bemoji.sh +2 -2
@@ 4,9 4,9 @@ container="bemoji"
command="/root/${container}"

if [ "${#}" -lt 1 ]; then
    lxc exec "${container}" -- "${command}" -n
    incus exec "${container}" -- "${command}" -n
else
    lxc exec "${container}" -- "${command}" "${@}"
    incus exec "${container}" -- "${command}" "${@}"
fi



M .local/bin/libs/chromium.sh => .local/bin/libs/chromium.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/sh -eu

lxc exec chromium -- sh -c 'chromium --no-sandbox --ozone-platform=wayland'
incus exec chromium -- sh -c 'chromium --no-sandbox --ozone-platform=wayland'


M .local/bin/libs/firefox.sh => .local/bin/libs/firefox.sh +1 -1
@@ 2,5 2,5 @@

url="${1}"

lxc exec firefox -- sh -c "firefox-esr ${1}"
incus exec firefox -- sh -c "firefox-esr ${1}"


M .local/bin/libs/grim.sh => .local/bin/libs/grim.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/sh -eu

lxc exec grim -- grim "${@}" screenshots/$(date +'%s_grim.png')
incus exec grim -- grim "${@}" screenshots/$(date +'%s_grim.png')


M .local/bin/libs/hugo.sh => .local/bin/libs/hugo.sh +4 -4
@@ 1,12 1,12 @@
#!/bin/sh

get_state() (
    lxc list name=hugo -c s --format csv
    incus list name=hugo -c s --format csv
)


get_ip_address() (
    lxc list name=hugo -c 4 --format csv | awk '{print $1}'
    incus list name=hugo -c 4 --format csv | awk '{print $1}'
)




@@ 16,7 16,7 @@ wait_until_container_is_running() (
    if [ "${state}" != "RUNNING" ]; then
        printf "Instance not running. Starting now..."

        lxc start hugo
        incus start hugo

        while [ "$(get_state)" != "RUNNING" ];
        do


@@ 52,7 52,7 @@ main() (
    wait_until_container_has_ip_address

    ip_address=$(get_ip_address)
    lxc exec hugo -- hugo "${@}" -s /root/chromic.org/ --bind 0.0.0.0 -b http://"${ip_address}"/
    incus exec hugo -- hugo "${@}" -s /root/chromic.org/ --bind 0.0.0.0 -b http://"${ip_address}"/
)



M .local/bin/libs/imv.sh => .local/bin/libs/imv.sh +5 -5
@@ 3,7 3,7 @@
file="${1}"

if [ -z "${1}" ]; then
    lxc exec imv -- imv
    incus exec imv -- imv
else
    container_name="imv"



@@ 22,15 22,15 @@ else
    remote_path="${remote_prefix}${filepath}"

    # Create remote directory
    lxc exec "${container_name}" -- mkdir -p "${remote_dir}"
    incus exec "${container_name}" -- mkdir -p "${remote_dir}"

    # Copy file over
    lxc file push -q "${filepath}" "${container_name}${remote_path}"
    incus file push -q "${filepath}" "${container_name}${remote_path}"

    # Run
    lxc exec "${container_name}" -- sh -c "imv ${remote_path}"
    incus exec "${container_name}" -- sh -c "imv ${remote_path}"

    # Cleanup
    lxc exec "${container_name}" -- sh -c "rm -fr ${remote_dir}"
    incus exec "${container_name}" -- sh -c "rm -fr ${remote_dir}"
fi


M .local/bin/libs/irssi.sh => .local/bin/libs/irssi.sh +2 -2
@@ 9,13 9,13 @@ case "${profile}" in
        # https://github.com/irssi/irssi/issues/6#issuecomment-1019966535
        # POSIX "process substitution"
        # https://unix.stackexchange.com/a/639752
        lxc exec irssi -- sh -c 'irssi -c twitch --config=/dev/fd/3 3<<-EOF
        incus exec irssi -- sh -c 'irssi -c twitch --config=/dev/fd/3 3<<-EOF
            $(sed '\''s/<PASSWORD>/'"${TWITCH_OAUTH}"'/'\'' .irssi/config)
EOF'

        ;;
    "")
        lxc exec irssi -- irssi "${@}"
        incus exec irssi -- irssi "${@}"
        ;;
esac


M .local/bin/libs/khal.sh => .local/bin/libs/khal.sh +2 -2
@@ 1,8 1,8 @@
#!/bin/sh -eu

if [ "${#}" -eq 0 ]; then
    lxc exec khal -- khal calendar today 7d
    incus exec khal -- khal calendar today 7d
else
    lxc exec khal -- khal "${@}"
    incus exec khal -- khal "${@}"
fi


M .local/bin/libs/mbsync.sh => .local/bin/libs/mbsync.sh +2 -2
@@ 1,9 1,9 @@
#!/bin/sh -eu

if [ "${#}" -lt 1 ]; then
    lxc exec mbsync -- mbsync -c /root/.config/mbsync/mbsyncrc primary
    incus exec mbsync -- mbsync -c /root/.config/mbsync/mbsyncrc primary
else
    lxc exec mbsync -- mbsync "${@}"
    incus exec mbsync -- mbsync "${@}"
fi

~/devel/swaybar/bin/run_block.sh -b 'mail.sh' -c '-1'

M .local/bin/libs/mpv.sh => .local/bin/libs/mpv.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/sh

lxc exec mpv -- mpv "${@}"
incus exec mpv -- mpv "${@}"


M .local/bin/libs/ncmpcpp.sh => .local/bin/libs/ncmpcpp.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/sh

lxc exec ncmpcpp -- ncmpcpp "${@}"
incus exec ncmpcpp -- ncmpcpp "${@}"


M .local/bin/libs/newsboat.sh => .local/bin/libs/newsboat.sh +1 -1
@@ 1,6 1,6 @@
#!/bin/sh -eu

lxc exec newsboat -- sh -c 'newsboat -r -c ~/.config/newsboat/cache.db -C ~/.config/newsboat/config'
incus exec newsboat -- sh -c 'newsboat -r -c ~/.config/newsboat/cache.db -C ~/.config/newsboat/config'

~/.config/sway/swaybar/bin/run_block.sh -b rss.sh -p json -c '-1'& > /dev/null


M .local/bin/libs/nextcloud.sh => .local/bin/libs/nextcloud.sh +1 -1
@@ 3,5 3,5 @@
container_name="nextcloud"

# Run "sync" script
lxc exec "${container_name}" -- /etc/periodic/15min/sync
incus exec "${container_name}" -- /etc/periodic/15min/sync


M .local/bin/libs/pinta.sh => .local/bin/libs/pinta.sh +5 -5
@@ 3,7 3,7 @@
file="${1}"

if [ -z "${1}" ]; then
    lxc exec pinta -- pinta
    incus exec pinta -- pinta
else
    container_name="pinta"



@@ 22,15 22,15 @@ else
    remote_path="${remote_prefix}${filepath}"

    # Create remote directory
    lxc exec "${container_name}" -- mkdir -p "${remote_dir}"
    incus exec "${container_name}" -- mkdir -p "${remote_dir}"

    # Copy file over
    lxc file push -q "${filepath}" "${container_name}${remote_path}"
    incus file push -q "${filepath}" "${container_name}${remote_path}"

    # Run
    lxc exec "${container_name}" -- sh -c "pinta ${remote_path}"
    incus exec "${container_name}" -- sh -c "pinta ${remote_path}"

    # Cleanup
    lxc exec "${container_name}" -- sh -c "rm -fr ${remote_dir}"
    incus exec "${container_name}" -- sh -c "rm -fr ${remote_dir}"
fi


M .local/bin/libs/qutebrowser.sh => .local/bin/libs/qutebrowser.sh +1 -1
@@ 2,5 2,5 @@

url="${1}"

lxc exec qutebrowser -- qutebrowser "${url}" --qt-flag no-sandbox
incus exec qutebrowser -- qutebrowser "${url}" --qt-flag no-sandbox


M .local/bin/libs/rbw.sh => .local/bin/libs/rbw.sh +2 -2
@@ 1,9 1,9 @@
#!/bin/sh -eu

if [ "${#}" -lt 1 ]; then
    lxc exec rbw -- rbw unlock
    incus exec rbw -- rbw unlock
else
    lxc exec rbw -- rbw "${@}"
    incus exec rbw -- rbw "${@}"
fi



M .local/bin/libs/shellcheck.sh => .local/bin/libs/shellcheck.sh +4 -4
@@ 24,18 24,18 @@ main() (
    filedir=$(dirname -- "${filepath}")

    # Create remote directory
    lxc exec "${container_name}" -- mkdir -p "${filedir}"
    incus exec "${container_name}" -- mkdir -p "${filedir}"

    # Copy file over
    lxc file push -q "${filepath}" "${container_name}${filepath}"
    incus file push -q "${filepath}" "${container_name}${filepath}"

    # Lint
    set +e
    lxc exec "${container_name}" -- sh -c "shellcheck -f gcc ${filepath}"
    incus exec "${container_name}" -- sh -c "shellcheck -f gcc ${filepath}"
    set -e

    # Cleanup
    lxc exec "${container_name}" -- sh -c "rm -fr ${filedir}"
    incus exec "${container_name}" -- sh -c "rm -fr ${filedir}"
)



M .local/bin/libs/signal.sh => .local/bin/libs/signal.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/sh

lxc exec signal -- sh -c 'export NODE_ENV=production; exec electron --no-sandbox /usr/lib/signal-desktop/app.asar --ozone-platform=wayland --enable-features=UseOzonePlatform'
incus exec signal -- sh -c 'export NODE_ENV=production; exec electron --no-sandbox /usr/lib/signal-desktop/app.asar --ozone-platform=wayland --enable-features=UseOzonePlatform'


M .local/bin/libs/slurp.sh => .local/bin/libs/slurp.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/sh -eu

lxc exec slurp -- slurp "${@}" < /dev/null
incus exec slurp -- slurp "${@}" < /dev/null


M .local/bin/libs/tut.sh => .local/bin/libs/tut.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/sh

lxc exec tut -- tut "${@}"
incus exec tut -- tut "${@}"


M .local/bin/libs/zathura.sh => .local/bin/libs/zathura.sh +5 -5
@@ 3,7 3,7 @@
file="${1}"

if [ -z "${1}" ]; then
    lxc exec zathura -- zathura
    incus exec zathura -- zathura
else
    container_name="zathura"



@@ 22,15 22,15 @@ else
    remote_path="${remote_prefix}${filepath}"

    # Create remote directory
    lxc exec "${container_name}" -- mkdir -p "${remote_dir}"
    incus exec "${container_name}" -- mkdir -p "${remote_dir}"

    # Copy file over
    lxc file push -q "${filepath}" "${container_name}${remote_path}"
    incus file push -q "${filepath}" "${container_name}${remote_path}"

    # Run
    lxc exec "${container_name}" -- sh -c "zathura ${remote_path}"
    incus exec "${container_name}" -- sh -c "zathura ${remote_path}"

    # Cleanup
    lxc exec "${container_name}" -- sh -c "rm -fr ${remote_dir}"
    incus exec "${container_name}" -- sh -c "rm -fr ${remote_dir}"
fi


M .local/bin/pinta.sh => .local/bin/pinta.sh +1 -1
@@ 1,1 1,1 @@
./libs/pinta.sh
\ No newline at end of file
./libs/_main.sh
\ No newline at end of file

M .profile => .profile +2 -0
@@ 23,6 23,8 @@ alias wl-copy="wl-copy -o"
# vi -> vim
alias vi="vim"

alias uc="update-containers.sh"

export PATH="${PATH}":~/.local/bin
export EDITOR=vim