diff --git a/bin/add-todo b/bin/add-todo index 6a3852d..9372881 100755 --- a/bin/add-todo +++ b/bin/add-todo @@ -1,3 +1,4 @@ #! /bin/bash -echo "- [ ] $@" >> "/home/a8ka/Dev/@A/notes/todo - inbox.md" +content=$(zenity --entry --text "Create a ToDo") +[ ! -z "$content" ] && echo "- [ ] $content" >> "/home/$(whoami)/Dev/@A/notes/todo.md" diff --git a/bin/analyze-new-tracks b/bin/analyze-new-tracks index 8c60bdf..ad172e3 100755 --- a/bin/analyze-new-tracks +++ b/bin/analyze-new-tracks @@ -3,15 +3,17 @@ OLDIFS=$IFS IFS=$'\n' -NOTATION=camelot -INBOX_DIR=~/Volumes/SSD\ 500Gb/Inbox -UNSORTED_DIR=~/Volumes/SSD\ 500Gb/Music/_unsorted +# NOTATION=standard +SOURCE_DIR=~/Music/Picked/ +UNSORTED_DIR=~/Music/Unsorted/ -for TRACK_NAME in $(ls "${INBOX_DIR}"); do - SOURCE="${INBOX_DIR}/${TRACK_NAME}" - KEY=$(keyfinder-cli -n ${NOTATION} "${SOURCE}") - BPM=$(sox "${SOURCE}" -t raw -r 44100 -e float -c 1 - | bpm -m 80 -x 160 | awk '{print int($1+0.5)}') - mv "${SOURCE}" "${UNSORTED_DIR}/${KEY} ${BPM} - ${TRACK_NAME}" +for TRACK_NAME in $(ls "${SOURCE_DIR}"); do + SOURCE="${SOURCE_DIR}/${TRACK_NAME}" + echo "Processing ${TRACK_NAME}" + CAMELOT_KEY=$(keyfinder-cli -n camelot "${SOURCE}") + STANDARD_KEY=$(keyfinder-cli -n standard "${SOURCE}") + BPM=$(sox "${SOURCE}" -t raw -r 44100 -e float -c 1 - | bpm -m 60 -x 120 | awk '{print int($1+0.5)}') + mv "${SOURCE}" "${UNSORTED_DIR}/${CAMELOT_KEY} ${STANDARD_KEY} ${BPM} - ${TRACK_NAME}" done; IFS=$OLDIFS diff --git a/bin/btrfs-undelete b/bin/btrfs-undelete new file mode 100755 index 0000000..ef2d844 --- /dev/null +++ b/bin/btrfs-undelete @@ -0,0 +1,87 @@ +#!/bin/bash +# btrfs-undelete +# Copyright (C) 2013 Jörg Walter +# This program is free software; you can redistribute it and/or modify it under +# the term of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or any later version. + +if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then + echo "Usage: $0 " 1>&2 + echo + echo "This program tries to recover the most recent version of the" + echo "given file or directory (recursively)" + echo + echo " must not be mounted, otherwise this program may appear" + echo "to work but find nothing." + echo + echo " must be specified relative to the filesystem root," + echo "obviously. It may contain * and ? as wildcards, but in that" + echo "case, empty files might be 'recovered'. If is a" + echo "single file name, this program tries to recover the most" + echo "recent non-empty version of the file." + echo + echo " must be a writable directory with enough free space" + echo "to hold the files you're trying to restore." + exit 1 +fi +dev="$1" +file="$2" + +file="${file#/}" +file="${file%/}" +regex="${file//\\/\\\\}" + +# quote regex special characters +regex="${regex//./\.}" +regex="${regex//+/\+}" +regex="${regex//|/\|}" +regex="${regex//(/\(}" +regex="${regex//)/\)}" +regex="${regex//\[/\[}" +regex="${regex//]/\]}" +regex="${regex//\{/\{}" +regex="${regex//\}/\}}" + +# treat shell wildcards specially +regex="${regex//\*/.*}" +regex="${regex//\?/.}" + +# extract number of slashes in order to get correct number of closing parens +slashes="${regex//[^\/]/}" + +# build final regex +regex="^/(|${regex//\//(|/}(|/.*${slashes//?/)}))\$" + +roots="$(mktemp --tmpdir btrfs-undelete.roots.XXXXX)" +out="$(mktemp --tmpdir="$3" -d btrfs-undelete.XXXXX)" +cd $out + +trap "rm $roots" EXIT +trap "rm -r $out &> /dev/null; exit 1" SIGINT + +echo -ne "Searching roots..." +btrfs-find-root -a "$dev" 2>&1 \ + | grep ^Well \ + | sed -r -e 's/Well block ([0-9]+).*/\1/' \ + | sort -rn >$roots || exit 1 +echo + +i=0 +max="$(wc -l <$roots)" + +while read id; do + ((i+=1)) + echo -e "Trying root $id... ($i/$max)" + btrfs restore -t $id --path-regex "$regex" "$dev" . &>/dev/null + if [ "$?" = 0 ]; then + found=$(find . -type f ! -size 0c | wc -l) + if [ $found -gt 0 ]; then + echo "Recovered $found non-empty file(s) into $out" + exit 0 + fi + find . -type f -size 0c -exec echo "Found {} but it's empty" \; -delete + fi +done <$roots +rm -r $out +echo "Didn't find '$file'" +exit 1 diff --git a/bin/build-mp3-collection b/bin/build-mp3-collection new file mode 100755 index 0000000..c116a3d --- /dev/null +++ b/bin/build-mp3-collection @@ -0,0 +1,19 @@ +#!/bin/bash + +SOURCE=~/Music/Collection/ +DEST=~/Music/MP3/ + + +SAVEIFS=${IFS} +IFS=' +' +FILE_LIST=`find "$SOURCE" -type f -iname '*.wav' -o -iname '*.mp3' -o -iname '*.flac'` + +for FILE in ${FILE_LIST}; do + echo $FILE + PREFIX=`echo $FILE | awk -F \. 'OFS="."{ $NF="" }1' | sed 's/.$//'` + echo $PREFIX +done; + # -exec echo {} + # # ffmpeg -i {} -acodec libmp3lame \ + # # $DEST$(readlink -f {} | cut -d"/" -f 5-)/{} \; diff --git a/bin/create_playlist b/bin/create_playlist new file mode 100755 index 0000000..a0684a4 --- /dev/null +++ b/bin/create_playlist @@ -0,0 +1,126 @@ +#! /bin/python3 + +import os +import argparse, sys +import taglib + + +parser = argparse.ArgumentParser() +parser.add_argument("--collection", help="Path to music collection") +parser.add_argument("--title", help="Playlist title") + +parser.add_argument("--genre_contains", action='append', help="Text to match against the GENRE") +parser.add_argument("--genre_not_contains", action='append', help="Text to match against the GENRE") + +parser.add_argument("--comment_contains", action='append', help="Text to match against the COMMENT") +parser.add_argument("--comment_not_contains", action='append', help="Text to match against the COMMENT") + +parser.add_argument("--output", help="Path to the resulting playlist") +args=parser.parse_args() + + +EXTENSIONS = ['.flac', '.mp3'] +COLLECTION_PATH = os.path.expanduser(args.collection) +PLAYLIST_PATH = os.path.expanduser(args.output) + +GENRE_CONTAINS = args.genre_contains or [] +GENRE_NOT_CONTAINS = args.genre_not_contains or [] + +COMMENT_CONTAINS = args.comment_contains or [] +COMMENT_NOT_CONTAINS = args.comment_not_contains or [] +PLAYLIST_TITLE = args.title or "" + + +def get_files(dir): + for root, _, files in os.walk(dir): + for file in files: + for ext in EXTENSIONS: + if file.endswith(ext): + yield os.path.join(root, file) + + +def get_tags(file): + with taglib.File(file) as song: + return song.tags + + +def get_dir_from_filepath(s): + f = os.path.basename(s) + p = s[:-(len(f))-1] + return p + + +def match_genre(tags): + matched_contains = [] + matched_not_contains = [] + + if "GENRE" in tags: + genre = ", ".join(tags["GENRE"]).lower() + + if len(GENRE_CONTAINS): + for s in GENRE_CONTAINS: + matched_contains.append(s.lower() in genre) + + if len(GENRE_NOT_CONTAINS): + for s in GENRE_NOT_CONTAINS: + matched_not_contains.append(s.lower() not in genre) + + return all([ + False if len(GENRE_CONTAINS) and not any(matched_contains) else True, + False if len(GENRE_NOT_CONTAINS) and not any(matched_not_contains) else True + ]) + + return False + + +def match_comment(tags): + matched_contains = [] + matched_not_contains = [] + + if "COMMENT" in tags: + comment = ", ".join(tags["COMMENT"]).lower() + + if len(COMMENT_CONTAINS): + for s in COMMENT_CONTAINS: + matched_contains.append(s.lower() in comment) + + if len(COMMENT_NOT_CONTAINS): + for s in COMMENT_NOT_CONTAINS: + matched_not_contains.append(s.lower() not in comment) + + result = all([ + False if len(COMMENT_CONTAINS) and not any(matched_contains) else True, + False if len(COMMENT_NOT_CONTAINS) and not any(matched_not_contains) else True + ]) + + return result + + return False + + +def main(): + playlist_root = get_dir_from_filepath(PLAYLIST_PATH) + print(playlist_root) + print(f"Creating a playlist: '{PLAYLIST_TITLE}'") + with open(PLAYLIST_PATH, encoding="utf-8", mode='w+') as f: + + f.write(f"#EXTM3U\n\n") + + f.write(f"#PLAYLIST:{PLAYLIST_TITLE}\n") + + for file in get_files(COLLECTION_PATH): + tags = get_tags(file) + matched = [] + + if GENRE_CONTAINS or GENRE_NOT_CONTAINS: + matched.append(match_genre(tags)) + + if COMMENT_CONTAINS or COMMENT_NOT_CONTAINS: + matched.append(match_comment(tags)) + + if all(matched): + file = os.path.relpath(file, playlist_root) + f.write(f"{file}\n") + + +main() diff --git a/bin/dcue b/bin/dcue new file mode 100755 index 0000000..a5c8aa9 Binary files /dev/null and b/bin/dcue differ diff --git a/bin/extract-tracks-to-inbox b/bin/extract-tracks-to-inbox new file mode 100755 index 0000000..31a3396 --- /dev/null +++ b/bin/extract-tracks-to-inbox @@ -0,0 +1,5 @@ +#! /bin/bash + +find -path "./Downloads/*.mp3" -exec mv {} ./Inbox/ \; +find -path "./Downloads/*.flac" -exec mv {} ./Inbox/ \; +find -path "./Downloads/*.wav" -exec mv {} ./Inbox/ \; diff --git a/bin/gpu-stats b/bin/gpu-stats new file mode 100755 index 0000000..460d749 --- /dev/null +++ b/bin/gpu-stats @@ -0,0 +1,9 @@ +#!/bin/bash + +STATS=$(nvidia-smi -q) + +G_UTILIZATION=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits) +G_TEMP=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits) + +echo "$G_POWER" + diff --git a/bin/open-link b/bin/open-link index a6a2261..c0e15eb 100755 --- a/bin/open-link +++ b/bin/open-link @@ -21,7 +21,7 @@ for KEYWORD in "${IGNORE_READER_MODE[@]}"; do done if [[ ${MODE} == "reader" ]]; then - firefox "about:reader?url=${URL}" + firefox --kiosk "about:reader?url=${URL}" else - firefox "${URL}" + firefox --kiosk "${URL}" fi; diff --git a/bin/pacman-helper b/bin/pacman-helper new file mode 100755 index 0000000..a14df7e --- /dev/null +++ b/bin/pacman-helper @@ -0,0 +1,31 @@ +#!/bin/bash +set -e + +bold=$(tput bold) +normal=$(tput sgr0) + +print_help() { + echo "${bold}Pacman helper${normal}" + echo "Set of pacman helper scripts to manage an arch linux system." + echo "" + echo " pacman-helper ${bold}new-deps${normal} " + echo " Prints new dependencies to be installed along with a given package" + echo "" + echo " pacman-helper ${bold}update-dates${normal} " + echo " Prints dates when a given package has been installed or updated" + echo "" +} + +if [ "$1" = "new-deps" ]; then + comm -12 <(pactree -srl $2 | sort) <(pacman -Qq | sort) + exit 0 +fi + +if [ "$1" = "update-dates" ]; then + grep "\(upgraded\|installed\) $2 " /var/log/pacman.log + exit 0 +fi + +print_help; +exit 1; + diff --git a/bin/pick-track b/bin/pick-track new file mode 100755 index 0000000..177e24c --- /dev/null +++ b/bin/pick-track @@ -0,0 +1,13 @@ +#!/bin/bash + +export IFS=' +' + +PICKED_CONTAINER=/Picked/$(date '+%Y-%m')/ +MUSIC_DIR=~/Music/ +PICKED_DIR=$(zenity --width=600 --height=450 --list --column Directory $(ls ${MUSIC_DIR})) + +DEST=${MUSIC_DIR}${PICKED_DIR}${PICKED_CONTAINER} + +mkdir -p "${DEST}" +mv "$1" "${DEST}" diff --git a/bin/playerctl-pick-current-track b/bin/playerctl-pick-current-track new file mode 100755 index 0000000..e7df13d --- /dev/null +++ b/bin/playerctl-pick-current-track @@ -0,0 +1,47 @@ +#!/bin/python + +import re +import dbus +import os + +def dbus_to_python(data): + ''' + convert dbus data types to python native data types + ''' + if isinstance(data, dbus.String): + data = str(data) + elif isinstance(data, dbus.Boolean): + data = bool(data) + elif isinstance(data, dbus.Int64): + data = int(data) + elif isinstance(data, dbus.Double): + data = float(data) + elif isinstance(data, dbus.Array): + data = [dbus_to_python(value) for value in data] + elif isinstance(data, dbus.Dictionary): + new_data = dict() + for key in data.keys(): + new_data[dbus_to_python(key)] = dbus_to_python(data[key]) + data = new_data + return data + + +bus = dbus.SessionBus() + +for service in bus.list_names(): + if service.startswith('org.mpris.MediaPlayer2.'): + player = dbus.SessionBus().get_object(service, '/org/mpris/MediaPlayer2') + + status=player.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') + + metadata = player.Get('org.mpris.MediaPlayer2.Player', 'Metadata', dbus_interface='org.freedesktop.DBus.Properties') + metadata = dbus_to_python(metadata) + + trackid = str(metadata["mpris:trackid"]) + + if "DeaDBeeF" in trackid: + file_url = metadata["xesam:url"] + file = re.sub(r"file:\/\/", "", file_url) + if os.path.isfile(file): + print(file) + os.system(f"~/.bin/pick-track '{file}'") diff --git a/bin/playerctl-remove-file b/bin/playerctl-remove-file new file mode 100755 index 0000000..0314c8d --- /dev/null +++ b/bin/playerctl-remove-file @@ -0,0 +1,49 @@ +#!/bin/python + +import re +import dbus +import os + +def dbus_to_python(data): + ''' + convert dbus data types to python native data types + ''' + if isinstance(data, dbus.String): + data = str(data) + elif isinstance(data, dbus.Boolean): + data = bool(data) + elif isinstance(data, dbus.Int64): + data = int(data) + elif isinstance(data, dbus.Double): + data = float(data) + elif isinstance(data, dbus.Array): + data = [dbus_to_python(value) for value in data] + elif isinstance(data, dbus.Dictionary): + new_data = dict() + for key in data.keys(): + new_data[dbus_to_python(key)] = dbus_to_python(data[key]) + data = new_data + return data + + +bus = dbus.SessionBus() + +for service in bus.list_names(): + if service.startswith('org.mpris.MediaPlayer2.'): + player = dbus.SessionBus().get_object(service, '/org/mpris/MediaPlayer2') + + status=player.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') + print(status) + + metadata = player.Get('org.mpris.MediaPlayer2.Player', 'Metadata', dbus_interface='org.freedesktop.DBus.Properties') + metadata = dbus_to_python(metadata) + print(metadata) + + trackid = str(metadata["mpris:trackid"]) + + if "DeaDBeeF" in trackid: + file_url = metadata["xesam:url"] + file = re.sub(r"file:\/\/", "", file_url) + if os.path.isfile(file): + os.remove(file) + os.system("playerctl next") diff --git a/bin/process-tracks b/bin/process-tracks new file mode 100755 index 0000000..e407e4f --- /dev/null +++ b/bin/process-tracks @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +import argparse, sys +import keyfinder +import glob +import subprocess + +# +# print(f"Args: {args}\nCommand Line: {sys.argv}\nfoo: {args.bpm_range}") +# print(f"Dict format: {vars(args)}") + +EXTENSIONS = ['flac', 'mp3'] + +def parse_args(): + parser=argparse.ArgumentParser() + parser.add_argument('source', help="Source directory") + parser.add_argument("--min-bpm", help="Min BPM value", type=int, default=80) + parser.add_argument("--max-bpm", help="Max BPM value", type=int, default=160) + parser.add_argument("--out", help="Directory to copy/move processed files into", required=True) + + return parser.parse_args() + +def get_files(dir, exts): + files = [] + for ext in exts: + mask = f"{dir}/**.{ext}" + print(mask) + files.extend(glob.glob(mask)) + return files + +def get_bpm(file): + output = subprocess.check_output(f'sox "{file}" -t raw -r 44100 -e float -c 1 - | bpm -m 80 -x 160 |' + 'awk "{print int($1+0.5)}"', shell=True) + print(output) + + +def main(): + args = parse_args() + files = get_files(args.source, EXTENSIONS) + for file in files: + key = keyfinder.key(file) + bpm = get_bpm(file) + print(file, key, key.camelot()) + +main() diff --git a/bin/split-tracks b/bin/split-tracks new file mode 100755 index 0000000..6d6c3d8 --- /dev/null +++ b/bin/split-tracks @@ -0,0 +1,25 @@ +#!/bin/bash +# +set -e +OUTPUT_FORMAT="%02n.%t" +TEMPTRACK="_track" + +# Rename a bunch of files. +# +# Standard input: New filenames (one filename per line) +# Arguments ($1..$N): Files to rename. +rename_from_file() { + paste <(for FILE in "$@"; do echo "$FILE"; done) - | \ + tr '\n' '\t' | xargs -rt -d"\t" -n2 mv +} + +# Main +[ $# -ge 1 ] || { echo "Usage: $(basename $0) APE|FLAC|WAV [CUE]"; exit 1; } +AUDIOFILE=$1 +CUEFILE=$2 +[ "$CUEFILE" ] || CUEFILE=${AUDIOFILE%.*}.cue +[ -e "$CUEFILE" ] || { echo "CUE file not found: $CUEFILE"; exit 1; } +# cuefix "$CUEFILE" +cuebreakpoints "$CUEFILE" | shnsplit -O always -a $TEMPTRACK -o flac "$AUDIOFILE" +cuetag.sh "$CUEFILE" $TEMPTRACK*.flac +cueprint -t "$OUTPUT_FORMAT.flac\n" "$CUEFILE" | rename_from_file $TEMPTRACK*.flac diff --git a/bin/split-tracks-recursive b/bin/split-tracks-recursive new file mode 100755 index 0000000..3c409fd --- /dev/null +++ b/bin/split-tracks-recursive @@ -0,0 +1,38 @@ +#!/bin/bash + +WORKING_DIR=$PWD +DIRS=$(find -mindepth 1 -maxdepth 1 -type d) + +IFS=$'\n' +for DIR in ${DIRS}; do + cd "${WORKING_DIR}" + cd "${DIR}" + + FILES=$(find -type f -name "*.flac" -o -name "*.ape") + CUEFILES=$(find -type f -name "*.cue") + + ls . + + read -p "Process ${DIR}?" -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]] + then + for FILE in ${FILES}; do + echo "Select CUE for ${FILE}" + select CUEFILE in ${CUEFILES}; do + break + done + echo "FILE:$FILE" + echo "CUE:$CUEFILE" + + if test -f "${CUEFILE}"; then + read -p "Proceed? " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]] + then + split-tracks $FILE $CUEFILE + fi + fi + done; + fi +done; diff --git a/bin/sync-music b/bin/sync-music new file mode 100755 index 0000000..37a9539 --- /dev/null +++ b/bin/sync-music @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e + + +SOURCE=~/Music/ +TARGET=/run/media/anton/7944-F2AC/ + + +# Playlist builders (see: ~/.bin/create_playlist). I've been frustrated, that nice looking players +# doesn't support smart playlists in 2023, so I thought I can build them manually it on the sync step +# +# TODO: Move into yaml config +create_playlist \ + --collection=${SOURCE}\ + --genre_contains="Punk"\ + --output="${SOURCE}/Playlists/All Punk.m3u"\ + --title="All Punk" 2>&1 \ + | grep -v TagLib + +create_playlist \ + --collection=~/Music\ + --genre_contains="Instrumental Hip-Hop"\ + --comment_contains="inbox"\ + --output="${SOURCE}/Playlists/Chill Hop (Inbox).m3u"\ + --title="Inbox Instrumental Hip-Hop" 2>&1 \ + | grep -v TagLib + +create_playlist \ + --collection=~/Music\ + --genre_contains="Instrumental Hip-Hop"\ + --comment_not_contains="inbox"\ + --output="${SOURCE}/Playlists/Chill Hop (Selected).m3u"\ + --title="Picked Instrumental Hip-Hop" 2>&1 \ + | grep -v TagLib + +create_playlist \ + --collection=~/Music\ + --genre_contains="Soundtrack"\ + --genre_contains="Orchestral"\ + --output="~/Music/Playlists/Orchestral Soundtracks.m4u"\ + --title="Orchestral Soundtracks" 2>&1 \ + | grep -v TagLib + +# Sync folder. Modify window handles fat32 limitations, exclude here to keep podcasts position pointers + +cd "${TARGET}" +echo ${PWD} +rsync -auvP --delete --modify-window=1 --exclude=position.sabp.dat ${SOURCE} ./Music/ diff --git a/bin/wofi-files b/bin/wofi-files new file mode 100755 index 0000000..8b9d2db --- /dev/null +++ b/bin/wofi-files @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import subprocess + +if __name__ == '__main__': + + files = subprocess.run(['fd', '-i', '-E "/home/anton/Dev/*"'], encoding='utf-8', + capture_output=True).stdout.split('\n') + + title = 'wofi-files' + rofi_command = 'wofi -dmenu -i -p {}'.format(title) + rofi_input = '\n'.join(file for file in files) + cp = subprocess.run(rofi_command.split(), input=rofi_input, + encoding='utf-8', capture_output=True) + + if cp.returncode == 0: + file = cp.stdout.strip() + xdg_command = ['xdg-open', file] + subprocess.run(xdg_command, + encoding='utf-8', capture_output=True) diff --git a/bin/wofi-hyprland-hidden b/bin/wofi-hyprland-hidden new file mode 100755 index 0000000..7c528db --- /dev/null +++ b/bin/wofi-hyprland-hidden @@ -0,0 +1,10 @@ +#!/bin/bash + +WINDOWS=$(hyprctl clients -j | jq -r '.[] | select(.workspace.name == "hidden") | "\(.pid) \(.class)"') + +selection=$(echo "$WINDOWS" | wofi -p "Hidden Windows" --show dmenu) + +CURRENT_WORKSPACE=$(hyprctl activewindow | grep "workspace: " | cut -d' ' -f2) +PID=$(echo $selection | cut -d' ' -f1) + +hyprctl dispatch movetoworkspace $CURRENT_WORKSPACE,pid:$PID diff --git a/configs/hypr/bin/sleep.sh b/configs/hypr/bin/sleep.sh new file mode 100755 index 0000000..825280d --- /dev/null +++ b/configs/hypr/bin/sleep.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Run swaylock if it's not already running +if pgrep -x "swaylock" > /dev/null +then + echo "Skip locking, swaylock is already running" >> ~/.tmp/logs/sleep.log +else + echo "Start swaylock" >> ~/.tmp/logs/sleep.log + swaylock --grace=0 --fade-in=0 -fF +fi + +systemctl suspend diff --git a/configs/hypr/bin/start-hyprland b/configs/hypr/bin/start-hyprland new file mode 100755 index 0000000..978d88d --- /dev/null +++ b/configs/hypr/bin/start-hyprland @@ -0,0 +1,13 @@ +#!/bin/bash + +cd ~ + +export _JAVA_AWT_WM_NOREPARENTING=1 +export XDG_SESSION_TYPE=wayland +export XDG_CURRENT_DESKTOP=Hyprland +export XDG_SESSION_DESKTOP=Hyprland +export __GLX_VENDOR_LIBRARY_NAME=nvidia +export GBM_BACKEND=nvidia-drm + + +exec Hyprland diff --git a/configs/hypr/bin/uair-stats.sh b/configs/hypr/bin/uair-stats.sh index 50b55c1..96d63d3 100755 --- a/configs/hypr/bin/uair-stats.sh +++ b/configs/hypr/bin/uair-stats.sh @@ -1,8 +1,12 @@ #! /bin/bash STATS_FILE=~/.tmp/pomodoro.log -F=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep F | wc -l` -R=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep R | wc -l` -P=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep P | wc -l` +PROJECTS=$(cat ~/.config/uair/uair.toml | perl -n -e'/id = \"(.*)\"/ && print "$1\n"') -echo "F:${F} R:${R} P:${P}" +RESULT="" +for PROJECT in $PROJECTS; do + PROJECT_NUMBER=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep "@${PROJECT}" | wc -l` + RESULT="${RESULT} ${PROJECT}:${PROJECT_NUMBER}" +done; + +echo ${RESULT} diff --git a/configs/hypr/bin/uair.sh b/configs/hypr/bin/uair.sh index 1e6c309..9625548 100755 --- a/configs/hypr/bin/uair.sh +++ b/configs/hypr/bin/uair.sh @@ -1,2 +1,6 @@ #! /bin/bash -while true; do uair; done + +while true; do + uair; + sleep 2; +done diff --git a/configs/hypr/bin/wallpapers.py b/configs/hypr/bin/wallpapers.py index 3b0c6c5..0f82408 100755 --- a/configs/hypr/bin/wallpapers.py +++ b/configs/hypr/bin/wallpapers.py @@ -4,6 +4,7 @@ # - hyprctl # - jq +import sys import os import logging import subprocess @@ -58,7 +59,13 @@ def set_wallpapers(): def main(): logging.info('Started') + if 'next' in sys.argv: + logging.info('Setting random wallpapers') + set_wallpapers() + return + while True: + logging.info('Start daemon') set_wallpapers() time.sleep(INTERVAL) diff --git a/configs/hypr/bin/waybar-wf-recorder.sh b/configs/hypr/bin/waybar-wf-recorder.sh new file mode 100755 index 0000000..d89bc8c --- /dev/null +++ b/configs/hypr/bin/waybar-wf-recorder.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +SIGNAL=1 +pid_file="/tmp/waybar-screenrecorder" +wf_recorder_opts="--audio" +video_extension="mp4" + +get_status() { + if [ -e "$pid_file" ]; then + awk 'BEGIN{printf "{\"text\":\"\", \"tooltip\":\"Recording\\n"} + NR==1{printf "PID: %s\\n", $0} + NR==2{printf "Save to: %s\\n", $0} + NR==3{printf "Log to: %s\"}\n", $0}' "$pid_file" + else + printf '{"text":"", "tooltip":"Stopped"}\n' + fi +} + +toggle_recording() { + if [ $# -eq 0 ]; then + printf "ERROR: Argument not provided\n" + exit 1 + fi + + if [ -e "$pid_file" ]; then + pid=$(awk 'NR==1' "$pid_file") + kill "$pid" + wait "$pid" 2>/dev/null # Warten, bis der Prozess beendet ist + rm "$pid_file" + else + start_recording "$1" + fi + pkill -RTMIN+$SIGNAL -x waybar +} + +start_recording() { + mkdir -p "$HOME/Video/Screencasts" + base_file="$HOME/Video/Screencasts/$(date +'%Y%m%dT%H%M%S')" + video_file="$base_file.$video_extension" + log_file="$base_file.log" + + if [ "$1" == "fullscreen" ]; then + wf-recorder $wf_recorder_opts --file "$video_file" 1>"$log_file" 2>&1 & + elif [ "$1" == "region" ]; then + sleep 1 + wf-recorder $wf_recorder_opts --geometry "$(slurp)" --file "$video_file" 1>"$log_file" 2>&1 & + else + printf "Argument \$1='%s' not valid (fullscreen/region)\n" "$1" + exit + fi + + pid=$(jobs -p | tail -n 1) + printf "%d\n%s\n%s" "$pid" "$video_file" "$log_file" > "$pid_file" + disown "$pid" +} + +case "$1" in + "status") + get_status + ;; + "toggle") + toggle_recording "$2" + ;; + *) + printf "ERROR: Argument %s not valid\n" "$1" + ;; +esac + + +#~ # Erstelle einen Dateinamen mit dem aktuellen Datum und Uhrzeit +#~ current_datetime=$(date +"%Y-%m-%d_%H%M%S") +#~ output_file="$HOME/Medien/Screencasts/${current_datetime}.mp4" + + #~ # Führe wf-recorder mit den angegebenen Parametern aus + #~ wf-recorder -a --file="$output_file" diff --git a/configs/hypr/bin/xdg-portal.sh b/configs/hypr/bin/xdg-portal.sh new file mode 100755 index 0000000..6b863c9 --- /dev/null +++ b/configs/hypr/bin/xdg-portal.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +sleep 1 +killall -e xdg-desktop-portal-hyprland +killall -e xdg-desktop-portal-wlr +killall xdg-desktop-portal +/usr/lib/xdg-desktop-portal-hyprland & +sleep 2 +/usr/lib/xdg-desktop-portal & diff --git a/configs/hypr/config.d/00-env.conf b/configs/hypr/config.d/00-env.conf index ac1c7fc..3bd635d 100644 --- a/configs/hypr/config.d/00-env.conf +++ b/configs/hypr/config.d/00-env.conf @@ -1,5 +1,27 @@ env = XDG_SESSION_TYPE,wayland env = WLR_NO_HARDWARE_CURSORS,1 -env = XCURSOR_SIZE,48 +env = XDG_CURRENT_DESKTOP,Hyprland +env = XCURSOR_SIZE,24 +env = ELECTRON_ARGS="--enable-features=UseOzonePlatform --ozone-platform=wayland" +env = WLR_USE_LIBINPUT,1 +env = XDG_SESSION_TYPE,wayland +env = XDG_SESSION_DESKTOP,Hyprland +env = WLR_EGL_NO_MODIFIERS,0 +env = QT_QPA_PLATFORM,wayland # "wayland;xcb" +env = QT_QPA_PLATFORMTHEME,qt5ct +env = GDK_BACKEND,wayland,x11 +env = SDL_VIDEODRIVER,wayland +env = CLUTTER_BACKEND,wayland +env = WLR_RENDERER_ALLOW_SOFTWARE,1 +env = MOZ_ENABLE_WAYLAND,1 +env = MOZ_DISABLE_RDD_SANDBOX,1 +env = MOZ_DBUS_REMOTE,1 +env = __GL_MaxFramesAllowed,1 +env = PROTON_ENABLE_NGX_UPDATER,1 + +xwayland { + force_zero_scaling = true +} -#env XCURSOR_SIZE,32 +env = GDK_SCALE,1 +env = GDK_DPI_SCALE,1 diff --git a/configs/hypr/config.d/00-nvidia-env.conf b/configs/hypr/config.d/00-nvidia-env.conf index 41e53a8..bcd048b 100644 --- a/configs/hypr/config.d/00-nvidia-env.conf +++ b/configs/hypr/config.d/00-nvidia-env.conf @@ -1,10 +1,25 @@ -# env = LIBVA_DRIVER_NAME,nvidia -# env = GBM_BACKEND,nvidia -# env = __GLX_VENDOR_LIBRARY_NAME,nvidia +# Links: +# +# https://wiki.hyprland.org/Configuring/Environment-variables/ +# https://github.com/swaywm/wlroots/blob/master/docs/env_vars.md +# https://www.reddit.com/r/hyprland/comments/17j12jz/finally_got_xwayland_on_nvidia_working_perfectly/ +# https://www.reddit.com/r/hyprland/comments/17tbp2a/external_monitor_on_laptop_screen_is_laggy/ +# https://github.com/Gl00ria/dotfiles/blob/main/dot_hyprland/.config/hypr/source/06_decoration.conf -#env = WLR_DRM_NO_ATOMIC,1 -#env = WLR_RENDERER,vulkan +# env = LIBVA_DRIVER_NAME,nvidia -#env = __GL_GSYNC_ALLOWED,0 -#env = __GL_VRR_ALLOWED,0 +# (https://wiki.archlinux.org/title/Wayland#Requirements) +# WARN: crashes me hyprland +# env = GBM_BACKEND,nvidia +# To force GBM as a backend +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +env = __GL_SYNC_TO_VBLANK,1 +env = WLR_DRM_NO_ATOMIC,1 +#env = WLR_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0 +#env = __VK_LAYER_NV_optimus,NVIDIA_only +env = NVD_BACKEND,direct +# env = MANGOHUD,1 +# env = MANGOHUD_DLSYM,1 +# env = LIBSEAT_BACKEND,logind +# env = QT_SELECTION=/usr/bin/qmake diff --git a/configs/hypr/config.d/10-autostart.conf b/configs/hypr/config.d/10-autostart.conf index fc80f44..bc26f61 100644 --- a/configs/hypr/config.d/10-autostart.conf +++ b/configs/hypr/config.d/10-autostart.conf @@ -1,10 +1,12 @@ -exec-once = waybar --config ~/.config/waybar/top.config --style ~/.config/waybar/top.style.css & -exec-once = waybar --config ~/.config/waybar/bottom.config --style ~/.config/waybar/bottom.style.css & +exec-once = zsh -c "waybar --config ~/.config/waybar/top.config --style ~/.config/waybar/top.style.css" +exec-once = zsh -c "waybar --config ~/.config/waybar/bottom.config --style ~/.config/waybar/bottom.style.css" + exec-once = swaync & exec-once = blueman-applet & exec-once = nm-applet --indicator & -exec-once = udiskie -an --tray -f dolphin & +exec-once = udiskie -an --tray -f thunar & exec-once = pasystray & -exec-once = albert & exec-once = ~/.config/hypr/bin/wallpapers.py > ~/.tmp/logs/wallpapers.py.log exec-once = ~/.config/hypr/bin/uair.sh +exec-once = avizo-service +exec-once = ~/.config/hypr/bin/xdg-portal.sh diff --git a/configs/hypr/config.d/10-display.conf b/configs/hypr/config.d/10-display.conf index d688664..87754f7 100644 --- a/configs/hypr/config.d/10-display.conf +++ b/configs/hypr/config.d/10-display.conf @@ -1,13 +1,29 @@ # See https://wiki.hyprland.org/Configuring/Monitors/ -monitor=eDP-1, 2560x1600@165.019Hz, 200x1728, 1.25 -monitor=HDMI-A-2, 3840x2160@60.000Hz, 0x0, 1.25 +monitor=eDP-1, 2560x1600@60Hz, 200x1440, 1.25 +monitor=eDP-2, 2560x1600@60Hz, 200x1440, 1.25 +# monitor=eDP-1, 2560x1600@165.019Hz, 200x1440, 1.25 +# monitor=eDP-2, 2560x1600@165.019Hz, 200x1440, 1.25 + +monitor=HDMI-A-1, 3840x2160@60.000Hz, 0x0, 1.5 +monitor=HDMI-A-2, 3840x2160@60.000Hz, 0x0, 2.5 +# monitor=DP-6, 3841x2160@60.000Hz, 0x0, 1.5 +# +# monitor=HDMI-A-2,disable +monitor=DP-2, 3440x1440@100.00Hz, 0x0, 1 +# monitor=DP-2, 3840x2160@60.000Hz, 0x0, 1.5 + + +# monitor=DP-5, 3440x1440@59.973, 0x720, 1 + +# monitor=HDMI-A-2, 3840x2160@60.000Hz, 0x0, 1.25 # monitor=eDP-2, 2560x1600@165.019Hz, 200x1728, 1.25 # monitor=HDMI-A-1, 3840x2160@60.000Hz, 0x0, 1.25 +# monitor=DP-6, 3840x2160@60.000Hz, 0x0, 1.25 exec-once = hyprpaper & -exec-once = hyprctl hyprpaper wallpaper "eDP-1,~/Pictures/Wallpapers/dune-2.jpg" -exec-once = hyprctl hyprpaper wallpaper "HDMI-A-2,~/Pictures/Wallpapers/dune-2.jpg" +# exec-once = hyprctl hyprpaper wallpaper "eDP-1,~/Pictures/Wallpapers/dune-2.jpg" +# exec-once = hyprctl hyprpaper wallpaper "HDMI-A-2,~/Pictures/Wallpapers/dune-2.jpg" # exec = hyprctl hyprpaper wallpaper "eDP-2,~/Pictures/Wallpapers/after_all_desktop.jpg" # exec = hyprctl hyprpaper wallpaper "HDMI-A-1,~/Pictures/Wallpapers/after_all_desktop.jpg" diff --git a/configs/hypr/config.d/10-sleep.conf b/configs/hypr/config.d/10-sleep.conf new file mode 100644 index 0000000..318c9c8 --- /dev/null +++ b/configs/hypr/config.d/10-sleep.conf @@ -0,0 +1 @@ +bindl=,switch:on:Lid Switch,exec, ~/.config/hypr/bin/sleep.sh diff --git a/configs/hypr/config.d/20-key-bindings.conf b/configs/hypr/config.d/20-key-bindings.conf index e7ec9c2..eccab33 100644 --- a/configs/hypr/config.d/20-key-bindings.conf +++ b/configs/hypr/config.d/20-key-bindings.conf @@ -10,11 +10,16 @@ $term = 'kitty' bind = $mainMod, return, exec, $term bind = $mainMod, Q, killactive, bind = $mainMod, DELETE, exit, -bind = $mainMod, E, exec, dolphin +bind = $mainMod, l, exec, swaylock -f; # hyprctl dispatch dpms off +bind = $mainMod, E, exec, thunar bind = $mainMod, V, togglefloating, bind = $mainMod, P, pin, # All Screens -bind = $mainMod, D, exec, rofi -terminal 'kitty' -show combi -combi-modes drun +bind = $mainMod, D, exec, wofi --conf ~/.config/wofi/config +bind = $mainMod, K, exec, ~/.bin/wofi-files --conf ~/.config/wofi/config +bind = $mainMod, equal, exec, wofi-calc --conf ~/.config/wofi/config +bind = $mainMod, h, exec, ~/.bin/wofi-hyprland-hidden --conf ~/.config/wofi/config +bind = $mainModShift, return, exec, ~/.bin/add-todo bind = $mainMod, F, fullscreen bind = $mainMod, R, togglesplit @@ -30,16 +35,20 @@ bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d -bind = $mainModCtrl, right, resizeactive, 10 0 -bind = $mainModCtrl, left, resizeactive, -10 0 -bind = $mainModCtrl, up, resizeactive, 0 -10 -bind = $mainModCtrl, down, resizeactive, 0 10 +bind = $mainModCtrl, right, resizeactive, 40 0 +bind = $mainModCtrl, left, resizeactive, -40 0 +bind = $mainModCtrl, up, resizeactive, 0 -40 +bind = $mainModCtrl, down, resizeactive, 0 40 bind = $mainModShift, right, movewindow, r bind = $mainModShift, left, movewindow, l bind = $mainModShift, up, movewindow, u bind = $mainModShift, down, movewindow, d +# Scratchpad +# +bind=SUPER_SHIFT,grave,movetoworkspace,special +bind=SUPER,grave,togglespecialworkspace, # Switch workspaces with mainMod + [0-9] bind = $mainMod,1, moveworkspacetomonitor, 1 current @@ -83,6 +92,7 @@ bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 +bind = $mainMod SHIFT, h, movetoworkspacesilent, name:hidden # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 @@ -93,29 +103,58 @@ bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Brightness -bind = ,XF86MonBrightnessUp, exec, brightnessctl set 5%+ -bind = ,XF86MonBrightnessDown, exec, brightnessctl set 5%- +bindl = ,XF86MonBrightnessUp, exec, lightctl up +bindl = ,XF86MonBrightnessDown, exec, lightctl down + +# External Display Brightness +bindl = $mainMod,XF86MonBrightnessUp, exec, ddcutil setvcp 10 + 10 +bindl = $mainMod,XF86MonBrightnessDown, exec, ddcutil setvcp 10 - 10 # Speaker volume -bind = ,XF86AudioRaiseVolume, exec, pamixer -i 5 -bind = ,XF86AudioLowerVolume, exec, pamixer -d 5 -bind = ,XF86AudioMute,exec, pamixer --toggle-mute +bindl = ,XF86AudioRaiseVolume, exec, volumectl -u up +# bind = ,XF86AudioRaiseVolume, exec, pamixer -i 5 +bindl = ,XF86AudioLowerVolume, exec, volumectl -u down +# bind = ,XF86AudioLowerVolume, exec, pamixer -d 5 +bindl = ,XF86AudioMute,exec, volumectl toggle-mute +# bind = ,XF86AudioMute,exec, pamixer --toggle-mute # Mic volume bind = SUPER, XF86AudioRaiseVolume, exec, pamixer --default-source -i 5 bind = SUPER, XF86AudioLowerVolume, exec, pamixer --default-source -d 5 -bind = ,XF86AudioMicMute, exec, pamixer --default-source --toggle-mute +bind = ,XF86AudioMicMute, exec, volumectl -m toggle-mute +# bind = ,XF86AudioMicMute, exec, pamixer --default-source --toggle-mute + # Screenshots -bind = ,PRINT, exec, grim -g "$(slurp)" - | swappy -f - +bind = ,PRINT, exec, grim -g "$(slurp)" - | swappy -f - + +# Copy text from image +# bind = $mainModShift, c, exec, grim -g "$(slurp)" - | tesseract - - -l eng | wl-copy +bind = $mainModShift, c, exec, grim -g "$(slurp)" - | tesseract - - -l vie | wl-copy # Player -bind = $mainMod,comma, exec, playerctl previous -bind = $mainMod,period, exec, playerctl next -bind = $mainMod,slash, exec, playerctl play-pause +bindl = $mainMod,comma, exec, playerctl previous +bindl = $mainMod,period, exec, playerctl next +bindl = $mainMod,slash, exec, playerctl play-pause +bindl = $mainMod,slash, exec, playerctl play-pause + +# Deadbeef +bindl = $mainModShift, comma, exec, playerctl previous +bindl = $mainModShift, period, exec, playerctl next +bindl = $mainModCtrl, comma, exec, playerctl position 10- +bindl = $mainModCtrl, period, exec, playerctl position 10+ +bindl = $mainModShift, slash, exec, playerctl play-pause +bindl = $mainModShift, END, exec, ~/.bin/playerctl-remove-file +bindl = $mainModShift, INSERT, exec, ~/.bin/playerctl-pick-current-track # Launcher -bind = $mainMod, space, exec, albert toggle +# bind = $mainMod, space, exec, albert toggle # 1Password bind = $mainMod, backslash, exec, 1password --toggle +bind = $mainMod, bracketright, exec, ~/.config/hypr/bin/wallpapers.py next + +# Alt+Tab +bind = ALT, Tab, cyclenext, +bind = ALT, Tab, bringactivetotop, +bind = ALT SHIFT, Tab, cyclenext, prev diff --git a/configs/hypr/config.d/50-scaling.conf b/configs/hypr/config.d/50-scaling.conf deleted file mode 100644 index 01de4cc..0000000 --- a/configs/hypr/config.d/50-scaling.conf +++ /dev/null @@ -1,8 +0,0 @@ -xwayland { - force_zero_scaling = true -} - -# toolkit-specific scale -env = GDK_SCALE,2 -env = XCURSOR_SIZE,32 - diff --git a/configs/hypr/config.d/50-screensharing.conf b/configs/hypr/config.d/50-screensharing.conf index 4d3f6b9..4fe66bf 100644 --- a/configs/hypr/config.d/50-screensharing.conf +++ b/configs/hypr/config.d/50-screensharing.conf @@ -1,3 +1,5 @@ +exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ windowrulev2 = noanim,class:^(xwaylandvideobridge)$ windowrulev2 = nofocus,class:^(xwaylandvideobridge)$ diff --git a/configs/hypr/config.d/90-theme.conf b/configs/hypr/config.d/90-theme.conf index 05838a0..878b0c1 100644 --- a/configs/hypr/config.d/90-theme.conf +++ b/configs/hypr/config.d/90-theme.conf @@ -1,31 +1,28 @@ general { # See https://wiki.hyprland.org/Configuring/Variables/ for more - + # max_fps = 60 gaps_in = 5 gaps_out = 10 border_size = 4 col.active_border = rgb(AF5F5F) col.inactive_border = rgb(7F848D) - col.group_border_active = rgb(AF5F5F) - col.group_border = rgb(AFB7BF) layout = dwindle no_border_on_floating = true } -misc { - groupbar_gradients = false - groupbar_titles_font_size = 16 - groupbar_text_color = rgb(000000) +group { + groupbar { + gradients = false + render_titles = false + font_size = 16 + text_color = rgb(000000) + col.active = rgb(AF5F5F) + col.inactive = rgb(AFB7BF) + } } -# group { -# groupbar { -# gradients = false -# } -# } - decoration { rounding = 0 drop_shadow = yes @@ -37,7 +34,7 @@ decoration { blur { enabled = true - size = 8 + size = 2 passes = 3 new_optimizations = on noise = 0.01 @@ -47,11 +44,12 @@ decoration { } animations { - enabled = no - # bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - # animation = windows, 0, 5, myBezier - # animation = windowsOut, 1, 7, default, popin 80% - # animation = border, 1, 10, default - # animation = fade, 1, 7, default - # animation = workspaces, 0, 1, default + enabled = yes + bezier = myBezier, 0.05, 0.1, 0.2, 1.05 + animation = windows, 0, 2, default, popin 80% + animation = windowsOut, 1, 2, default, popin 100% + animation = windowsIn, 1, 2, default, popin 100% + animation = border, 0, 10, myBezier + animation = fade, 1, 5, myBezier + animation = workspaces, 1, 5, default, slidefadevert 0% } diff --git a/configs/hypr/config.d/90-window-rules.conf b/configs/hypr/config.d/90-window-rules.conf index 8633508..1208ca0 100644 --- a/configs/hypr/config.d/90-window-rules.conf +++ b/configs/hypr/config.d/90-window-rules.conf @@ -1,20 +1,41 @@ # Example windowrule v1 +windowrule = float, class:(float) windowrule = float, ^(1Password)$ -windowrule = pin, title:^(Picture in picture)$ -windowrule = pin, title:^(Picture-in-Picture)$ +windowrulev2 = pin, title:^(Picture in picture)$ +windowrulev2 = pin, title:^(Picture-in-Picture)$ windowrule = float, title:^(Volume Control)$ windowrule = float, title:^(Network Connections)$ windowrule = float, class:^(nm-connection-editor)$ +windowrulev2 = float, class:^(imv)$ +windowrulev2 = center, class:^(imv)$ windowrule = float,^(albert)$ windowrule = noborder,^(albert)$ + windowrule = forceinput,^(albert)$ windowrule = center,^(albert)$ - windowrulev2 = stayfocused, class:(albert) +windowrulev2 = stayfocused, class:(wofi) +windowrulev2 = stayfocused, class:(zenity) +windowrulev2 = float, class:(zenity) +windowrulev2 = center(1), class:(zenity) +# windowrulev2 = size 40% 10%, class:(zenity) + +# Previews +windowrulev2 = float, class:^(org.gnome.Loupe)$ +windowrulev2 = center, class:^(org.gnome.Loupe)$ +windowrulev2 = float, title:^(File Operation Progress)$ +windowrulev2 = float, title:(Torrent Options) + +# Deadbeef +windowrulev2 = float, class:(deadbeef) + +# Telegram +windowrulev2 = float, title:(Media viewer) + # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more diff --git a/configs/hypr/hyprland.conf b/configs/hypr/hyprland.conf index 8901e9a..177e695 100644 --- a/configs/hypr/hyprland.conf +++ b/configs/hypr/hyprland.conf @@ -1,11 +1,11 @@ source = ~/.config/hypr/config.d/00-env.conf source = ~/.config/hypr/config.d/00-nvidia-env.conf +source = ~/.config/hypr/config.d/10-sleep.conf source = ~/.config/hypr/config.d/10-autostart.conf source = ~/.config/hypr/config.d/10-display.conf source = ~/.config/hypr/config.d/10-input.conf source = ~/.config/hypr/config.d/20-key-bindings.conf source = ~/.config/hypr/config.d/50-screensharing.conf -source = ~/.config/hypr/config.d/50-scaling.conf source = ~/.config/hypr/config.d/90-theme.conf source = ~/.config/hypr/config.d/90-guestures.conf source = ~/.config/hypr/config.d/90-window-rules.conf @@ -31,11 +31,15 @@ dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = yes # you probably want this + special_scale_factor = 0.95 } misc { disable_hyprland_logo = yes focus_on_activate = yes + vrr = 1 + mouse_move_enables_dpms = false + key_press_enables_dpms = true } master { diff --git a/configs/kitty/kitty.conf b/configs/kitty/kitty.conf index b77e3f4..0f9e69a 100644 --- a/configs/kitty/kitty.conf +++ b/configs/kitty/kitty.conf @@ -1,7 +1,7 @@ allow_remote_control yes cursor_blink_interval 0 -background_opacity 0.5 +background_opacity 0.8 dynamic_background_opacity no remember_window_size no diff --git a/configs/newsboat/config b/configs/newsboat/config index af5107f..78edb62 100644 --- a/configs/newsboat/config +++ b/configs/newsboat/config @@ -2,7 +2,14 @@ browser "$HOME/.bin/open-link %u" prepopulate-query-feeds yes text-width 120 save-path ~/Dev/@A/notes/saved_articles +datetime-format "%Y-%m-%d" +bookmark-cmd "/usr/share/doc/newsboat/contrib/getpocket.com/send-to-pocket.sh" + +ignore-article "*" "title =~ \"Apple Watch\"" +ignore-article "*" "title =~ \"IDEA\"" +ignore-article "*" "title =~ \"Windows 11\"" +ignore-article "*" "title =~ \"emacs\"" ignore-article "*" "title =~ \"bspwm\"" ignore-article "*" "title =~ \"Tailwind\"" ignore-article "*" "title =~ \"Learn\"" @@ -55,3 +62,4 @@ ignore-article "https://www.reddit.com/r/neovim/.rss" "title =~ \"Telescope\"" ignore-article "https://100r.co/links/rss.xml" "title =~ \"Summary\"" ignore-mode "display" +bind-key SPACE toggle-article-read diff --git a/configs/newsboat/urls b/configs/newsboat/urls index b8c5c9e..8bd2049 100644 --- a/configs/newsboat/urls +++ b/configs/newsboat/urls @@ -1,76 +1,85 @@ # Queries -https://archlinux.org/feeds/news/ "~Arch News" + +"query:* All:unread = \"yes\" or unread = \"no\" "query:* All Unread:unread = \"yes\"" + +"query:* Layoffs:(title =~ \"layoff\" or title =~\"lays off\")" +"query:* AI:(title =~ \"AI \" or title =~\"AI's\")" +"query:* BITCOIN:(title =~ \"bitcoin \" or title =~\"btc \")" + +"query:* MUSIC:( tags # \"music\" and unread == \"yes\" )" +"query:* DEV:( tags # \"dev\" and unread == \"yes\" )" +"query:* NEWS:( tags # \"news\" and unread == \"yes\" )" + +https://canthisevenbecalledmusic.com/feed/ "~Can This Even Be Called Music?" music +https://theprogressivesubway.com/feed/ "~The Progressive Subway" music + +https://archlinux.org/feeds/news/ "~Arch News" dev +https://monthly-reports.archlinux.page/index.xml "~Arch Monthly Reports" dev +https://マリウス.com/index.xml dev +https://junegunn.kr/atom.xml dev +http://philcalcado.com/feed.xml "~Phil Calçado" dev +https://cprss.s3.amazonaws.com/javascriptweekly.com.xml "~JavaScript Weekly" dev +https://feeds.feedburner.com/jster dev +https://feeds.feedburner.com/ponyfooweekly dev +http://blog.cleancoder.com/atom.xml dev +https://web.dev/feed.xml dev +https://alistapart.com/main/feed/ "~A List Apart" dev +https://engineering.atspotify.com/feed/ dev +https://www.techatbloomberg.com/feed/ dev +https://engineering.fb.com/feed/ dev +https://deepsource.io/blog/index.xml dev +https://www.reddit.com/r/archlinux/.rss "~/r/archlinux" dev +https://www.reddit.com/r/hyprland/.rss "~/r/hyprland" dev +https://www.reddit.com/r/neovim/.rss "~/r/neovim" dev +https://github.com/neovim/neovim/tags.atom "~/gh/neovim" dev +https://tg.i-c-a.su/rss/valya_reads_issue dev +https://xn--gckvb8fzb.comindex.xml dev +https://news.ycombinator.com/rss news +https://weightythoughts.com/feed dev + + # "query:* Reddit:( rssurl =~ \"reddit\" and unread == \"yes\" )" # "query:* Mozilla:( rssurl =~ \"blog.mozilla.org\" and unread == \"yes\" )" -"query:* Blogs:( tags # \"blogs\" and unread == \"yes\" )" -"query:* Telegram:( rssurl =~ \"tg.i-c-a.su\" and unread == \"yes\" )" -"query:* Frontend:( tags # \"frontend\" and unread == \"yes\" )" -"query:* Algorithms:( tags # \"algorithms\" and unread == \"yes\" )" -"query:* Architecture:( tags # \"architecture\" and unread == \"yes\" )" -"query:* Tech Companies:( tags # \"techcompanies\" and unread == \"yes\" )" -"query:* Newspappers:( tags # \"newspappers\" and unread == \"yes\" )" -"query:* Linux:( tags # \"linux\" and unread == \"yes\" )" -"query:* Startups:( tags # \"startups\" and unread == \"yes\" )" +# "query:* Blogs:( tags # \"blogs\" and unread == \"yes\" )" +# "query:* Telegram:( rssurl =~ \"tg.i-c-a.su\" and unread == \"yes\" )" +# "query:* Frontend:( tags # \"frontend\" and unread == \"yes\" )" +# "query:* Algorithms:( tags # \"algorithms\" and unread == \"yes\" )" +# "query:* Architecture:( tags # \"architecture\" and unread == \"yes\" )" +# "query:* Tech Companies:( tags # \"techcompanies\" and unread == \"yes\" )" +# "query:* Newspappers:( tags # \"newspappers\" and unread == \"yes\" )" +# "query:* Linux:( tags # \"linux\" and unread == \"yes\" )" +# "query:* Startups:( tags # \"startups\" and unread == \"yes\" )" -# Local -file:///var/feeds/betweentwocommits.com.xml "~Between Two Commits" blogs linux -file:///var/feeds/lambdablob.com.xml "~Lambda Blob" blogs +# # Local +# file:///var/feeds/betweentwocommits.com.xml "~Between Two Commits" blogs linux +# file:///var/feeds/lambdablob.com.xml "~Lambda Blob" blogs -# Blogs -https://blog.kamyshev.me/rss/ "~Kamyshev" blogs frontend +# https://trends.vc/feed/ +# https://blog.kamyshev.me/rss/ "~Kamyshev" blogs frontend # http://blog.mozilla.com/nnethercote/feed/ "~Nicholas Nethercote, Mozilla" blogs # https://nnethercote.github.io/feed.xml "~Nicholas Nethercote, Personal" blogs -http://philcalcado.com/feed.xml "~Phil Calçado" blogs # https://100r.co/links/rss.xml "~100 Rabbints" blogs # https://addyosmani.com/feed.xml "~Addy Osmani" blogs frontend # https://humanwhocodes.com/feeds/blog.xml "~Nicholas Zakas" blogs frontend -https://vitkarpov.me/index.xml "~Vitaly Karpov" algorithms +# https://vitkarpov.me/index.xml "~Vitaly Karpov" algorithms # https://jakearchibald.com/posts.rss "~Jake Archibald" blogs frontend # https://www.mnot.net/blog/index.atom blogs architecture # https://daniel.haxx.se/blog/feed "~Daniel Stenberg" blogs # https://infrequently.org/feed/ "~Alex Russel" blogs frontend -https://junegunn.kr/atom.xml blogs linux -https://www.distrotube.com/videos/index.xml linux -https://blog.jessfraz.com/index.xml linux blogs docker +# https://www.distrotube.com/videos/index.xml linux +# https://blog.jessfraz.com/index.xml linux blogs docker # https://usesthis.com/feed.atom linux blogs - -https://trends.vc/feed/ startups - -https://cprss.s3.amazonaws.com/javascriptweekly.com.xml "~JavaScript Weekly" newspappers -https://feeds.feedburner.com/jster newspappers -https://feeds.feedburner.com/ponyfooweekly newspappers -https://martinfowler.com/feed.atom architecture -http://blog.cleancoder.com/atom.xml architecture -https://web.dev/feed.xml newspappers -https://web-standards.ru/articles/feed/ "~web-standards.ru" newspappers -https://www.smashingmagazine.com/feed/ "~Smashing Magazine" newspappers -https://alistapart.com/main/feed/ "~A List Apart" newspappers - -https://engineering.atspotify.com/feed/ techcompanies -https://www.techatbloomberg.com/feed/ techcompanies -https://engineering.fb.com/feed/ techcompanies -https://deepsource.io/blog/index.xml techcompanies - - -https://www.reddit.com/r/archlinux/.rss "~/r/archlinux" -https://www.reddit.com/r/ManjaroLinux/new.rss "~/r/manjaro" -https://www.reddit.com/r/xmonad/.rss "~/r/xmonad" -https://www.reddit.com/r/unixporn/.rss "~/r/unixporn" -https://www.reddit.com/r/thinkpad/.rss "~/r/thinkpad" -https://www.reddit.com/r/neovim/.rss "~/r/neovim" -https://www.reddit.com/r/zsh/.rss "~/r/zsh" -https://www.reddit.com/r/typescript/.rss "~/r/typescript" -https://www.reddit.com/r/javascript/.rss "~/r/javascript" -https://www.reddit.com/r/commandline/.rss "~/r/commandline" - -https://github.com/neovim/neovim/tags.atom "~/gh/neovim" - +# https://web-standards.ru/articles/feed/ "~web-standards.ru" newspappers +# https://www.smashingmagazine.com/feed/ "~Smashing Magazine" newspappers +# https://www.reddit.com/r/ManjaroLinux/new.rss "~/r/manjaro" +# https://www.reddit.com/r/xmonad/.rss "~/r/xmonad" +# https://www.reddit.com/r/unixporn/.rss "~/r/unixporn" +# https://www.reddit.com/r/thinkpad/.rss "~/r/thinkpad" +# https://www.reddit.com/r/zsh/.rss "~/r/zsh" +# https://www.reddit.com/r/typescript/.rss "~/r/typescript" +# https://www.reddit.com/r/javascript/.rss "~/r/javascript" +# https://www.reddit.com/r/commandline/.rss "~/r/commandline" # https://blog.mozilla.org/ux/feed/ - -https://tg.i-c-a.su/rss/iamakulov_channel "Ivan Akulov" -https://tg.i-c-a.su/rss/defront -https://tg.i-c-a.su/rss/valya_reads_issue -https://xn--gckvb8fzb.comindex.xml blogs linux - -https://news.ycombinator.com/rss news +# https://tg.i-c-a.su/rss/iamakulov_channel "Ivan Akulov" +# https://tg.i-c-a.su/rss/defront diff --git a/configs/nvim/.luarc.json b/configs/nvim/.luarc.json new file mode 100644 index 0000000..c8b8dd2 --- /dev/null +++ b/configs/nvim/.luarc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "diagnostics.globals": ["vim"] +} diff --git a/configs/nvim/ftplugin/java.lua b/configs/nvim/ftplugin/java.lua new file mode 100644 index 0000000..8c1c715 --- /dev/null +++ b/configs/nvim/ftplugin/java.lua @@ -0,0 +1,5 @@ +local config = { + cmd = {'/usr/bin/jdtls'}, + root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw', 'metals.log'}, { upward = true })[1]), +} +require('jdtls').start_or_attach(config) diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index bbf4fc5..5a34e39 100755 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -1,3 +1,7 @@ require 'opts' -require 'plugins' + +local plugins = require('plugins') +local config = require('config') + +plugins.init(config) diff --git a/configs/nvim/lua/config.lua b/configs/nvim/lua/config.lua index c53e55d..4f5d462 100644 --- a/configs/nvim/lua/config.lua +++ b/configs/nvim/lua/config.lua @@ -9,24 +9,27 @@ local enabled_packages = { 'packages/editorconfig', 'packages/comment', 'packages/cmp-completion', + -- 'packages/nvim-java', 'packages/lsp', 'packages/tmux-navigation', 'packages/nvim-session', 'packages/quickfix-to-bottom', - -- 'packages/neo-tree', 'packages/nerdtree', 'packages/treesitter', 'packages/null-ls', 'packages/trouble', 'packages/todo-comments', - -- 'packages/nvim-obsidian', 'packages/extended-syntax', + 'packages/glow', + 'packages/obsidian', + 'packages/nvim-colorizer', + 'packages/pretty-fold', + 'packages/nvim-metals', + -- 'packages/neo-tree', + -- 'packages/nvim-obsidian', -- 'packages/close-buffers', -- 'packages/import-cost', -- 'packages/todo-txt', - 'packages/glow', - 'packages/obsidian', - 'packages/nvim-colorizer' } local enabled_treesitter_configs = { @@ -49,6 +52,9 @@ local enabled_lsp_servers = { 'vimls', 'yamlls', 'hls', + -- 'java_language_server', + -- 'jdtls' + -- 'jdtls', } -- base whichkeys config. Mutated in `.keybindings_hook` diff --git a/configs/nvim/lua/packages/lsp/init.lua b/configs/nvim/lua/packages/lsp/init.lua index 8582cb4..14d7cca 100644 --- a/configs/nvim/lua/packages/lsp/init.lua +++ b/configs/nvim/lua/packages/lsp/init.lua @@ -9,14 +9,14 @@ local function install(use) use 'jose-elias-alvarez/nvim-lsp-ts-utils' use 'nvim-lua/lsp-status.nvim' use 'arkav/lualine-lsp-progress' - use { - 'mrcjkb/haskell-tools.nvim', - requires = { - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope.nvim', -- optional - }, - branch = '1.x.x', -- recommended - } + -- use { + -- 'mrcjkb/haskell-tools.nvim', + -- requires = { + -- 'nvim-lua/plenary.nvim', + -- 'nvim-telescope/telescope.nvim', -- optional + -- }, + -- branch = '1.x.x', -- recommended + -- } end local function setup() diff --git a/configs/nvim/lua/packages/nvim-java.lua b/configs/nvim/lua/packages/nvim-java.lua new file mode 100644 index 0000000..94f3a5f --- /dev/null +++ b/configs/nvim/lua/packages/nvim-java.lua @@ -0,0 +1,11 @@ +local function install(use) + use("mfussenegger/nvim-jdtls") +end + +local function setup() +end + +return { + install = install, + setup = setup, +} diff --git a/configs/nvim/lua/packages/nvim-metals.lua b/configs/nvim/lua/packages/nvim-metals.lua new file mode 100644 index 0000000..a6d39c1 --- /dev/null +++ b/configs/nvim/lua/packages/nvim-metals.lua @@ -0,0 +1,29 @@ +local function install(use) + use({ + "scalameta/nvim-metals", + requires = { "nvim-lua/plenary.nvim" } + }) +end + +local function setup() + local metals_config = require("metals").bare_config() + + metals_config.settings = { + showImplicitArguments = true, + serverVersion = 'latest.snapshot', + } + local group = vim.api.nvim_create_augroup("metals", { clear = true }) + + vim.api.nvim_create_autocmd({ "FileType" }, { + group = group, + pattern = { "scala", "sbt", "java" }, + callback = function() + require("metals").initialize_or_attach(metals_config) + end, + }) +end + +return { + install = install, + setup = setup, +} diff --git a/configs/nvim/lua/packages/obsidian.lua b/configs/nvim/lua/packages/obsidian.lua index 5302cf0..18e33bf 100644 --- a/configs/nvim/lua/packages/obsidian.lua +++ b/configs/nvim/lua/packages/obsidian.lua @@ -95,7 +95,8 @@ local function install(use) end local function post_setup() - vim.cmd(":au! BufNewFile,BufRead *.md set ft=lsp_markdown") + -- vim.cmd(":au FileType mkd set filetype=lsp_markdown") + vim.cmd(":au! BufEnter,BufNewFile,BufRead *.md set ft=lsp_markdown") vim.cmd(":syn region markdownWikiLink matchgroup=markdownLinkDelimiter start='\\[\\[' end='\\]\\]' contains=markdownLinkUrl keepend oneline concealends") vim.cmd([[:au! BufEnter,BufNewFile,BufRead *.md syn match markdownTag "#[0-9A-Za-z:._]\+"]]) diff --git a/configs/nvim/lua/packages/pretty-fold.lua b/configs/nvim/lua/packages/pretty-fold.lua new file mode 100644 index 0000000..e644d45 --- /dev/null +++ b/configs/nvim/lua/packages/pretty-fold.lua @@ -0,0 +1,15 @@ +local function install(use) + use 'anuvyklack/pretty-fold.nvim' +end + +local function setup() + require('pretty-fold').setup({ + fill_char = '·', + }) +end + + +return { + install = install, + setup = setup, +} diff --git a/configs/nvim/lua/plugins.lua b/configs/nvim/lua/plugins.lua index 2de0db0..7d1b4f7 100644 --- a/configs/nvim/lua/plugins.lua +++ b/configs/nvim/lua/plugins.lua @@ -1,32 +1,41 @@ -local has_prop = require('lib/utils/has_prop').has_prop +local has_prop = require('lib/utils/has_prop').has_prop local table_merge = require('lib/utils/table_merge').table_merge -local enabled_packages = require('config').enabled_packages -local keys = require('config').keys +-- local dump = require('lib.utils.dump').dump --- Call pre_install hooks -has_prop(enabled_packages, 'pre_install', function(package) - package.pre_install() -end) +local init = function(config) + local keys = config.keys + local enabled_packages = config.enabled_packages -require('packer').startup(function (use) - -- Call install hooks - has_prop(enabled_packages, 'install', function(package) - package.install(use) + -- Call pre_install hooks + has_prop(enabled_packages, 'pre_install', function(package) + package.pre_install() end) - -- Call setup hooks - has_prop(enabled_packages, 'setup', function(package) - package.setup() + require('packer').startup(function (use) + -- Call install hooks + has_prop(enabled_packages, 'install', function(package) + package.install(use) + end) + + -- Call setup hooks + has_prop(enabled_packages, 'setup', function(package) + package.setup() + end) + + -- Get keybindings + has_prop(enabled_packages, 'keys', function(package) + table_merge(keys, package.keys) + end) end) - -- Get keybindings - has_prop(enabled_packages, 'keys', function(package) - table_merge(keys, package.keys) + -- Call post_setup hooks + has_prop(enabled_packages, 'post_setup', function(package) + package.post_setup() end) -end) +end + --- Call post_setup hooks -has_prop(enabled_packages, 'post_setup', function(package) - package.post_setup() -end) +return { + init = init, +} diff --git a/configs/waybar/bin/docker.sh b/configs/waybar/bin/docker.sh new file mode 100755 index 0000000..446f5cf --- /dev/null +++ b/configs/waybar/bin/docker.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +RUNNING_CONTAINERS=$(docker ps --format "{{.ID}} | {{.Names}}") +# RUNNING_CONTAINERS=$(docker ps --format "{{.ID}} | {{.Names}} | {{.Image}} | {{.Ports}} | {{.Status}}") +RUNNING_CONTAINERS_STR=$(printf "%s" "$RUNNING_CONTAINERS" | sed ':a;N;$!ba;s/\n/\\n/g; s/"/\\"/g') +NUMBER_RUNNING_CONTAINERS=$(printf "%s\n" "$RUNNING_CONTAINERS" | wc -l) +NUMBER_TOTAL_CONTAINERS=$(docker ps -qa | wc -l) + +echo "{\"text\": \"${NUMBER_RUNNING_CONTAINERS}\", \"tooltip\": \"$RUNNING_CONTAINERS_STR\", \"alt\": \"\", \"class\": \"\" }" diff --git a/configs/waybar/bin/newsboat-stats.sh b/configs/waybar/bin/newsboat-stats.sh new file mode 100755 index 0000000..a5b00cd --- /dev/null +++ b/configs/waybar/bin/newsboat-stats.sh @@ -0,0 +1,11 @@ +#/bin/bash + +if pgrep -x "newsboat" > /dev/null; then + cat ~/.tmp/newsboat-current +else + current=$(newsboat -x print-unread | grep -o '[0-9]*') + echo "$current" > ~/.tmp/newsboat-current + + cat ~/.tmp/newsboat-current +fi + diff --git a/configs/waybar/bin/uair-stats.sh b/configs/waybar/bin/uair-stats.sh index 50b55c1..97cb66e 100755 --- a/configs/waybar/bin/uair-stats.sh +++ b/configs/waybar/bin/uair-stats.sh @@ -1,8 +1,12 @@ #! /bin/bash STATS_FILE=~/.tmp/pomodoro.log -F=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep F | wc -l` -R=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep R | wc -l` -P=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep P | wc -l` +PROJECTS=$(cat ~/.config/uair/uair.toml | perl -n -e'/id = \"(.*)\"/ && print "$1\n"') -echo "F:${F} R:${R} P:${P}" +RESULT="" +for PROJECT in $PROJECTS; do + PROJECT_NUMBER=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep "@${PROJECT}" | wc -l` + RESULT="${RESULT} ${PROJECT}:${PROJECT_NUMBER}" +done; + +echo ${RESULT} diff --git a/configs/waybar/bottom.config b/configs/waybar/bottom.config index f36d717..a64cbb4 100644 --- a/configs/waybar/bottom.config +++ b/configs/waybar/bottom.config @@ -1,17 +1,26 @@ { "layer": "top", // Waybar at top layer "position": "bottom", - "height": 24, + "height": 32, "spacing": 8, // Gaps between modules (4px) "margin": "0 10px", - "modules-left": ["custom/btcusd", "custom/ethusdt", "custom/usdrub", "custom/eurrub", "custom/dela"], + "modules-left": [ + "custom/screenrecorder", + "custom/btcusd", + "custom/ethusdt", + "custom/usdrub", + "custom/eurrub", + "custom/dela" + ], "modules-center": [], "modules-right": [ "custom/root-free-space", "custom/home-free-space", "cpu", "memory", + // "custom/gpu-utilization", "temperature", + "custom/power-usage", "pulseaudio", "network", "backlight", @@ -26,21 +35,25 @@ "tooltip": false, "format": " {}", "exec": "~/.local/bin/currency BTCUSD", + "interval": 300, }, "custom/usdrub": { "tooltip": false, "format": " {}", "exec": "~/.local/bin/currency USDRUB", + "interval": 300, }, "custom/eurrub": { "tooltip": false, "format": " {}", "exec": "~/.local/bin/currency EURRUB", + "interval": 300, }, "custom/ethusdt": { "tooltip": false, "format": " {}", "exec": "~/.local/bin/currency ETHUSDT", + "interval": 300, }, "custom/dela": { "tooltip": false, @@ -53,8 +66,8 @@ "pulseaudio": { "format": "{icon} {volume}% {format_source}", - "format-bluetooth": "{volume}% {icon} {format_source}", - "format-bluetooth-muted": "󰝟 {icon} {format_source}", + "format-bluetooth": "{volume}% {icon}  {format_source}", + "format-bluetooth-muted": "󰝟 {icon}  {format_source}", "format-muted": "󰝟 {format_source}", "format-source": " {volume}%", "format-source-muted": "", @@ -108,10 +121,8 @@ "format-charging": " {capacity}%", "format-plugged": " {capacity}%", "format-alt": "{time} {icon}", - "format-icons": ["", "", "", "", ""] - }, - "battery#bat2": { - "bat": "BAT2" + "format-icons": ["", "", "", "", ""], + "interval": 30 }, "network": { "max-length": 15, @@ -122,38 +133,44 @@ "format-disconnected": "Disconnected ⚠", "format-alt": "{ifname}: {ipaddr}/{cidr}" }, - "custom/notification": { - "tooltip": false, - "format": "{icon} {}", - "format-icons": { - "notification": " ", - "none": " ", - "dnd-notification": " ", - "dnd-none": " ", - - "inhibited-notification": "", - "inhibited-none": "", - "dnd-inhibited-notification": "", - "dnd-inhibited-none": "" - }, - - "return-type": "json", - "exec-if": "which swaync-client", - "exec": "swaync-client -swb", - "on-click": "swaync-client -t -sw", - "on-click-right": "swaync-client -d -sw", - "escape": true - }, "custom/root-free-space": { "tooltip": false, "format": "/:{}GB", - "interval": 60, + "interval": 300, "exec": "sudo btrfs fi show / | awk '/size/{print $4-$6}' | cut -d. -f1" }, "custom/home-free-space": { "tooltip": false, "format": "/home:{}GB", - "interval": 60, + "interval": 300, "exec": "df /home --block-size=1G | awk '/home/{print $2-$3}'" + }, + "custom/debug": { + "exec": "cat ~/.emoticons | shuf -n1", + "tooltip": false, + "format": "{}", + "interval": 1, + }, + "custom/power-usage": { + "tooltip": false, + "format": "󱐋 {}W", + "interval": 10, + "exec": "awk '{print $1*10^-6}' /sys/class/power_supply/BAT0/power_now" + }, + "custom/gpu-utilization": { + "tooltip": false, + "format": "GPU:{}%", + "interval": 30, + "exec": "nvidia-smi --query-gpu utilization.gpu --format=csv,noheader | sed 's/ %//g'" + }, + "custom/screenrecorder": { + "exec": "$HOME/.config/hypr/bin/waybar-wf-recorder.sh status", + "interval": "once", + "signal": 1, + "return-type": "json", + "tooltip": true, + "format": "{}", + "on-click": "$HOME/.config/hypr/bin/waybar-wf-recorder.sh toggle fullscreen", + "on-click-right": "$HOME/.config/hypr/bin/waybar-wf-recorder.sh toggle region" } } diff --git a/configs/waybar/bottom.style.css b/configs/waybar/bottom.style.css index bcbcf80..ae6c819 100644 --- a/configs/waybar/bottom.style.css +++ b/configs/waybar/bottom.style.css @@ -1,30 +1,40 @@ * { - font-family: Iosevka Nerd Font, sans-serif; - font-size: 12px; + font-family: + Iosevka Nerd Font, + sans-serif; + font-size: 12px; } window#waybar { - background-color: rgba(255,255,255,0); + background-color: rgba(255, 255, 255, 0); margin: 2px 8px; } - #tray, #custom-btcusd, #custom-ethusdt, #custom-usdrub, #custom-eurrub, #custom-dela, -box.horizontal.modules-right -{ +#custom-debug, +#custom-screenrecorder, +box.horizontal.modules-right { margin-bottom: 4px; - background-color: #EFF8FE; + background-color: #2e3340; border-radius: 1px; - border: 2px solid #AF5F5F; - box-shadow: 0px 1px 4px rgba(0,0,0,.25); + border: 4px solid #af5f5f; + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.25); padding: 2px 6px; } +#custom-screenrecorder { + padding-right: 12px; +} + +#custom-debug { + min-width: 120px; +} + #clock, #battery, #cpu, @@ -37,8 +47,15 @@ box.horizontal.modules-right #pulseaudio, #wireplumber, #custom-root-free-space, -#home-free-space -{ - padding: 0 4px; - color: #2e3340; +#home-free-space { + padding: 0 4px; + color: #eff8fe; +} + +tooltip { + border-radius: 1px; + border: 2px solid #af5f5f; + background-color: rgba(46, 51, 64, 0.85); + color: #d8dee8; + font-size: 16px; } diff --git a/configs/waybar/top.config b/configs/waybar/top.config index 8a96645..b5336c7 100644 --- a/configs/waybar/top.config +++ b/configs/waybar/top.config @@ -4,14 +4,15 @@ "height": 28, "spacing": 8, "margin": "0 6px", - "modules-left": ["hyprland/workspaces"], + "modules-left": ["custom/wlogout", "hyprland/workspaces"], "modules-center": [ "custom/dela", + "custom/newsboat", "custom/pacman", "custom/docker", "custom/notification" ], - "modules-right": ["custom/timer", "custom/timer-stats", "tray"], + "modules-right": ["mpris", "custom/timer", "custom/timer-stats", "tray"], "hyprland/workspaces": { "format": "{name}", "format-icons": { @@ -22,6 +23,7 @@ "on-scroll-up": "hyprctl dispatch workspace r-1", "on-scroll-down": "hyprctl dispatch workspace r+1", "all-outputs": false, + "show-special": true, "persistent_workspaces": { "*": 10 } @@ -36,29 +38,87 @@ "format": " {}", "exec": "dela list --today --format='$title' '/home/anton/Dev/@A/notes/*.md' | wc -l", //"on-click": "hyprctl dispatch -- exec kitty", - //"on-click": "hyprctl dispatch -- exec kitty --hold --directory ~/Dev/@A/notes zsh -c 'nvim'", - "interval": 60, + "on-click": "hyprctl dispatch -- exec kitty --hold --directory ~/Dev/@A/notes zsh -c 'nvim'", + "interval": 300, "on-click": "" }, + "custom/newsboat": { + "format": "󰑬 {}", + "exec-if": "whereis newsboat", + "exec": "~/.config/waybar/bin/newsboat-stats.sh", + "on-click": "kitty --class float --hold zsh -c 'sleep 1; newsboat'", + "interval": 180 + }, + + "custom/deadbeef": { + "format": "󰝚 {}", + "exec-if": "pgrep -f /usr/bin/deadbeef", + "exec": "deadbeef --nowplaying '%a - %t'", + "on-click": "deadbeef --toggle-pause", + "interval": 3 + }, + + "mpris": { + "format": "{player_icon} {dynamic}", + "format-paused": "{status_icon} {dynamic}", + "dynamic-order": ["position", "length", "artist", "title"], + "player-icons": { + "default": " ", + "deadbeef": "󰝚 ", + "chromium": "󰊯 " + }, + "status-icons": { + "paused": " " + }, + // "ignored-players": ["firefox"] + "max-length": 1000, + "interval": 1 + }, + // paru -S waybar-module-pacman-updates-git "custom/pacman": { "format": "󰣇 {}", "return-type": "json", "exec-if": "which waybar-module-pacman-updates", - "exec": "waybar-module-pacman-updates" + "exec": "waybar-module-pacman-updates", }, "custom/docker": { - "exec": "count=$(docker ps -q | wc -l); [[ $count -gt 0 ]] && echo $count", + // "exec": "count=$(docker ps -q | wc -l); [[ $count -gt 0 ]] && echo $count", + "exec": "~/.config/waybar/bin/docker.sh", "exec-if": "pgrep docker", + "return-type": "json", "format": "󰡨 {}", "interval": 60, "max-length": 5 }, + "custom/notification": { + "tooltip": false, + "format": "{icon} {}", + "format-icons": { + "notification": " ", + "none": " ", + "dnd-notification": " ", + "dnd-none": " ", + + "inhibited-notification": "", + "inhibited-none": "", + "dnd-inhibited-notification": "", + "dnd-inhibited-none": "" + }, + + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, + "custom/timer": { - "exec": "uairctl fetch '{name}:{time}'", + "exec": "uairctl fetch '{name}:{time}'", "tooltip": false, "format": " {}", "on-click": "uairctl toggle", @@ -72,6 +132,12 @@ "tooltip": false, "format": "{}", "interval": 60, - } + }, + + "custom/wlogout": { + "format": "⏻", + "on-click": "wlogout", + "tooltip": false + }, } diff --git a/configs/waybar/top.style.css b/configs/waybar/top.style.css index 585d83a..8217d95 100644 --- a/configs/waybar/top.style.css +++ b/configs/waybar/top.style.css @@ -20,12 +20,15 @@ tooltip { box.horizontal.modules-center, #tray, #custom-timer, -#custom-timer-stats +#custom-timer-stats, +#custom-deadbeef, +#mpris, +#custom-wlogout { margin: 4px; - background-color: #EFF8FE; + background-color: #2e3340; border-radius: 1px; - border: 2px solid #AF5F5F; + border: 4px solid #AF5F5F; box-shadow: 0px 1px 4px rgba(0,0,0,.25); } @@ -33,14 +36,26 @@ box.horizontal.modules-center, box.horizontal.modules-right, #custom-timer, #custom-timer-stats, +#custom-deadbeef, +#mpris, #tray { padding: 0 10px; } +box.horizontal.modules-right { + padding-right: 0; +} + +#custom-wlogout { + color: #AF5F5F; + padding: 0 14px 0 10px; + font-weight: bold; +} + #workspaces button { background-color: transparent; - color: #2e3340; + color: #EFF8FE; border-radius: 0; padding: 0 4px; } @@ -56,8 +71,8 @@ box.horizontal.modules-right, } #workspaces button.urgent { - background-color: #AF5F5F; - animation-name: blink; + background-color: #ffa042; + /* animation-name: blink; */ animation-duration: 0.5s; animation-timing-function: linear; animation-iteration-count: infinite; @@ -78,8 +93,8 @@ box.horizontal.modules-right, #custom-root-free-space, #home-free-space { - padding: 0 4px; - color: #2e3340; + padding: 0 4px; + color: #EFF8FE; } #custom-dela, diff --git a/configs/wlogout/icons/hibernate-hover.png b/configs/wlogout/icons/hibernate-hover.png new file mode 100644 index 0000000..ba5dac4 Binary files /dev/null and b/configs/wlogout/icons/hibernate-hover.png differ diff --git a/configs/wlogout/icons/hibernate.png b/configs/wlogout/icons/hibernate.png new file mode 100644 index 0000000..2031964 Binary files /dev/null and b/configs/wlogout/icons/hibernate.png differ diff --git a/configs/wlogout/icons/lock-hover.png b/configs/wlogout/icons/lock-hover.png new file mode 100644 index 0000000..0e3ebad Binary files /dev/null and b/configs/wlogout/icons/lock-hover.png differ diff --git a/configs/wlogout/icons/lock.png b/configs/wlogout/icons/lock.png new file mode 100644 index 0000000..1bca4ba Binary files /dev/null and b/configs/wlogout/icons/lock.png differ diff --git a/configs/wlogout/icons/logout-hover.png b/configs/wlogout/icons/logout-hover.png new file mode 100644 index 0000000..e5994c5 Binary files /dev/null and b/configs/wlogout/icons/logout-hover.png differ diff --git a/configs/wlogout/icons/logout.png b/configs/wlogout/icons/logout.png new file mode 100644 index 0000000..284bfa6 Binary files /dev/null and b/configs/wlogout/icons/logout.png differ diff --git a/configs/wlogout/icons/reboot-hover.png b/configs/wlogout/icons/reboot-hover.png new file mode 100644 index 0000000..e89067f Binary files /dev/null and b/configs/wlogout/icons/reboot-hover.png differ diff --git a/configs/wlogout/icons/reboot.png b/configs/wlogout/icons/reboot.png new file mode 100644 index 0000000..67b3fb9 Binary files /dev/null and b/configs/wlogout/icons/reboot.png differ diff --git a/configs/wlogout/icons/shutdown-hover.png b/configs/wlogout/icons/shutdown-hover.png new file mode 100644 index 0000000..8f19e5a Binary files /dev/null and b/configs/wlogout/icons/shutdown-hover.png differ diff --git a/configs/wlogout/icons/shutdown.png b/configs/wlogout/icons/shutdown.png new file mode 100644 index 0000000..a75aec1 Binary files /dev/null and b/configs/wlogout/icons/shutdown.png differ diff --git a/configs/wlogout/icons/suspend-hover.png b/configs/wlogout/icons/suspend-hover.png new file mode 100644 index 0000000..265b451 Binary files /dev/null and b/configs/wlogout/icons/suspend-hover.png differ diff --git a/configs/wlogout/icons/suspend.png b/configs/wlogout/icons/suspend.png new file mode 100644 index 0000000..28d4d87 Binary files /dev/null and b/configs/wlogout/icons/suspend.png differ diff --git a/configs/wlogout/layout b/configs/wlogout/layout new file mode 100644 index 0000000..488aa5b --- /dev/null +++ b/configs/wlogout/layout @@ -0,0 +1,36 @@ +{ + "label" : "lock", + "action" : "swaylock", + "text" : "Lock", + "keybind" : "l" +} +{ + "label" : "hibernate", + "action" : "systemctl hibernate", + "text" : "Hibernate", + "keybind" : "h" +} +{ + "label" : "logout", + "action" : "loginctl terminate-user $USER", + "text" : "Logout", + "keybind" : "e" +} +{ + "label" : "shutdown", + "action" : "systemctl poweroff", + "text" : "Shutdown", + "keybind" : "s" +} +{ + "label" : "suspend", + "action" : "systemctl suspend", + "text" : "Suspend", + "keybind" : "u" +} +{ + "label" : "reboot", + "action" : "systemctl reboot", + "text" : "Reboot", + "keybind" : "r" +} diff --git a/configs/wlogout/style.css b/configs/wlogout/style.css new file mode 100644 index 0000000..038c391 --- /dev/null +++ b/configs/wlogout/style.css @@ -0,0 +1,83 @@ +/* + +██╗ ██╗██╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗████████╗ +██║ ██║██║ ██╔═══██╗██╔════╝ ██╔═══██╗██║ ██║╚══██╔══╝ +██║ █╗ ██║██║ ██║ ██║██║ ███╗██║ ██║██║ ██║ ██║ +██║███╗██║██║ ██║ ██║██║ ██║██║ ██║██║ ██║ ██║ +╚███╔███╔╝███████╗╚██████╔╝╚██████╔╝╚██████╔╝╚██████╔╝ ██║ + ╚══╝╚══╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ + +WLogout Config File by Arfan Zubi + +*/ + +window { + color: #D3C6AA; + background-color: rgba(45, 53, 59, 0.7); + font-family: 'FiraCode Nerd Font', sans-serif; + font-weight: bold; + font-size: 20px; +} + +button { + margin: 5px; + color: #D3C6AA; + background-color: #272E33; + background-size: 20%; + background-repeat: no-repeat; + background-position: center; + border: 5px solid #3D484D; + border-radius: 15px; + box-shadow: none; + text-shadow: none; + opacity: 0.9; + transition: background-color 0.2s ease-in-out; +} + +button:focus, button:active, button:hover { + color: #2D353B; + background-color: #A7C080; + text-shadow: none; +} + +#lock { + background-image: image(url("./icons/lock.png")); +} +#lock:hover, #lock:focus { + background-image: image(url("./icons/lock-hover.png")); +} + +#logout { + background-image: image(url("./icons/logout.png")); +} +#logout:hover, #logout:focus { + background-image: image(url("./icons/logout-hover.png")); +} + +#suspend { + background-image: image(url("./icons/suspend.png")); +} +#suspend:hover, #suspend:focus { + background-image: image(url("./icons/suspend-hover.png")); +} + +#hibernate { + background-image: image(url("./icons/hibernate.png")); +} +#hibernate:hover, #hibernate:focus { + background-image: image(url("./icons/hibernate-hover.png")); +} + +#shutdown { + background-image: image(url("./icons/shutdown.png")); +} +#shutdown:hover, #shutdown:focus { + background-image: image(url("./icons/shutdown-hover.png")); +} + +#reboot { + background-image: image(url("./icons/reboot.png")); +} +#reboot:hover, #reboot:focus { + background-image: image(url("./icons/reboot-hover.png")); +} diff --git a/configs/zsh/config.d/99_user.zsh b/configs/zsh/config.d/99_user.zsh index bebe871..8ab6b6d 100644 --- a/configs/zsh/config.d/99_user.zsh +++ b/configs/zsh/config.d/99_user.zsh @@ -5,12 +5,7 @@ alias :q=exit alias serve="python -m http.server" alias fzf-search="locate / | fzf" alias evim="nvim -u none" - -alias b="oil" -alias ba="oil -a" -alias bd="oil -d" -alias bt="oil -t" -alias bT="oil -T" - +alias hyprlog="cat /tmp/hypr/$(ls -t /tmp/hypr/ | head -n 1)/hyprland.log" +alias pacheck="comm -12 <(pactree -srl $pkgname | sort) <(pacman -Qq | sort)" alias speed='for i in {1..3}; do echo "\n\rRetry ${i}:"; speedtest --simple; done' alias glgo="git log --pretty=oneline --abbrev-commit" diff --git a/configs/zsh/zshrc b/configs/zsh/zshrc index d38346b..e838890 100644 --- a/configs/zsh/zshrc +++ b/configs/zsh/zshrc @@ -10,3 +10,9 @@ compinit for f (~/.config/zsh/config.d/*(N.)) . $f source $HOME/.oh-my-zsh/oh-my-zsh.sh + +if [ "$TMUX" = "" ]; then tmux; fi + +#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! +export SDKMAN_DIR="$HOME/.sdkman" +[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" diff --git a/host_vars/archlinux.yml b/host_vars/archlinux.yml index 79b1f2e..314598e 100644 --- a/host_vars/archlinux.yml +++ b/host_vars/archlinux.yml @@ -185,11 +185,12 @@ yarn_packages: - name: pyright state: latest -cron_jobs: [] - # - name: "Pull newsboat feeds" - # state: present - # minute: "0" - # job: "newsboat -x reload" +cron_jobs: + - name: "Pull newsboat feeds" + state: present + minute: "0" + job: "newsboat -x reload" + # - name: "Update local rss-feeds" # state: absent # minute: "37" @@ -264,6 +265,9 @@ dotfiles: - src: "{{ dotfiles_source_dir }}/waybar" dest: "{{ configs_home }}/waybar" + - src: "{{ dotfiles_source_dir }}/wlogout" + dest: "{{ configs_home }}/wlogout" + - src: "{{ dotfiles_source_dir }}/kitty/kitty.conf" dest: "{{ configs_home }}/kitty/kitty.conf"