diff options
-rw-r--r-- | .config/mpd-notification.conf | 1 | ||||
-rw-r--r-- | .config/mpd/mpd.conf | 16 | ||||
-rw-r--r-- | .config/ncmpc/config | 2 | ||||
-rwxr-xr-x | .local/bin/dmpass | 31 | ||||
-rwxr-xr-x | .local/bin/dmpc | 4 | ||||
-rwxr-xr-x | .local/bin/dmscrot | 3 |
6 files changed, 44 insertions, 13 deletions
diff --git a/.config/mpd-notification.conf b/.config/mpd-notification.conf index f3cbc5e..3393d24 100644 --- a/.config/mpd-notification.conf +++ b/.config/mpd-notification.conf @@ -1,5 +1,4 @@ music-dir = /usr/home/jozan/mu -host = localhost oneline = false scale = 200 timeout = 5 diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index ae3b958..ee95a9e 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -11,14 +11,14 @@ # file:// protocol) or streaming files over an accepted protocol. # # music_directory "/var/mpd/music" -music_directory "/usr/home/jozan/mu" +music_directory "~/mu" # # This setting sets the MPD internal playlist directory. The purpose of this # directory is storage for playlists created by MPD. The server will use # playlist files not created by the server but only if they are in the MPD # format. This setting defaults to playlist saving being disabled. # -playlist_directory "/usr/home/jozan/.local/share/mpd/playlists" +playlist_directory "~/.local/share/mpd/playlists" # # This setting sets the location of the MPD database. This file is used to # load the database at server start up and store the database while the @@ -26,7 +26,7 @@ playlist_directory "/usr/home/jozan/.local/share/mpd/playlists" # MPD to accept files over ipc socket (using file:// protocol) or streaming # files over an accepted protocol. # -db_file "/usr/home/jozan/.local/share/mpd/db" +db_file "~/.local/share/mpd/db" # # These settings are the locations for the daemon log files for the daemon. # These logs are great for troubleshooting, depending on your log_level @@ -35,25 +35,25 @@ db_file "/usr/home/jozan/.local/share/mpd/db" # The special value "syslog" makes MPD use the local syslog daemon. This # setting defaults to logging to syslog. # -log_file "/usr/home/jozan/.local/share/mpd/log" +log_file "~/.local/share/mpd/log" # # This setting sets the location of the file which stores the process ID # for use of mpd --kill and some init scripts. This setting is disabled by # default and the pid file will not be stored. # -pid_file "/usr/home/jozan/.local/share/mpd/pid" +pid_file "~/.local/share/mpd/pid" # # This setting sets the location of the file which contains information about # most variables to get MPD back into the same general shape it was in before # it was brought down. This setting is disabled by default and the server # state will be reset on server start up. # -state_file "/usr/home/jozan/.local/share/mpd/state" +state_file "~/.local/share/mpd/state" # # The location of the sticker database. This is a database which # manages dynamic information attached to songs. # -sticker_file "/usr/home/jozan/.local/share/mpd/sticker.sql" +sticker_file "~/.local/share/mpd/sticker.sql" # ############################################################################### @@ -85,7 +85,7 @@ bind_to_address "any" # bind_to_address "192.168.1.79" # # And for Unix Socket -# bind_to_address "/usr/home/jozan/.local/share/mpd/socket" +bind_to_address "~/.local/share/mpd/socket" # # This setting is the TCP port that is desired for the daemon to get assigned # to. diff --git a/.config/ncmpc/config b/.config/ncmpc/config index 9eff2bd..34d34b6 100644 --- a/.config/ncmpc/config +++ b/.config/ncmpc/config @@ -1,5 +1,3 @@ -host = localhost -port = 6600 auto-center = yes visible-bitrate = yes library-page-tags = genre artist album diff --git a/.local/bin/dmpass b/.local/bin/dmpass new file mode 100755 index 0000000..8fd3568 --- /dev/null +++ b/.local/bin/dmpass @@ -0,0 +1,31 @@ +#!/bin/sh + +typeit=0 +if [ "$1" = "--type" ]; then + typeit=1 + shift +fi + +if [ -n "$WAYLAND_DISPLAY" ]; then + dmenu=dmenu-wl + xdotool="ydotool type --file -" +elif [ -n "$DISPLAY" ]; then + dmenu=dmenu + xdotool="xdotool type --delay 25 --clearmodifiers --file -" +else + echo "Error: No Wayland or X11 display detected" >&2 + exit 1 +fi + +prefix=${PASSWORD_STORE_DIR-~/.local/share/pass} +rprefix=$(printf "%s" $prefix | sed 's/\//\\\//g') +password_files=$(ls "$prefix"/**/*.gpg | sed 's/^'${rprefix}'\///g' | sed 's/\.gpg//g') +password=$(printf "%s\n" "${password_files}" | "$dmenu" -i -l 15 -m 0) + +[ -n "$password" ] || exit + +if [ $typeit -eq 0 ]; then + pass show -c "$password" >/dev/null 2>&1 +else + pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | $xdotool +fi diff --git a/.local/bin/dmpc b/.local/bin/dmpc index 782d76e..b22e678 100755 --- a/.local/bin/dmpc +++ b/.local/bin/dmpc @@ -10,7 +10,7 @@ sub main my $prompt; my $queued; - $current = `mpc -h localhost current`; + $current = `mpc current`; if (not $current) { $current = 'Current: Stopped'; } @@ -28,7 +28,7 @@ sub main chomp $queued; $prompt = "toggle\nnext\nprev\nplay\nstop\nclear\nrepeat\nrandom\n\n$current\n$queued\n"; $action = `printf "$prompt" | dmenu -i -l 11 -m 0`; - system("mpc -h localhost " . $action); + system("mpc " . $action); return; } diff --git a/.local/bin/dmscrot b/.local/bin/dmscrot index 6029256..d35ea4e 100755 --- a/.local/bin/dmscrot +++ b/.local/bin/dmscrot @@ -113,6 +113,9 @@ sub action '-a', '1920,180,1440,900' ); } + else { + return; + } show_img($file_name); notify_img($file_name); clip_img($file_name); |