diff --git a/.bash_logout b/.bash_logout index 0e4e4f18..73dcc0fd 100644 --- a/.bash_logout +++ b/.bash_logout @@ -1,3 +1 @@ -# # ~/.bash_logout -# diff --git a/.bash_profile b/.bash_profile index 5545f007..043ecc2b 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,5 +1,3 @@ -# # ~/.bash_profile -# [[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/.bashrc b/.bashrc index 7178f1d1..b7ba7117 100644 --- a/.bashrc +++ b/.bashrc @@ -1,12 +1,3 @@ -# # ~/.bashrc -# - -# If not running interactively, don't do anything [[ $- != *i* ]] && return - -alias ls='ls --color=auto' -alias grep='grep --color=auto' PS1='[\u@\h \W]\$ ' - -PATH=~/.console-ninja/.bin:$PATH \ No newline at end of file diff --git a/.gitconfig b/.config/git/config similarity index 96% rename from .gitconfig rename to .config/git/config index 20b32ac5..9492a0af 100644 --- a/.gitconfig +++ b/.config/git/config @@ -1,6 +1,6 @@ [user] - email = admin@kaizen.wtf - name = kaizen +email = admin@kaizen.wtf +name = kaizen [core] editor = micro diff --git a/.config/i3/config b/.config/i3/config index 3742a402..ef1054ba 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -168,6 +168,12 @@ bindsym Ctrl+$mod+Delete exec --no-startup-id ~/dotfiles/.config/rofi/power # Feh - Set desktop wallpaper # exec_always --no-startup-id feh --bg-fill ~/.wallpaper.jpg +# Delete wallpaper +bindsym $mod+Shift+n exec ~/scripts/delete-wallpaper.sh +# Ranomdize wallpaper +bindsym $mod+Shift+s exec ~/scripts/wallpaper-changer.sh + + # Polybar - Start polybar exec_always --no-startup-id ~/dotfiles/.config/polybar/start-polybar.sh @@ -186,6 +192,7 @@ exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork # Start picom compositor exec_always --no-startup-id picom --config ~/dotfiles/.config/picom/picom.conf + # Disable automatic monitor power saving # exec --no-startup-id xset dpms 0 0 0 @@ -216,15 +223,13 @@ exec --no-startup-id /usr/lib/gsd-xsettings bindsym Ctrl+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png # bindsym Ctrl+Print exec --no-startup-id path="$HOME/screenshots/$(date).png" && maim --select "$path" && xclip -selection clipboard -t image/png "$path" -bindsym $mod+Shift+s --release exec flameshot gui +# bindsym $mod+Shift+s --release exec flameshot gui # exec -> On start-up # exec_always -> On start-up and reload - - # Alacritty - Start a terminal instance bindsym $mod+Return exec alacritty diff --git a/.config/pcmanfm/default/pcmanfm.conf b/.config/pcmanfm/default/pcmanfm.conf index ee469c3a..8f6e9dc7 100644 --- a/.config/pcmanfm/default/pcmanfm.conf +++ b/.config/pcmanfm/default/pcmanfm.conf @@ -9,8 +9,8 @@ autorun=0 [ui] always_show_tabs=1 max_tab_chars=32 -win_width=1920 -win_height=1054 +win_width=960 +win_height=527 splitter_pos=181 media_in_new_tab=0 desktop_folder_new_win=0 diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini index 9f9493d4..ba88f501 100644 --- a/.config/polybar/config.ini +++ b/.config/polybar/config.ini @@ -155,7 +155,7 @@ type = custom/script format-prefix = " " format-prefix-foreground = ${colors.primary} exec = ~/dotfiles/.config/polybar/modules/pending-updates.sh -interval = 600 +interval = 300 [module/filesystem] type = internal/fs diff --git a/.config/starship.toml b/.config/starship.toml index 828787b4..28c4105c 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,31 +1,31 @@ -# format = """ -# [░▒▓](#a3aed2)\ -# [  ](bg:#a3aed2 fg:#090c0c)\ -# [](bg:#769ff0 fg:#a3aed2)\ -# $directory\ -# [](fg:#769ff0 bg:#394260)\ -# $git_branch\ -# $git_status\ -# [](fg:#394260 bg:#212736)\ -# $nodejs\ -# $rust\ -# $golang\ -# $php\ -# [](fg:#212736 bg:#1d2230)\ -# $time\ -# [ ](fg:#1d2230)\ -# \n$character""" -# +format = """ +[░▒▓](#a3aed2)\ +[  ](bg:#a3aed2 fg:#090c0c)\ +[](bg:#769ff0 fg:#a3aed2)\ +$directory\ +[](fg:#769ff0 bg:#394260)\ +$git_branch\ +$git_status\ +[](fg:#394260 bg:#212736)\ +$nodejs\ +$rust\ +$golang\ +$php\ +[](fg:#212736 bg:#1d2230)\ +$time\ +[ ](fg:#1d2230)\ +\n$character""" + # A continuation prompt that displays two filled in arrows continuation_prompt = '▶▶ ' - -# A minimal left prompt -format = """$character""" - -# move the rest of the prompt to the right -right_format = """$all""" +# +# # A minimal left prompt +# format = """$character""" +# +# # move the rest of the prompt to the right +# right_format = """$all""" [directory] diff --git a/.config/zsh/.zcompdump-arch-5.9 b/.config/zsh/.zcompdump-arch-5.9 index 0e993fd4..5e352427 100644 --- a/.config/zsh/.zcompdump-arch-5.9 +++ b/.config/zsh/.zcompdump-arch-5.9 @@ -1,4 +1,4 @@ -#files: 971 version: 5.9 +#files: 986 version: 5.9 _comps=( '-' '_precommand' @@ -168,6 +168,7 @@ _comps=( 'chattr' '_chattr' 'chcon' '_chcon' 'chdir' '_cd' +'checkupdates' '_checkupdates' 'chfn' '_users' 'chgrp' '_chown' 'chimera' '_webbrowser' @@ -629,6 +630,7 @@ _comps=( 'gzgrep' '_grep' 'gzilla' '_webbrowser' 'gzip' '_gzip' +'handlr' '_handlr' 'hash' '_hash' 'hd' '_hexdump' 'head' '_head' @@ -820,9 +822,11 @@ _comps=( 'md5' '_cksum' 'md5sum' '_md5sum' 'mdadm' '_mdadm' +'mdcat' '_mdcat' 'mdel' '_mtools' 'mdeltree' '_mtools' 'mdir' '_mtools' +'mdless' '_mdless' 'mdu' '_mtools' 'mencal' '_mencal' 'mere' '_mere' @@ -975,19 +979,26 @@ _comps=( 'p4' '_perforce' 'p4d' '_perforce' 'pacat' '_pulseaudio' +'paccache' '_paccache' +'pacdiff' '_pacdiff' 'pack' '_pack' 'packf' '_mh' +'paclist' '_paclist' +'paclog-pkglist' '_paclog-pkglist' 'pacman' '_pacman' 'pacman-conf' '_pacman' 'pacman-key' '_pacman' 'pacman.static' '_pacman' 'pacmd' '_pulseaudio' +'pacscripts' '_pacscripts' +'pacsearch' '_pacsearch' +'pacsort' '_pacsort' 'pacstrap' '_archinstallscripts' 'pactl' '_pulseaudio' +'pactree' '_pactree' 'padsp' '_pulseaudio' 'pandoc' '_pandoc' 'paplay' '_pulseaudio' -'parallel' '_parallel' '-parameter-' '_parameter' 'parec' '_pulseaudio' 'parecord' '_pulseaudio' @@ -1135,6 +1146,7 @@ _comps=( 'rails' '_rails' 'rake' '_rake' 'ralio' '_ralio' +'rankmirrors' '_rankmirrors' 'ranlib' '_ranlib' 'rar' '_rar' 'rc' '_sh' @@ -1472,6 +1484,7 @@ _comps=( 'unwrapdiff' '_patchutils' 'unxz' '_xz' 'unzip' '_zip' +'updpkgsums' '_updpkgsums' 'uptime' '_uptime' 'urxvt' '_urxvt' 'urxvt256c' '_urxvt' @@ -1660,6 +1673,7 @@ _comps=( 'ypxfr' '_yp' 'ytalk' '_other_accounts' 'zargs' '_zargs' +'zathura' '_zathura' 'zcalc' '_zcalc' '-zcalc-line-' '_zcalc_line' 'zcash-cli' '_zcash-cli' @@ -1774,7 +1788,6 @@ _postpatcomps=( 'lua[0-9.-]##' '_lua' '(p[bgpn]m*|*top[bgpn]m)' '_pbm' 'php[0-9.-]' '_php' -'pip[0-9.]#' '_pip' 'pydoc[0-9.]#' '_pydoc' 'python[0-9.]#' '_python' 'qemu(|-system-*)' '_qemu' @@ -1836,195 +1849,197 @@ autoload -Uz _fd _nvm _z _extract _gh \ _artisan _atach _bat _bitcoin-cli _bootctl \ _bower _bundle _busctl _bwrap _caffeinate \ _cap _cargo _cask _ccache _cf \ - _choc _chromium _cmake _code _coffee \ - _composer _conan _concourse _console _coredumpctl \ - _cppcheck _curl _dad _debuild _dget \ - _dhcpcd _diana _docpad _drush _ecdsautil \ - _emulator _envdir _exa _exportfs _fab \ - _fail2ban-client _ffind _flatpak _fleetctl _flutter \ - _force _fwupdmgr _gas _gh _ghc \ - _gist _git-flow _git-journal _git-pulls _git-revise \ - _git-wtf _glances _glow _golang _google \ - _gpgconf _gtk-launch _hello _highlight _hledger \ - _homestead _hostnamectl _httpie _ibus _include-what-you-use \ - _inxi _jmeter _jmeter-plugins _jonas _journalctl \ - _jrnl _kak _kernel-install _kitchen _knife \ - _language_codes _libinput _lilypond _localectl _loginctl \ - _lunchy _machinectl _mc _meson _middleman \ - _mina _mix _mkinitcpio _mpv _mssh \ - _mussh _mvn _nano _nanoc _networkctl \ - _nftables _ninja _node _nvm _nvme \ - _oomctl _openssl _openvpn3 _optirun _opustools \ - _pacman _parallel _pastel _patool _perf \ - _periscope _pgsql_utils _phing _pixz _pkcon \ - _play _playerctl _pm2 _polybar _polybar_msg \ - _port _protoc _psd _pulseaudio _pygmentize \ - _qmk _rails _ralio _redis-cli _resolvectl \ - _rfkill _rg _rkt _rmlint _rslsync \ - _rspec _rsvm _rubocop _rustup _sbt \ - _scala _scrub _sdd _sd_hosts_or_user_at_host _sd_machines \ - _sd_outputmodes _sd_unit_files _setcap _setup.py _sfdx \ - _shellcheck _showoff _srm _stack _starship \ - _subl _subliminal _supervisorctl _svm _systemctl \ - _systemd _systemd-analyze _systemd-delta _systemd-inhibit _systemd-nspawn \ - _systemd-path _systemd-run _systemd-tmpfiles _tarsnap _teamocil \ - _thor _timedatectl _tmuxinator _tox _udevadm \ - _udisksctl _ufw _virtualbox _vnstat _wemux \ - _wg-quick _xinput _xsel _yaourt _yarn \ - _yay _zcash-cli _zscroll _cdr _all_labels \ - _all_matches _alternative _approximate _arg_compile _arguments \ - _bash_completions _cache_invalid _call_function _combination _complete \ - _complete_debug _complete_help _complete_help_generic _complete_tag _comp_locale \ - _correct _correct_filename _correct_word _describe _description \ - _dispatch _expand _expand_alias _expand_word _extensions \ - _external_pwds _generic _guard _history _history_complete_word \ - _ignored _list _main_complete _match _menu \ - _message _most_recent_file _multi_parts _next_label _next_tags \ - _normal _nothing _numbers _oldlist _pick_variant \ - _prefix _read_comp _regex_arguments _regex_words _requested \ - _retrieve_cache _sep_parts _sequence _set_command _setup \ - _store_cache _sub_commands _tags _user_expand _values \ - _wanted _acpi _acpitool _alsa-utils _analyseplugin \ - _basenc _brctl _btrfs _capabilities _chattr \ - _chcon _choom _chrt _cpupower _cryptsetup \ - _dkms _e2label _ethtool _findmnt _free \ - _fuse_arguments _fusermount _fuse_values _gpasswd _htop \ - _iconvconfig _ionice _ipset _iptables _iwconfig \ - _kpartx _losetup _lsattr _lsblk _lsns \ - _lsusb _ltrace _mat _mat2 _mdadm \ - _mii-tool _modutils _mondo _networkmanager _nsenter \ - _opkg _perf _pidof _pmap _qdbus \ - _schedtool _selinux_contexts _selinux_roles _selinux_types _selinux_users \ - _setpriv _setsid _slabtop _ss _sshfs \ - _strace _sysstat _tload _tpb _tracepath \ - _tune2fs _uml _unshare _valgrind _vserver \ - _wakeup_capable_devices _wipefs _wpa_cli _a2ps _aap \ - _abcde _absolute_command_paths _ack _adb _ansible \ - _ant _antiword _apachectl _apm _arch_archives \ - _arch_namespace _arp _arping _asciidoctor _asciinema \ - _at _attr _augeas _avahi _awk \ - _base64 _basename _bash _baudrates _baz \ - _beep _bibtex _bind_addresses _bison _bittorrent \ - _bogofilter _bpf_filters _bpython _bzip2 _bzr \ - _cabal _cal _calendar _canonical_paths _cat \ - _ccal _cdcd _cdrdao _cdrecord _chkconfig \ - _chmod _chown _chroot _chsh _cksum \ - _clay _cmdambivalent _cmdstring _cmp _column \ - _comm _composer _compress _configure _cowsay \ - _cp _cpio _cplay _crontab _cscope \ - _csplit _cssh _ctags _ctags_tags _curl \ - _cut _cvs _darcs _date _date_formats \ - _dates _dbus _dconf _dd _devtodo \ - _df _dhclient _dict _dict_words _diff \ - _diff3 _diff_options _diffstat _dig _directories \ - _dir_list _django _dmesg _dmidecode _dns_types \ - _doas _domains _dos2unix _drill _dropbox \ - _dsh _dtruss _du _dvi _ecasound \ - _ed _elfdump _elinks _email_addresses _enscript \ - _entr _env _espeak _etags _fakeroot \ - _feh _fetchmail _ffmpeg _figlet _file_modes \ - _files _file_systems _find _find_net_interfaces _finger \ - _flac _flex _fmt _fold _fortune \ - _fsh _fuser _gcc _gcore _gdb \ - _gem _genisoimage _getconf _getent _getfacl \ - _getmail _getopt _ghostscript _git _global \ - _global_tags _gnu_generic _gnupod _gnutls _go \ - _gpg _gphoto2 _gprof _gradle _graphicsmagick \ - _grep _groff _groups _growisofs _gsettings \ - _guilt _gzip _have_glob_qual _head _hexdump \ - _host _hostname _hosts _iconv _id \ - _ifconfig _iftop _imagemagick _initctl _init_d \ - _install _iostat _ip _ipsec _irssi \ - _ispell _java _java_class _joe _join \ - _jq _killall _knock _kvno _last \ - _ldconfig _ldd _ld_debug _less _lha \ - _libvirt _links _list_files _lldb _ln \ - _loadkeys _locale _localedef _locales _locate \ - _logger _look _lp _ls _lsof \ - _lua _luarocks _lynx _lz4 _lzop \ - _mail _mailboxes _make _man _md5sum \ - _mencal _mh _mime_types _mkdir _mkfifo \ - _mknod _mktemp _module _monotone _moosic \ - _mosh _mount _mpc _mt _mtools \ - _mtr _mutt _mv _my_accounts _myrepos \ - _mysqldiff _mysql_utils _ncftp _netcat _net_interfaces \ - _netstat _newsgroups _nginx _ngrep _nice \ - _nkf _nl _nm _nmap _npm \ - _nslookup _numfmt _objdump _object_files _od \ - _openstack _opustools _other_accounts _pack _pandoc \ - _paste _patch _patchutils _path_commands _path_files \ - _pax _pbm _pdf _perforce _perl \ - _perl_basepods _perldoc _perl_modules _pgids _pgrep \ - _php _picocom _pids _pine _ping \ - _pip _pkgadd _pkg-config _pkginfo _pkg_instance \ - _pkgrm _pon _ports _postfix _postgresql \ - _postscript _pr _printenv _printers _process_names \ - _prove _ps _pspdf _psutils _ptx \ - _pump _pv _pwgen _pydoc _python \ - _python_modules _qemu _quilt _rake _ranlib \ - _rar _rclone _rcs _readelf _readlink \ - _remote_files _renice _ri _rlogin _rm \ - _rmdir _route _rrdtool _rsync _rubber \ - _ruby _runit _samba _sccs _scons \ - _screen _script _seafile _sed _seq \ - _service _services _setfacl _sh _shasum \ - _showmount _shred _shuf _shutdown _signals \ - _sisu _slrn _smartmontools _socket _sort \ - _spamassassin _split _sqlite _sqsh _ssh \ - _ssh_hosts _stat _stdbuf _stgit _stow \ - _strings _strip _stty _su _subversion \ - _sudo _surfraw _swaks _swanctl _swift \ - _sys_calls _sysctl _tac _tail _tar \ - _tar_archive _tardy _tcpdump _tcptraceroute _tee \ - _telnet _terminals _tex _texi _texinfo \ - _tidy _tiff _tilde_files _timeout _time_zone \ - _tin _tla _tmux _todo.sh _toilet \ - _top _topgit _totd _touch _tput \ - _tr _transmission _tree _truncate _truss \ - _tty _ttys _twidge _twisted _umountable \ - _unace _uname _unexpand _uniq _unison \ - _units _uptime _urls _user_admin _user_at_host \ - _users _users_on _vi _vim _visudo \ - _vmstat _vorbis _vpnc _w _w3m \ - _watch _wc _webbrowser _wget _whereis \ - _who _whois _wiggle _xargs _xmlsoft \ - _xmlstarlet _xmms2 _xxd _xz _yafc \ - _yodl _yp _zcat _zdump _zfs \ - _zfs_dataset _zfs_pool _zip _zsh _acroread \ - _code _dcop _eog _evince _geany \ - _gnome-gv _gqview _gv _kdeconnect _kfmclient \ - _matlab _mozilla _mplayer _mupdf _nautilus \ - _nedit _netscape _okular _pdftk _qiv \ - _rdesktop _setxkbmap _sublimetext _urxvt _vnc \ - _x_arguments _xauth _xautolock _x_borderwidth _xclip \ - _x_color _x_colormapid _x_cursor _x_display _xdvi \ - _x_extension _xfig _x_font _xft_fonts _x_geometry \ - _xinput _x_keysym _xloadimage _x_locale _x_modifier \ - _xmodmap _x_name _xournal _xpdf _xrandr \ - _x_resource _xscreensaver _x_selection_timeout _xset _xt_arguments \ - _xterm _x_title _xt_session_id _x_utils _xv \ - _x_visual _x_window _xwit _zeal _add-zle-hook-widget \ - _add-zsh-hook _alias _aliases __arguments _arrays \ - _assign _autocd _bindkey _brace_parameter _builtin \ - _cd _command _command_names _compadd _compdef \ - _completers _condition _default _delimiters _directory_stack \ - _dirs _disable _dynamic_directory_name _echotc _echoti \ - _emulate _enable _equal _exec _fc \ - _file_descriptors _first _functions _globflags _globqual_delims \ - _globquals _hash _history_modifiers _in_vared _jobs \ - _jobs_bg _jobs_builtin _jobs_fg _kill _limit \ - _limits _math _math_params _mere _module_math_func \ - _options _options_set _options_unset _parameter _parameters \ - _precommand _print _prompt _ps1234 _read \ - _redirect _run-help _sched _set _setopt \ - _source _strftime _subscript _suffix_alias_files _tcpsys \ - _tilde _trap _ttyctl _typeset _ulimit \ - _unhash _user_math_func _value _vared _vars \ - _vcs_info _vcs_info_hooks _wait _which _widgets \ - _zargs _zattr _zcalc _zcalc_line _zcompile \ - _zed _zftp _zle _zmodload _zmv \ - _zparseopts _zpty _zsh-mime-handler _zsocket _zstyle \ - _ztodo + _checkupdates _choc _chromium _cmake _code \ + _coffee _composer _conan _concourse _console \ + _coredumpctl _cppcheck _curl _dad _debuild \ + _dget _dhcpcd _diana _docpad _drush \ + _ecdsautil _emulator _envdir _exa _exportfs \ + _fab _fail2ban-client _ffind _flatpak _fleetctl \ + _flutter _force _fwupdmgr _gas _gh \ + _ghc _gist _git-flow _git-journal _git-pulls \ + _git-revise _git-wtf _glances _glow _golang \ + _google _gpgconf _gtk-launch _handlr _hello \ + _highlight _hledger _homestead _hostnamectl _httpie \ + _ibus _include-what-you-use _inxi _jmeter _jmeter-plugins \ + _jonas _journalctl _jrnl _kak _kernel-install \ + _kitchen _knife _language_codes _libinput _lilypond \ + _localectl _loginctl _lunchy _machinectl _mc \ + _mdcat _mdless _meson _middleman _mina \ + _mix _mkinitcpio _mpv _mssh _mussh \ + _mvn _nano _nanoc _networkctl _nftables \ + _ninja _node _nvm _nvme _oomctl \ + _openssl _openvpn3 _optirun _opustools _paccache \ + _pacdiff _paclist _paclog-pkglist _pacman _pacscripts \ + _pacsearch _pacsort _pactree _pastel _patool \ + _perf _periscope _pgsql_utils _phing _pixz \ + _pkcon _play _playerctl _pm2 _polybar \ + _polybar_msg _port _protoc _psd _pulseaudio \ + _pygmentize _qmk _rails _ralio _rankmirrors \ + _redis-cli _resolvectl _rfkill _rg _rkt \ + _rmlint _rslsync _rspec _rsvm _rubocop \ + _rustup _sbt _scala _scrub _sdd \ + _sd_hosts_or_user_at_host _sd_machines _sd_outputmodes _sd_unit_files _setcap \ + _setup.py _sfdx _shellcheck _showoff _srm \ + _stack _starship _subl _subliminal _supervisorctl \ + _svm _systemctl _systemd _systemd-analyze _systemd-delta \ + _systemd-inhibit _systemd-nspawn _systemd-path _systemd-run _systemd-tmpfiles \ + _tarsnap _teamocil _thor _timedatectl _tmuxinator \ + _tox _udevadm _udisksctl _ufw _updpkgsums \ + _virtualbox _vnstat _wemux _wg-quick _xinput \ + _xsel _yaourt _yarn _yay _zathura \ + _zcash-cli _zscroll _cdr _all_labels _all_matches \ + _alternative _approximate _arg_compile _arguments _bash_completions \ + _cache_invalid _call_function _combination _complete _complete_debug \ + _complete_help _complete_help_generic _complete_tag _comp_locale _correct \ + _correct_filename _correct_word _describe _description _dispatch \ + _expand _expand_alias _expand_word _extensions _external_pwds \ + _generic _guard _history _history_complete_word _ignored \ + _list _main_complete _match _menu _message \ + _most_recent_file _multi_parts _next_label _next_tags _normal \ + _nothing _numbers _oldlist _pick_variant _prefix \ + _read_comp _regex_arguments _regex_words _requested _retrieve_cache \ + _sep_parts _sequence _set_command _setup _store_cache \ + _sub_commands _tags _user_expand _values _wanted \ + _acpi _acpitool _alsa-utils _analyseplugin _basenc \ + _brctl _btrfs _capabilities _chattr _chcon \ + _choom _chrt _cpupower _cryptsetup _dkms \ + _e2label _ethtool _findmnt _free _fuse_arguments \ + _fusermount _fuse_values _gpasswd _htop _iconvconfig \ + _ionice _ipset _iptables _iwconfig _kpartx \ + _losetup _lsattr _lsblk _lsns _lsusb \ + _ltrace _mat _mat2 _mdadm _mii-tool \ + _modutils _mondo _networkmanager _nsenter _opkg \ + _perf _pidof _pmap _qdbus _schedtool \ + _selinux_contexts _selinux_roles _selinux_types _selinux_users _setpriv \ + _setsid _slabtop _ss _sshfs _strace \ + _sysstat _tload _tpb _tracepath _tune2fs \ + _uml _unshare _valgrind _vserver _wakeup_capable_devices \ + _wipefs _wpa_cli _a2ps _aap _abcde \ + _absolute_command_paths _ack _adb _ansible _ant \ + _antiword _apachectl _apm _arch_archives _arch_namespace \ + _arp _arping _asciidoctor _asciinema _at \ + _attr _augeas _avahi _awk _base64 \ + _basename _bash _baudrates _baz _beep \ + _bibtex _bind_addresses _bison _bittorrent _bogofilter \ + _bpf_filters _bpython _bzip2 _bzr _cabal \ + _cal _calendar _canonical_paths _cat _ccal \ + _cdcd _cdrdao _cdrecord _chkconfig _chmod \ + _chown _chroot _chsh _cksum _clay \ + _cmdambivalent _cmdstring _cmp _column _comm \ + _composer _compress _configure _cowsay _cp \ + _cpio _cplay _crontab _cscope _csplit \ + _cssh _ctags _ctags_tags _curl _cut \ + _cvs _darcs _date _date_formats _dates \ + _dbus _dconf _dd _devtodo _df \ + _dhclient _dict _dict_words _diff _diff3 \ + _diff_options _diffstat _dig _directories _dir_list \ + _django _dmesg _dmidecode _dns_types _doas \ + _domains _dos2unix _drill _dropbox _dsh \ + _dtruss _du _dvi _ecasound _ed \ + _elfdump _elinks _email_addresses _enscript _entr \ + _env _espeak _etags _fakeroot _feh \ + _fetchmail _ffmpeg _figlet _file_modes _files \ + _file_systems _find _find_net_interfaces _finger _flac \ + _flex _fmt _fold _fortune _fsh \ + _fuser _gcc _gcore _gdb _gem \ + _genisoimage _getconf _getent _getfacl _getmail \ + _getopt _ghostscript _git _global _global_tags \ + _gnu_generic _gnupod _gnutls _go _gpg \ + _gphoto2 _gprof _gradle _graphicsmagick _grep \ + _groff _groups _growisofs _gsettings _guilt \ + _gzip _have_glob_qual _head _hexdump _host \ + _hostname _hosts _iconv _id _ifconfig \ + _iftop _imagemagick _initctl _init_d _install \ + _iostat _ip _ipsec _irssi _ispell \ + _java _java_class _joe _join _jq \ + _killall _knock _kvno _last _ldconfig \ + _ldd _ld_debug _less _lha _libvirt \ + _links _list_files _lldb _ln _loadkeys \ + _locale _localedef _locales _locate _logger \ + _look _lp _ls _lsof _lua \ + _luarocks _lynx _lz4 _lzop _mail \ + _mailboxes _make _man _md5sum _mencal \ + _mh _mime_types _mkdir _mkfifo _mknod \ + _mktemp _module _monotone _moosic _mosh \ + _mount _mpc _mt _mtools _mtr \ + _mutt _mv _my_accounts _myrepos _mysqldiff \ + _mysql_utils _ncftp _netcat _net_interfaces _netstat \ + _newsgroups _nginx _ngrep _nice _nkf \ + _nl _nm _nmap _npm _nslookup \ + _numfmt _objdump _object_files _od _openstack \ + _opustools _other_accounts _pack _pandoc _paste \ + _patch _patchutils _path_commands _path_files _pax \ + _pbm _pdf _perforce _perl _perl_basepods \ + _perldoc _perl_modules _pgids _pgrep _php \ + _picocom _pids _pine _ping _pkgadd \ + _pkg-config _pkginfo _pkg_instance _pkgrm _pon \ + _ports _postfix _postgresql _postscript _pr \ + _printenv _printers _process_names _prove _ps \ + _pspdf _psutils _ptx _pump _pv \ + _pwgen _pydoc _python _python_modules _qemu \ + _quilt _rake _ranlib _rar _rclone \ + _rcs _readelf _readlink _remote_files _renice \ + _ri _rlogin _rm _rmdir _route \ + _rrdtool _rsync _rubber _ruby _runit \ + _samba _sccs _scons _screen _script \ + _seafile _sed _seq _service _services \ + _setfacl _sh _shasum _showmount _shred \ + _shuf _shutdown _signals _sisu _slrn \ + _smartmontools _socket _sort _spamassassin _split \ + _sqlite _sqsh _ssh _ssh_hosts _stat \ + _stdbuf _stgit _stow _strings _strip \ + _stty _su _subversion _sudo _surfraw \ + _swaks _swanctl _swift _sys_calls _sysctl \ + _tac _tail _tar _tar_archive _tardy \ + _tcpdump _tcptraceroute _tee _telnet _terminals \ + _tex _texi _texinfo _tidy _tiff \ + _tilde_files _timeout _time_zone _tin _tla \ + _tmux _todo.sh _toilet _top _topgit \ + _totd _touch _tput _tr _transmission \ + _tree _truncate _truss _tty _ttys \ + _twidge _twisted _umountable _unace _uname \ + _unexpand _uniq _unison _units _uptime \ + _urls _user_admin _user_at_host _users _users_on \ + _vi _vim _visudo _vmstat _vorbis \ + _vpnc _w _w3m _watch _wc \ + _webbrowser _wget _whereis _who _whois \ + _wiggle _xargs _xmlsoft _xmlstarlet _xmms2 \ + _xxd _xz _yafc _yodl _yp \ + _zcat _zdump _zfs _zfs_dataset _zfs_pool \ + _zip _zsh _acroread _code _dcop \ + _eog _evince _geany _gnome-gv _gqview \ + _gv _kdeconnect _kfmclient _matlab _mozilla \ + _mplayer _mupdf _nautilus _nedit _netscape \ + _okular _pdftk _qiv _rdesktop _setxkbmap \ + _sublimetext _urxvt _vnc _x_arguments _xauth \ + _xautolock _x_borderwidth _xclip _x_color _x_colormapid \ + _x_cursor _x_display _xdvi _x_extension _xfig \ + _x_font _xft_fonts _x_geometry _xinput _x_keysym \ + _xloadimage _x_locale _x_modifier _xmodmap _x_name \ + _xournal _xpdf _xrandr _x_resource _xscreensaver \ + _x_selection_timeout _xset _xt_arguments _xterm _x_title \ + _xt_session_id _x_utils _xv _x_visual _x_window \ + _xwit _zeal _add-zle-hook-widget _add-zsh-hook _alias \ + _aliases __arguments _arrays _assign _autocd \ + _bindkey _brace_parameter _builtin _cd _command \ + _command_names _compadd _compdef _completers _condition \ + _default _delimiters _directory_stack _dirs _disable \ + _dynamic_directory_name _echotc _echoti _emulate _enable \ + _equal _exec _fc _file_descriptors _first \ + _functions _globflags _globqual_delims _globquals _hash \ + _history_modifiers _in_vared _jobs _jobs_bg _jobs_builtin \ + _jobs_fg _kill _limit _limits _math \ + _math_params _mere _module_math_func _options _options_set \ + _options_unset _parameter _parameters _precommand _print \ + _prompt _ps1234 _read _redirect _run-help \ + _sched _set _setopt _source _strftime \ + _subscript _suffix_alias_files _tcpsys _tilde _trap \ + _ttyctl _typeset _ulimit _unhash _user_math_func \ + _value _vared _vars _vcs_info _vcs_info_hooks \ + _wait _which _widgets _zargs _zattr \ + _zcalc _zcalc_line _zcompile _zed _zftp \ + _zle _zmodload _zmv _zparseopts _zpty \ + _zsh-mime-handler _zsocket _zstyle _ztodo autoload -Uz +X _call_program typeset -gUa _comp_assocs diff --git a/.config/zsh/.zcompdump-arch-5.9.zwc b/.config/zsh/.zcompdump-arch-5.9.zwc index 933f242c..374ee133 100644 Binary files a/.config/zsh/.zcompdump-arch-5.9.zwc and b/.config/zsh/.zcompdump-arch-5.9.zwc differ diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 65c93444..60d87d32 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -29,7 +29,7 @@ setopt incappendhistory # Immediately append to the history file, not just ##### GTK EXPORTS # export GTK_THEME=TokyoNight # export GTK_RC_FILES="$XDG_CONFIG_HOME"/gtk-1.0/gtkrc -# export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc +export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc # export GDK_BACKEND=x11 # export GTK_CSD=0 # titlebars export GTK_USE_PORTAL=1 @@ -65,7 +65,7 @@ export GOPATH="$XDG_DATA_HOME"/go export GOMODCACHE="$XDG_CACHE_HOME"/go/mod ##### MISC EXPORTS -# export GNUPGHOME="$XDG_DATA_HOME"/gnupg +export GNUPGHOME="$XDG_DATA_HOME"/gnupg export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc export ANDROID_SDK_HOME="$XDG_CONFIG_HOME"/android @@ -217,7 +217,7 @@ source /usr/share/doc/git-extras/git-extras-completion.zsh # gpg (for Github) # export GPG_TTY="$(tty)" -eval $(keychain --eval --quiet id_ed25519 id_rsa) +eval $(keychain --dir "$XDG_RUNTIME_DIR"/keychain --eval --quiet id_ed25519 id_rsa ) ########## ALIASES alias edit-i3="micro ~/dotfiles/.config/i3/config" @@ -226,7 +226,9 @@ alias edit-zsh="micro ~/dotfiles/.config/zsh/.zshrc" alias cat='bat' alias bat='bat' alias nano='micro' +alias flattendir='find . -mindepth 2 -type f -print -exec mv {} . \;' alias emptydirs='find . -type d -empty -delete' +alias count='ls | wc -l' alias dotfiles='~/dotfiles' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' @@ -282,8 +284,11 @@ path+=('$HOME/.cargo/bin') path+=('$HOME/.local/share/cargo/bin') # java path+=('$HOME/.jenv/bin') +# console ninja +path+=('~/.console-ninja/.bin') export PATH +# jenv eval "$(jenv init -)" # zsh-syntax-highlighting and autosuggestions diff --git a/.fehbg b/.fehbg deleted file mode 100755 index 5c98d17f..00000000 --- a/.fehbg +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -feh --no-fehbg --bg-fill '/home/kaizen/.wallpaper.jpg' diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 00000000..0003816d --- /dev/null +++ b/.github/README.md @@ -0,0 +1,397 @@ +# Wallpapers + +This README is auto-generated. You may view its source code [here](docgen.py). +Showcases are randomly chosen. Files are shuffled then first two +from each category are chosen. + +## Showcase + +Categorized wallpaper showcase. two pictures per category. + +## painting + +paint

