diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 6ac9884..f170d9d 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -96,4 +96,5 @@ map gp cd ~/pix map gc cd ~/.config map gr cd ~/code/repos map gv cd ~/vids/ +map gm cd ~/media/movies map gs cd ~/.local/bin diff --git a/.local/bin/metadata b/.local/bin/metadata new file mode 100755 index 0000000..44c1fb8 --- /dev/null +++ b/.local/bin/metadata @@ -0,0 +1,12 @@ +#!/bin/sh +if [ -z "$*" ]; then + input_file=$(fzf) +else + input_file=$* +fi +read -p "Title: " title +read -p "Artist: " artist +read -p "album: " album +output_name="metadata-$input_file" +ffmpeg -i "$input_file" -metadata title="$title" -metadata artist="$artist" -metadata album="$album" -c copy "$output_name" +mv -f "$output_name" "$input_file" diff --git a/.local/bin/system_action b/.local/bin/system_action new file mode 100755 index 0000000..16995c2 --- /dev/null +++ b/.local/bin/system_action @@ -0,0 +1,16 @@ +#!/bin/sh + +case "$(readlink -f /sbin/init)" in + *systemd*) ctl='systemctl' ;; + *) ctl='loginctl' ;; +esac + +case "$(printf " lock\n display off\n logout\n sleep\n reboot\n shutdown" | dmenu -i -p '>_ ')" in + ' lock') slock ;; + ' display off') xset dpms force off ;; + ' logout') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;; + ' sleep') slock $ctl suspend ;; + ' reboot') $ctl reboot ;; + ' shutdown') $ctl poweroff ;; + *) exit 1 ;; +esac