From 6537eef95bb9067d0f20574a3f4f5f00f90cc4eb Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sun, 6 Mar 2022 21:36:37 +0530 Subject: updating old scripts --- scripts/serch | 6 ++---- scripts/setbg | 16 +++++++++++----- scripts/setdef | 4 +++- scripts/spotifyvoldec.py | 24 ------------------------ scripts/spotifyvolinc.py | 25 ------------------------- 5 files changed, 16 insertions(+), 59 deletions(-) mode change 100644 => 100755 scripts/serch mode change 100644 => 100755 scripts/setbg mode change 100644 => 100755 scripts/setdef delete mode 100644 scripts/spotifyvoldec.py delete mode 100644 scripts/spotifyvolinc.py (limited to 'scripts') diff --git a/scripts/serch b/scripts/serch old mode 100644 new mode 100755 index fa0ea2f..0e2acfe --- a/scripts/serch +++ b/scripts/serch @@ -1,7 +1,5 @@ #!/bin/sh - -sudo -A find / -type f -o -type d | +sudo -A find / -type f -o -type d -path '/proc/*' -prune| dmenu -i -p 'Directories/Files to search:' -l 15 | -awk '{printf("\"%s\"\n", $0);}' | +sed "s/.*/'&'/" | xclip -sel c - diff --git a/scripts/setbg b/scripts/setbg old mode 100644 new mode 100755 index d94e64b..f267a3a --- a/scripts/setbg +++ b/scripts/setbg @@ -1,11 +1,17 @@ #!/bin/sh -echo "Chosing a random wallpaper..." -wall=$(find $HOME/Pictures/Wallpaper/w/wow -type f | shuf -n 1) -echo "Setting up the wallpaper: $(echo $wall|cut -d '/' -f 8)" -xwallpaper --zoom $wall +if [ -z "$1" ]; then + echo "Chosing a random wallpaper..." + wall=$(find $HOME/Pictures/Wallpaper/w/wow -type f | shuf -n 1) + echo "Setting up the wallpaper: $(echo $wall|cut -d '/' -f 8)" +else + wall="$1" +fi + +echo "Setting up the wallpaper: $(echo $wall)" +xwallpaper --zoom $wall && echo "Generating pywal color schemes..." -wal -n -i $wall >/dev/null +wal -n -i $wall >/dev/null && echo "dwm reading Xresources color values at runtime" xdotool key super+F5 pywal-discord diff --git a/scripts/setdef b/scripts/setdef old mode 100644 new mode 100755 index b2460a9..ed02376 --- a/scripts/setdef +++ b/scripts/setdef @@ -2,4 +2,6 @@ #To retuen dwm and st to their default vanilla state xwallpaper --clear xrdb -remove -xdotool key super+shift+q +xdotool key alt+shift+q +sleep 5 +picom --experimental-backends diff --git a/scripts/spotifyvoldec.py b/scripts/spotifyvoldec.py deleted file mode 100644 index a00e06f..0000000 --- a/scripts/spotifyvoldec.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 -import subprocess -import os -x=0 -y=0 -env = os.environ -env['LANG'] = 'en_US' -app = '"Spotify"' -pactl = subprocess.check_output(['pactl', 'list', 'sink-inputs'], env=env).decode().strip().split() -if app in pactl: - for e in pactl: - x += 1 - if e == app: - break - for i in pactl[0 : x -1 ]: - y += 1 - if i == 'Sink' and pactl[y] == 'Input' and '#' in pactl[y + 1]: - sink_id = pactl[y+1] - if i == 'Volume:' and '%' in pactl[y + 3]: - volume = pactl[y + 3] - sink_id = sink_id[1: ] - volume = volume[ : -1 ] - if int(volume) < 100: - subprocess.run(['pactl', 'set-sink-input-volume', sink_id, '-1%']) diff --git a/scripts/spotifyvolinc.py b/scripts/spotifyvolinc.py deleted file mode 100644 index f4d04b4..0000000 --- a/scripts/spotifyvolinc.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 -#Author: Marcin Kocur, attribution license: https://creativecommons.org/licenses/by/4.0/ -import subprocess -import os -x=0 -y=0 -env = os.environ -env['LANG'] = 'en_US' -app = '"Spotify"' -pactl = subprocess.check_output(['pactl', 'list', 'sink-inputs'], env=env).decode().strip().split() -if app in pactl: - for e in pactl: - x += 1 - if e == app: - break - for i in pactl[0 : x -1 ]: - y += 1 - if i == 'Sink' and pactl[y] == 'Input' and '#' in pactl[y + 1]: - sink_id = pactl[y+1] - if i == 'Volume:' and '%' in pactl[y + 3]: - volume = pactl[y + 3] - sink_id = sink_id[1: ] - volume = volume[ : -1 ] - if int(volume) < 100: - subprocess.run(['pactl', 'set-sink-input-volume', sink_id, '+1%']) -- cgit v1.2.3