+ +dreamoftheredchamber

+ +[Browse](../painting/README.md) + +## m-26.jp + +11

+ +14

+ +[Browse](../m-26.jp/README.md) + +## abstract + +d0a.1.0

+ +arabia-gruv

+ +[Browse](../abstract/README.md) + +## interior + +empty-living-room-with-blue-sofa-plants-table-empty-white-wall-background-3d-rendering

+ +clay-banks-0hG9jeO74-w-unsplash

+ +[Browse](../interior/README.md) + +## apocalypse + +kanistra-studio-13-crossing

+ +kanistra-studio-20-workplace

+ +[Browse](../apocalypse/README.md) + +## flowers + +andrea-tummons-oPW-njJj1oM-unsplash

+ +wallhaven-q6253r_3840x2160

+ +[Browse](../flowers/README.md) + +## fauna + +44 - sgNnIlC

+ +103 - qlVeiGJ

+ +[Browse](../fauna/README.md) + +## cold + +w5fohvw1xv191

+ +undefined - Imgur

+ +[Browse](../cold/README.md) + +## mountain + +extra-12

+ +5

+ +[Browse](../mountain/README.md) + +## pixel + +PixelartCity

+ +a00cdcb59e25e8c96ca947c919a1e13f

+ +[Browse](../pixel/README.md) + +## architecture + +CITYSCAPE1142023

