Fixing merge conflicts - dotfiles - Unnamed repository; edit this file 'description' to name the repository. (DIR) Log (DIR) Files (DIR) Refs (DIR) README --- (DIR) commit 5802638c7f5f6c38cf9b62c8de34e32cd24a6e41 (DIR) parent 40e6e0ceac7b84526d086047c7e3346987463af9 (HTM) Author: Jay Scott <me@jay.scot> Date: Sun, 18 Jun 2023 11:25:04 +0100 Fixing merge conflicts Diffstat: M README | 5 +++++ M ashrc | 3 --- M bin/backup.sh | 57 +++---------------------------- M bin/sway-run.sh | 2 +- A bin/switch_audio.sh | 7 +++++++ M bootstrap.sh | 2 +- M castgetrc | 4 ++++ M foot/foot.ini | 3 +++ D moc/config | 7 ------- D moc/themes/black_orange | 42 ------------------------------- M qutebrowser/config.py | 7 ++----- D qutebrowser/scripts/redirectors.py | 26 -------------------------- A qutebrowser/scripts/redirects.py | 70 +++++++++++++++++++++++++++++++ M sfeed/sfeedrc | 2 ++ M sway/config | 4 ++-- 15 files changed, 102 insertions(+), 139 deletions(-) --- (DIR) diff --git a/README b/README @@ -17,7 +17,12 @@ at all, the closest I come is using IRC. email : mutt / fdm browser : qutebrowser video : mpv +<<<<<<< HEAD music : moc +======= + music : cmus + gaming : scummvm +>>>>>>> 5ecfc9b94f8a19c3bd7230e3d3a25c39b4f277e4 password mgt : pass vpn : mullvad news : sfeed (DIR) diff --git a/ashrc b/ashrc @@ -20,9 +20,6 @@ export PATH=$PATH:$HOME/bin export BROWSER="qutebrowser" export GOPATH="$XDG_DATA_HOME"/go export GOPROXY=direct -export CFLAGS="-O3 -march=native -pipe" -export CXXFLAGS="$CFLAGS" -export MAKEFLAGS=-j12 export PS1="[\[$(tput sgr0)\]\[\033[38;5;7m\]\W\[$(tput sgr0)\]] \\$ \[$(tput sgr0)\]" export BEMENU_OPTS="-p '> ' --tb '#013220' --tf '#ffffff' --hf '#444444'" (DIR) diff --git a/bin/backup.sh b/bin/backup.sh @@ -1,57 +1,10 @@ #!/bin/sh -BORG_PASSPHRASE="$(pass misc/local-backup | head -n1)" -BORG_REPO='/data/backup' +cmd=/usr/bin/rsync +source=/home/jay +dest=/mnt/backup -export BORG_PASSPHRASE -export BORG_REPO -info() { printf "\n%s %s\n\n" "$(date)" "$*" >&2; } - -if pidof -x borg >/dev/null; then - info "Backup already running" - exit -fi - -trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM - -info "Starting backup" - -borg create \ - --verbose \ - --filter AME \ - --list \ - --stats \ - --show-rc \ - --compression lz4 \ - --exclude-caches \ - --exclude '/home/*/.cache/*' \ - --exclude '/home/*/.local/share/Steam/*' \ - ::"linux-$(date +%d-%m-%Y)" \ - /home - -backup_exit=$? - -info "Pruning repository" - -borg prune \ - --list \ - --prefix 'linux-' \ - --show-rc \ - --keep-daily 7 \ - --keep-weekly 4 \ - --keep-monthly 6 - -prune_exit=$? - -global_exit=$((backup_exit > prune_exit ? backup_exit : prune_exit)) - -if [ ${global_exit} -eq 0 ]; then - info "Backup and Prune finished successfully" -elif [ ${global_exit} -eq 1 ]; then - info "Backup and/or Prune finished with warnings" -else - info "Backup and/or Prune finished with errors" +if [ -f /mnt/.backupdrive ]; then + $cmd -avz --log-file=/mnt/usb/backup.log -avz $source $dest fi - -exit ${global_exit} (DIR) diff --git a/bin/sway-run.sh b/bin/sway-run.sh @@ -4,7 +4,7 @@ export _JAVA_AWT_WM_NONREPARENTING=1 export XKB_DEFAULT_OPTIONS=caps:escape export GDK_BACKEND=wayland export XDG_SESSION_TYPE=wayland -export XCURSOR_THEME=Adwaita +#export XCURSOR_THEME=Adwaita export XDG_DESKTOP_DIR="$HOME" export XDG_DOWNLOAD_DIR="$HOME/tmp" export XDG_DOCUMENTS_DIR="$HOME/tmp" (DIR) diff --git a/bin/switch_audio.sh b/bin/switch_audio.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if ! [ "$(pactl get-default-sink)" = "alsa_output.pci-0000_00_1f.3.hdmi-stereo" ]; then + pactl set-default-sink "alsa_output.pci-0000_00_1f.3.hdmi-stereo" +else + pactl set-default-sink "alsa_output.usb-KTMicro_KT_USB_Audio_2020-02-20-0000-0000-0000--00.analog-stereo" +fi (DIR) diff --git a/bootstrap.sh b/bootstrap.sh @@ -4,7 +4,7 @@ DOTFILES=$(pwd) FILES='ashrc castgetrc profile vimrc' ROOT='bin' -CONFIG='fdm foot git lynx moc mutt qutebrowser sfeed senpai sway' +CONFIG='fdm foot git lynx mutt qutebrowser sfeed senpai sway' link() { for f in $FILES; do ln -sfn "$DOTFILES/$f" "$HOME/.$f"; done (DIR) diff --git a/castgetrc b/castgetrc @@ -34,3 +34,7 @@ spool=/home/jay/media/podcasts/ask-noah [2.5-admins] url=https://2.5admins.com/feed/podcast spool=/home/jay/media/podcasts/2.5-admins + +[going-linux] +url=https://goinglinux.com/mp3podcast.xml +spool=/home/jay/media/podcasts/going-linux (DIR) diff --git a/foot/foot.ini b/foot/foot.ini @@ -1,5 +1,8 @@ font=Hack:size=14 +[url] +launch=qutebrowser ${url} + [colors] background=282828 foreground=ebdbb2 (DIR) diff --git a/moc/config b/moc/config @@ -1,7 +0,0 @@ -MusicDir = "/home/jay/media/music" -Sort = FileName -Shuffle = yes -AutoNext = yes -Theme = black_orange -ReadTags = yes -ShowTime = yes (DIR) diff --git a/moc/themes/black_orange b/moc/themes/black_orange @@ -1,42 +0,0 @@ -############################################################################## -# -# here's my theme for the great moc. -# it's black/orange (on xterm it's black/yellow :-) -# -############################################################################## - -background = white black -frame = yellow black -window_title = white black -directory = white black bold -selected_directory = black yellow -playlist = white black -selected_playlist = black yellow -file = white black -selected_file = black yellow -marked_file = yellow black -marked_selected_file = yellow black bold,reverse -info = yellow black -selected_info = yellow black bold -marked_info = yellow black bold -marked_selected_info = yellow black bold,reverse -status = white black -title = yellow black -state = yellow black -current_time = white black bold -time_left = white black bold -total_time = white black bold -time_total_frames = white black -sound_parameters = white black bold -legend = white black -disabled = black black bold -enabled = white black bold -empty_mixer_bar = white black -filled_mixer_bar = black yellow -empty_time_bar = white black -filled_time_bar = white yellow -entry = white black -entry_title = yellow black bold -error = yellow black bold -message = yellow black bold -plist_time = white black (DIR) diff --git a/qutebrowser/config.py b/qutebrowser/config.py @@ -3,12 +3,9 @@ config.load_autoconfig(False) try: from qutebrowser.api import message - # site redirecting - config.source('scripts/redirectors.py') # gruvbox colour theme config.source('scripts/gruvbox.py') - # useragent switching - # config.source('scripts/user_agent.py') + config.source('scripts/redirects.py') except ImportError: pass @@ -45,6 +42,7 @@ c.fonts.default_family = 'Hack' c.hints.uppercase = True c.scrolling.smooth = True c.editor.command = ["foot", "vim '{}'"] +c.auto_save.session = True # ad-block c.content.blocking.enabled = True @@ -59,7 +57,6 @@ c.content.blocking.adblock.lists = [ c.completion.web_history.max_items = 0 # no history c.downloads.remove_finished = 800 # clear dl history c.downloads.location.directory = '~/tmp' -c.auto_save.session = False # dont save session c.url.default_page = DEFAULT_PAGE c.url.start_pages = DEFAULT_PAGE c.content.private_browsing = True # always use private browsing (DIR) diff --git a/qutebrowser/scripts/redirectors.py b/qutebrowser/scripts/redirectors.py @@ -1,26 +0,0 @@ -import operator, re, typing -from urllib.parse import urljoin - -from qutebrowser.api import interceptor, message -from PyQt5.QtCore import QUrl - - -REDIRECT_MAP = { - "reddit.com": operator.methodcaller('setHost', 'old.reddit.com'), - "www.reddit.com": operator.methodcaller('setHost', 'old.reddit.com'), - "twitter.com": operator.methodcaller('setHost', 'nitter.pussthecat.org'), - "www.twitter.com": operator.methodcaller('setHost', 'nitter.pussthecat.org'), -} - -def int_fn(info: interceptor.Request): - if (info.resource_type != interceptor.ResourceType.main_frame or - info.request_url.scheme() in {"data", "blob"}): - return - url = info.request_url - redir = REDIRECT_MAP.get(url.host()) - if redir is not None and redir(url) is not False: - message.info("Redirecting to " + url.toString()) - info.redirect(url) - - -interceptor.register(int_fn) (DIR) diff --git a/qutebrowser/scripts/redirects.py b/qutebrowser/scripts/redirects.py @@ -0,0 +1,70 @@ +from qutebrowser.api import interceptor +from urllib.parse import urljoin +from PyQt5.QtCore import QUrl +import operator + +o = operator.methodcaller +s = 'setHost' +i = interceptor + +def farside(url: QUrl, i) -> bool: + url.setHost('farside.link') + p = url.path().strip('/') + url.setPath(urljoin(i, p)) + return True + +def nitter(url: QUrl) -> bool: + return farside(url, '/nitter/') +def rimgo(url: QUrl) -> bool: + return farside(url, '/rimgo/') +def scribe(url: QUrl) -> bool: + return farside(url, '/scribe/') +def wikiless(url: QUrl) -> bool: + return farside(url, '/wikiless/') +def invid(url: QUrl) -> bool: + return farside(url, '/invidious/') +def reddit(url: QUrl) -> bool: + return farside(url, '/libreddit/') +def bibliogram(url: QUrl) -> bool: + return farside(url, '/bibliogram/') +def simplytranslate(url: QUrl) -> bool: + return farside(url, '/simplytranslate/') +def proxitok(url: QUrl) -> bool: + return farside(url, '/proxitok/') +def querte (url: QUrl) -> bool: + return farside(url, '/querte/') + +map = { + "reddit.com": reddit, + "www.reddit.com": reddit, + "old.reddit.com": reddit, + + "youtu.be": invid, + "youtube.com": invid, + "www.youtube.com": invid, + + "twitter.com": nitter, + "mobile.twitter.com": nitter, + + "imgur.com" : rimgo, + "medium.com" : scribe, + "en.wikipedia.org" : wikiless, + "www.instagram.com": bibliogram, + "translate.google.com" : simplytranslate, + "vm.tiktok.com" : proxitok, + "www.tiktok.com" : proxitok, + "www.quora.com": querte, + + "www.twitch.tv" : o(s, 'm.twitch.tv'), + "tumblr.com" : o(s, 'splashblr.fly.dev'), + "www.npr.org" : o(s, 'text.npr.org'), + } +def f(info: i.Request): + if (info.resource_type != i.ResourceType.main_frame or + info.request_url.scheme() in {"data", "blob"}): + return + url = info.request_url + redir = map.get(url.host()) + if redir is not None and redir(url) is not False: + info.redirect(url) +i.register(f) (DIR) diff --git a/sfeed/sfeedrc b/sfeed/sfeedrc @@ -17,6 +17,7 @@ feeds() { feed 'tvtorrents' 'https://showrss.info/other/all.rss' feed 'linuxtorrents' 'http://feed.rutracker.cc/atom/f/1992.atom' feed 'gamingonlinux' 'https://www.gamingonlinux.com/article_rss.php' + feed 'lwn' 'https://lwn.net/headlines/rss' # apps feed 'qutebrowser' 'https://blog.qutebrowser.org/feeds/all.atom.xml' feed 'rdrview' 'https://github.com/eafer/rdrview/commits/master.atom' @@ -39,4 +40,5 @@ feeds() { feed 'fabiensanglard' 'https://fabiensanglard.net/rss.xml' feed 'pluralistic' 'https://pluralistic.net/feed/' feed 'craphound' 'https://craphound.com/feed' + feed 'lowtechmagazine' 'https://solar.lowtechmagazine.com/feeds/all-en.atom.xml' } (DIR) diff --git a/sway/config b/sway/config @@ -9,13 +9,13 @@ set $up k set $right l # apps -set $term foot -d none -T "" +set $term footclient -d none set $browser qutebrowser set $menu bemenu-run -p '> ' --tb '$colour' --tf '#ffffff' --hf '#444444' set $vol pamixer # autostart -exec wlsunset -l 57.6495 -L 3.318 +exec foot --server exec wl-paste -t text --watch clipman store --no-persist exec /usr/libexec/pipewire-launcher