diff options
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/metadata | 12 | ||||
| -rwxr-xr-x | .local/bin/system_action | 16 |
2 files changed, 28 insertions, 0 deletions
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 |