+ +175fe5597b12c33ba7c9864404772bbd

+ +[Browse](../architecture/README.md) + +## logo + +wallhaven-eo5vgw

+ +wallhaven-j5o5my

+ +[Browse](../logo/README.md) + +## lightbulb + +ruthson-zimmerman-MAawiPJCQN8-unsplash

+ +black-pendent-lamps

+ +[Browse](../lightbulb/README.md) + +## poly + +pokemon-pixel-4k

+ +buildings

+ +[Browse](../poly/README.md) + +## gruvbox + +od_4

+ +od_1

+ +[Browse](../gruvbox/README.md) + +## apeiros + +ocean_front_2

+ +rock_2

+ +[Browse](../apeiros/README.md) + +## retro + +topk5

+ +jpn

+ +[Browse](../retro/README.md) + +## weirdcode + +1687155287949789

+ +1687154664825712

+ +[Browse](../weirdcode/README.md) + +## aerial + +114578-coffee-cup-simple-background-minimalism

+ +MoarBeach

+ +[Browse](../aerial/README.md) + +## nature + +erwan-hesry-WIdhyut3bp4-unsplash

+ +forest-river-misty

+ +[Browse](../nature/README.md) + +## nord + +64m36y0xpf561

+ +Nord Day

+ +[Browse](../nord/README.md) + +## geometry + +wallhaven-z8pdqo

