dotfiles

Configuration dotfiles
git clone git://git.wimdupont.com/dotfiles.git
Log | Files | Refs | README | LICENSE

commit aa0d366330e98f37a6521ddda0a58d381bf84bdb
parent c40792fa9e6916062c183f75df676c3c1b5253f9
Author: Wim Dupont <wim@wimdupont.com>
Date:   Thu, 20 Jun 2024 21:31:14 +0200

added easy mime defaults and pwd lock cmds

Diffstat:
M.bashrc | 2++
Mlfrc | 18+++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/.bashrc b/.bashrc @@ -102,5 +102,7 @@ alias lg='lazygit' alias rss='export SFEED_URL_FILE="$HOME/.sfeed/urls" && [ -f "$SFEED_URL_FILE" ] || touch "$SFEED_URL_FILE" && sfeed_curses ~/.sfeed/feeds/*' alias rssu='sfeed_update ~/.sfeed/sfeedrc' alias rsse='vim ~/.sfeed/sfeedrc' +alias lockcheck='faillock --user $USER' +alias lockfree='faillock --user $USER --reset' PS1='[\u@\h \W]\$ ' diff --git a/lfrc b/lfrc @@ -37,6 +37,20 @@ cmd setwallpaper ${{ feh --bg-max "$f" }} +cmd set_mime_default ${{ + mime_type=$(xdg-mime query filetype $f) + colour=$(tput setaf 6) + normal=$(tput sgr0) + apps=($(ls /usr/share/applications | sed 's/.desktop//g')) + + echo "" + printf "${colour}%s\t${normal}" "${apps[@]}" + printf "\nDefault application for $mime_type: " + read app + + xdg-mime default $app.desktop $mime_type +}} + # extract the current file with the right command # (xkcd link: https://xkcd.com/1168/) cmd extract ${{ @@ -66,7 +80,7 @@ cmd tar ${{ cmd open &{{ case $(file --mime-type -Lb $f) in text/*) lf -remote "send $id \$$EDITOR \$fx";; - *) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;; + *) lf -remote "send $id \$xdg-open $f";; esac }} @@ -99,6 +113,8 @@ map mx make_mod "x" map mr make_mod "r" map mw make_mod "w" map ma make_mod "a" +map mo $TYPE=$(xdg-mime query filetype $f); notify-send $(xdg-mime query default $TYPE) $TYPE +map mO set_mime_default map bg setwallpaper