+ +wallhaven-g8x697

+ +[Browse](../geometry/README.md) + +## evangelion + +748657

+ +evangelion-unit-002-red

+ +[Browse](../evangelion/README.md) + +## centered + +da14a00f4cf6294c351ef473c3787d77

+ +0fd979f8891feab2ce0ad52a97294eb2

+ +[Browse](../centered/README.md) + +## chillop + +wallhaven-3zp6o9

+ +20210817_004904

+ +[Browse](../chillop/README.md) + +## minimal + +sleepy_mountains_dark_v02

+ +8337e8bf18303f6aa4c348261322d07e

+ +[Browse](../minimal/README.md) + +## manga + +1183004

+ +582

+ +[Browse](../manga/README.md) + +## boccha + +cat-boccha-big

+ +cat-boccha-small

+ +[Browse](../boccha/README.md) + +## paper + +1647935972998

+ +1648005473077

+ +[Browse](../paper/README.md) + +## solarized + +wallhaven-ymdvjg

+ +ketqb6blpnt81

+ +[Browse](../solarized/README.md) + +## outrun + +r

+ +neon

+ +[Browse](../outrun/README.md) + +## digital + +s61f586j38aa1

+ +ll5spy1k38aa1

+ +[Browse](../digital/README.md) + +## fogsmoke + +6

+ +mont_des_ranges_saint-colomban-des-villards

+ +[Browse](../fogsmoke/README.md) + +## basalt + +basalt

+ +sarah-thorenz-eeh_ardhh0k-unsplash

+ +[Browse](../basalt/README.md) + +## radium + +OD_house_night_sat

+ +output-1659958155

+ +[Browse](../radium/README.md) + +## animated + +fireplace

+ +qo1zd98o0ghb1

+ +[Browse](../animated/README.md) + +## cherry + +nikhil-kumar-JdPHvI7VF0o-unsplash

+ +cherry-blossom-white

+ +[Browse](../cherry/README.md) + +## halloween + +scott-webb-sEX6PAx4lGs-unsplash

+ +freestocks-y_dCjaRWthY-unsplash

+ +[Browse](../halloween/README.md) + +## unsorted + +140 - K9Z0tmJ

+ +unknown

+ +[Browse](../unsorted/README.md) + +## monochrome + +monochrome-eye-character

+ +denny-muller-zgrakjjOfGk-unsplash

+ +[Browse](../monochrome/README.md) + +## anime + +53 - 5mfxcOd

+ +wallhaven-q63vdr

+ +[Browse](../anime/README.md) + +## dreamcore + +alex-bierwagen-Uuz7yti7SQA-unsplash

+ +emma-steinhobel-uYyK5wQwvS8-unsplash

+ +[Browse](../dreamcore/README.md) + +## jackb + +wallhaven-6ox1ql

+ +wallhaven-v981x8

+ +[Browse](../jackb/README.md) + +## spam + +car

+ +Dark red Japan

+ +[Browse](../spam/README.md) + +## Sources + +Following are roughly the sources from where I scraped these images from. + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + +## Ending Note + +You may use [download-directory](https://download-directory.github.io) for downloading a specific directory. + +I do not own these images. All credits belong to the respective artists. diff --git a/.github/config.ini b/.github/config.ini new file mode 100644 index 00000000..4ac21feb --- /dev/null +++ b/.github/config.ini @@ -0,0 +1,8 @@ +[DEFAULT] +source = docgen.py +download = https://download-directory.github.io +spacing = 1 +choose = 2 +dry = false +browse = true +exclude = tile:devicons diff --git a/.github/docgen.py b/.github/docgen.py new file mode 100755 index 00000000..8b7eeead --- /dev/null +++ b/.github/docgen.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python + +from configparser import ConfigParser +from json import dumps +from os import listdir +from os.path import isfile +from pathlib import Path +from random import shuffle +from typing import Callable + + +def get_config(config_path: Path = Path("./.github/config.ini")) -> dict[str, str]: + parser = ConfigParser() + parser.read_string(config_path.read_text()) + return dict(parser.defaults()) + + +def categorical_wallpapers(exclude: str | list[str] = []) -> dict[str, list[Path]]: + exclude = exclude.split(":") if type(exclude) is str else exclude + return { + # exclude categorical README.md + str(category): [Path(picture) for picture in listdir(category) if picture != "README.md"] + # exclude hidden directories and README.md + for category in listdir(".") + if not category.startswith(".") and not isfile(category) and category not in exclude + } + + +def get_templates() -> dict[str, str]: + return {template: Path(f".github/templates/{template}").read_text() for template in listdir(".github/templates")} + + +def generate_shuffled( + config: dict[str, str], + categories: dict[str, list[Path]], +) -> dict[str, list[Path]]: + results = {} + choose = int(config["choose"]) + for category, pictures in categories.items(): + shuffle(pictures) + results[category] = pictures[:choose] + return results + + +def prime_templates( + config: dict[str, str], + handlers: dict[str, Callable], + templates: dict[str, str] = get_templates(), +): + return { + template: handlers[template](template, string, config) if template in handlers else string.format(**config) + for template, string in templates.items() + } + + +# Handlers {{{ +def handle_body(_, string: str, config: dict[str, str]) -> str: + shuffled = generate_shuffled(config, categorical_wallpapers(config["exclude"])) + results = [] + spacing = "\n" * int(config["spacing"]) + for category, pictures in shuffled.items(): + merged = {"category": category} | config + results.append(f"## {category}{spacing}") + for picture in pictures: + merged["random"] = str(picture) + merged["random_stem"] = picture.stem + results.append(string.format(**merged)) + if config["browse"].casefold() == "True".casefold(): + results.append(f"[Browse](../{category}/README.md){spacing}") + return spacing.join(results) + + +def handle_category(_, string: str, config: dict[str, str]) -> dict[str, str]: + results = {} + spacing = "\n" * int(config["spacing"]) + for category, pictures in categorical_wallpapers().items(): + readme = f"{category}/README.md" + results[readme] = f"# {category}\n\n" + for picture in pictures: + merged = config | {"filepath": str(picture), "filename": picture.stem} + results[readme] = f"{results[readme]}{string.format(**merged)}{spacing}" + return results +# }}} + + +if __name__ == "__main__": + CONFIG = get_config() + primed = prime_templates(CONFIG, {"body.category.md": handle_body, "category.md": handle_category}) + full_templates = ["heading", "body.heading", "body.category", "sources", "conclusion"] # ordered + full_templates = [primed[f"{item}.md"] for item in full_templates] + partial_template = primed["category.md"] + + if CONFIG["dry"].casefold() == "True".casefold(): + print(dumps({"full": full_templates, "partial": partial_template})) # use this with jq/fq + else: + Path(".github/README.md").write_text(("\n" * int(CONFIG["spacing"])).join(full_templates)) + for category, readme in partial_template.items(): + Path(category).write_text(readme) diff --git a/.github/ftaudit.py b/.github/ftaudit.py new file mode 100644 index 00000000..63ac160f --- /dev/null +++ b/.github/ftaudit.py @@ -0,0 +1,325 @@ +from enum import Enum +from itertools import chain +from os import walk +from typing import NamedTuple, Optional, TypeVar, Union, Generic, cast + +import filetype as ft +import json +import os.path as path +import shutil +import sys + + +OkT, ErrT = TypeVar("R"), TypeVar("E") + + +class Result(Generic[OkT, ErrT]): + def unwrap(self) -> OkT: + if self.ok is True: + return cast(OkT, self.value) + + raise ValueError("Attempted to unwrap an Err value.") + + def __init__(self, value: Union[OkT, ErrT], ok: bool): + self.value = value + self.ok = ok + + +class Ok(Generic[OkT, ErrT], Result[OkT, ErrT]): + def __init__(self, value: OkT): + super().__init__(value, True) + + +class Err(Generic[OkT, ErrT], Result[OkT, ErrT]): + def __init__(self, value: ErrT): + super().__init__(value, False) + + +Discrepancy = NamedTuple( + "T", [("file_path", str), ("incorrect", str), ("correct", str)] +) + + +def examine_file(file_path: str) -> Result[Optional[Discrepancy], str]: + if not path.isfile(file_path): + return Err(f'The path "{file_path}" is not a valid file.') + + file_type = ft.guess(file_path) + + if file_type is None: + return Err(f'Could not determine file type for "{file_path}"') + + file_extension: str = path.splitext(file_path)[1].lower()[1:] + + # Standardize multiple accepted extensions down to a single extension, the + # one used by the file type library, as it does not recognize alternative + # extensions, only one extension per file type. + + file_extension = {"jpeg": "jpg", "tiff": "tif"}.get( + file_extension, file_extension + ) + + # Mismatch between the expected extension for the determined file type, + # and the actual extension of the file. + + if file_type.extension != file_extension: + return Ok( + Discrepancy( + file_path=file_path, + incorrect=file_extension, + correct=file_type.extension, + ) + ) + + # No discrepancy. + return Ok(None) + + +def generate_csv_report( + discrepancies: list[Discrepancy], delimiter="," +) -> Result[list[str], str]: + if len(discrepancies) == 0: + return Err("No discrepancies to report.") + + try: + report: list[str] = [ + f"IncorrectExtension{delimiter}CorrectExtension{delimiter}FilePath", + *[ + f"{d.incorrect}{delimiter}{d.correct}{delimiter}{d.file_path}" + for d in discrepancies + ], + ] + except Exception as e: + return Err(f"Encountered an exception while generating CSV report: {e}") + + return Ok(report) + + +def generate_json_report( + discrepancies: list[Discrepancy], +) -> Result[list[dict], str]: + if len(discrepancies) == 0: + return Err("No discrepancies to report.") + + try: + report: list[dict] = [ + { + "file_path": d.file_path, + "incorrect": d.incorrect, + "correct": d.correct, + } + for d in discrepancies + ] + except Exception as e: + return Err( + f"Encountered an exception while generating JSON report: {e}" + ) + + return Ok(report) + + +def fix_discrepancies( + discrepancies: list[Discrepancy], what_if: bool = True +) -> Result[None, str]: + def fix_discrepancy(discrepancy: Discrepancy) -> Result[None, str]: + try: + wrong_abs: str = path.abspath(discrepancy.file_path) + wrong_bas: str = path.basename(wrong_abs) + wrong_spl: tuple[str, str] = path.split(wrong_abs) + wrong_nex: str = path.splitext(wrong_bas)[0] + + correct_abs: str = path.join( + wrong_spl[0], f"{wrong_nex}.{discrepancy.correct}" + ) + + if what_if: + print(f'Would move "{wrong_abs}" to "{correct_abs}"') + else: + try: + shutil.move(wrong_abs, correct_abs) + except Exception as e: + return Err( + f'Encountered an exception while fixing discrepancy "{discrepancy.file_path}" -> "{discrepancy.correct}": {e}' + ) + except OSError as e: + return Err( + f"Encountered an exception while fixing discrepancy: {e}" + ) + + return Ok(None) + + for d in discrepancies: + fix_discrepancy(d) + + # r = map(fix_discrepancy, discrepancies) + return Ok(None) + + +# If this isn't faster than glob, I'm going to be very disappointed. +def gather_file_paths(start_path: str) -> Result[list[str], str]: + return Ok( + [ + *chain.from_iterable( + map( + lambda x: map(lambda y: path.join(x[0], y), x[2]), + walk(start_path), + ) + ) + ] + ) + + +HELP: str = """ + +Usage: python ftaudit.py [OPTIONS] + +-------------------------------------------------------------------------------- + +General Options: + -h, --help Show this help message and exit. + -p, --path Set the path of the starting directory from which to + search from. Default: current directory, '.' + +Output: + -o, --output [FILE] In addition to stdout, write the report to a file. + + -c, --csv Writes a CSV report to stdout, rather than plaintext. + + -j, --json Writes a JSON report to stdout, rather than plaintext. + -i, --indent Set the indentation level for JSON output. Default: 4. + +-------------------------------------------------------------------------------- + +Modifying Operations: + -f, --fix Automatically fix the file extensions of any files + with divergent extensions. Not set by default. + + -w, --what-if Simulates the effects of the --fix option, but does not + actually modify any files. Not set by default. +""" + +OutputFormat = Enum("OutputFormat", ("Text", "Json", "CSV")) + +if __name__ == "__main__": + search_start: str = "." + fixing_enabled: bool = False + output_format: OutputFormat = OutputFormat.Text + output_file: Optional[str] = None + json_indent: int = 4 + what_if: bool = False + + for index, argument in enumerate(sys.argv): + next_argument: str | None = ( + sys.argv[index + 1] if index + 1 < len(sys.argv) else None + ) + + if argument in ("--help", "-h"): + print(HELP) + exit(0) + + elif argument in ("--csv", "-c"): + output_format = OutputFormat.CSV + + elif argument in ("--json", "-j"): + output_format = OutputFormat.Json + + elif argument in ("--fix", "-f"): + fixing_enabled = True + + elif argument in ("--what-if", "-w"): + what_if = True + + if not isinstance(next_argument, str): + continue + + if argument in ("--path", "-p"): + search_start = next_argument + + elif argument in ("--output", "-o"): + output_file = next_argument + + elif argument in ("--indent", "-i"): + try: + json_indent = int(next_argument) + except ValueError as e: + print( + f'Invalid indent value: "{next_argument}"; must be convertible to an integer.' + ) + print(f"Exception: {e}") + exit(1) + except Exception as e: + print( + f'Unexpected exception when converting "{next_argument}" to an integer: {e}' + ) + + r_file_list: Result[list[str], str] = gather_file_paths(search_start) + + if not r_file_list.ok: + print(r_file_list.value) + exit(1) + + file_list: list[str] = r_file_list.unwrap() + + map(lambda fp: examine_file(fp), file_list) + + results = map(lambda fp: examine_file(fp), file_list) + + discrepant_results: list[Discrepancy] = [ + *map( + Result.unwrap, + filter(lambda r: r.ok and r.unwrap() is not None, results), + ) + ] + + output: Optional[str] = None + + if output_format == OutputFormat.Text: + output = "\n".join( + [ + f"{r.incorrect} should be {r.correct} for file {r.file_path}" + for r in discrepant_results + ] + ) + + elif output_format == OutputFormat.Json: + json_report = generate_json_report(discrepant_results) + + if json_report.ok: + output = json.dumps(json_report.unwrap(), indent=json_indent) + else: + print(json_report.value) + exit(1) + + elif output_format == OutputFormat.CSV: + csv_report = generate_csv_report(discrepant_results) + + if csv_report.ok: + output = "\n".join(csv_report.unwrap()) + else: + print(csv_report.value) + exit(1) + + if output is None: + print( + f"No output was generated for format {output_format}. This could be a bug." + ) + exit(1) + + print(output) + + try: + if isinstance(output_file, str): + with open(output_file, "w+") as io: + io.write(output) + except Exception as e: + print( + f"Encountered an exception while writing to output file {output_file}: {e}" + ) + exit(1) + + # This should be the very last operation, since it has the ability to modify + # file names. Keeping it last ensures that any errors will have occurred before + # this point, minimizing risk for the uncertain (I miss Rust). + + if fixing_enabled: + fix_discrepancies(discrepant_results, what_if) diff --git a/.github/templates/body.category.md b/.github/templates/body.category.md new file mode 100644 index 00000000..258d4088 --- /dev/null +++ b/.github/templates/body.category.md @@ -0,0 +1 @@ +{random_stem}

diff --git a/.github/templates/body.heading.md b/.github/templates/body.heading.md new file mode 100644 index 00000000..55d2c0e6 --- /dev/null +++ b/.github/templates/body.heading.md @@ -0,0 +1,3 @@ +## Showcase + +Categorized wallpaper showcase. two pictures per category. diff --git a/.github/templates/category.md b/.github/templates/category.md new file mode 100644 index 00000000..7c8709c1 --- /dev/null +++ b/.github/templates/category.md @@ -0,0 +1 @@ +{filename} diff --git a/.github/templates/conclusion.md b/.github/templates/conclusion.md new file mode 100644 index 00000000..7c0731c1 --- /dev/null +++ b/.github/templates/conclusion.md @@ -0,0 +1,5 @@ +## Ending Note + +You may use [download-directory]({download}) for downloading a specific directory. + +I do not own these images. All credits belong to the respective artists. diff --git a/.github/templates/heading.md b/.github/templates/heading.md new file mode 100644 index 00000000..efc73439 --- /dev/null +++ b/.github/templates/heading.md @@ -0,0 +1,5 @@ +# Wallpapers + +This README is auto-generated. You may view its source code [here]({source}). +Showcases are randomly chosen. Files are shuffled then first two +from each category are chosen. diff --git a/.github/templates/sources.md b/.github/templates/sources.md new file mode 100644 index 00000000..370647b9 --- /dev/null +++ b/.github/templates/sources.md @@ -0,0 +1,29 @@ +## Sources + +Following are roughly the sources from where I scraped these images from. + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- diff --git a/.github/workflows/docgen.yml b/.github/workflows/docgen.yml new file mode 100644 index 00000000..db8a4ab3 --- /dev/null +++ b/.github/workflows/docgen.yml @@ -0,0 +1,34 @@ +name: Auto Release + +on: + push: + branches: + - main + +jobs: + build: + name: Readme generation + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Configure + run: sudo apt-get update && sudo apt-get install libimage-exiftool-perl + - name: Build + run: | + ./.github/docgen.py + - name: Commit + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + COMMIT_MSG: | + [README] Generated readmes. + run: | + git config user.email "actions@github" + git config user.name "Github Actions" + git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + git add . + git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF}) diff --git a/.gitignore b/.gitignore index d3e41d0d..317da698 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -.config/micro/backups/* -.config/micro/buffers/* -.config/micro/plug/* +.config/micro/backups/ +.config/micro/buffers/ +.config/micro/plug/ .icons/default -.config/tmux/plugins/* +.config/tmux/plugins/ +walls/ diff --git a/.xinitrc b/.xinitrc index 8396f397..752a81f7 100644 --- a/.xinitrc +++ b/.xinitrc @@ -63,8 +63,8 @@ export $(run-parts /usr/lib/systemd/user-environment-generators | sed '/:$/d; /^ source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh -keychain ~/.ssh/id_ed25519 -keychain ~/.ssh/id_rsa +keychain --dir "$XDG_RUNTIME_DIR"/keychain ~/.ssh/id_ed25519 +keychain --dir "$XDG_RUNTIME_DIR"/keychain ~/.ssh/id_rsa [ -f ~/.keychain/$HOSTNAME-sh ] && . ~/.keychain/$HOSTNAME-sh 2>/dev/null [ -f ~/.keychain/$HOSTNAME-sh-gpg ] && . ~/.keychain/$HOSTNAME-sh-gpg 2>/dev/null diff --git a/scripts/delete-wallpaper.sh b/scripts/delete-wallpaper.sh new file mode 100755 index 00000000..4ef0779b --- /dev/null +++ b/scripts/delete-wallpaper.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Read the current wallpaper path from the saved file +CURRENT_WALLPAPER=$(cat ~/.current_wallpaper) + +# Delete the current wallpaper file +rm "$CURRENT_WALLPAPER" + +# Run the wallpaper changer script to set a new wallpaper +/home/kaizen/scripts/wallpaper-changer.sh diff --git a/scripts/wallpaper-changer.sh b/scripts/wallpaper-changer.sh new file mode 100755 index 00000000..e904ddf4 --- /dev/null +++ b/scripts/wallpaper-changer.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Set the directory containing your wallpapers +WALLPAPER_DIR="/home/kaizen/walls" + +# Get a random wallpaper from the directory +RANDOM_WALLPAPER=$(ls $WALLPAPER_DIR | shuf -n 1) + +# Set the wallpaper using feh +feh --bg-fill --no-fehbg "$WALLPAPER_DIR/$RANDOM_WALLPAPER" + +# Save the current wallpaper path to a file for later deletion +echo "$WALLPAPER_DIR/$RANDOM_WALLPAPER" > ~/.current_wallpaper