Browse Source

More scripts, scratchpads improved

main
Yiğit Çolakoğlu 4 years ago
parent
commit
8bbf0e2ff1
9 changed files with 26 additions and 8 deletions
  1. +3
    -0
      scripts/pacontrol.sh
  2. +7
    -0
      scripts/status-bar/memory
  3. +6
    -1
      scripts/status-bar/volume
  4. +2
    -1
      scripts/tedportal
  5. +2
    -2
      suckless/dwm/config.h
  6. +1
    -1
      suckless/dwm/keybind.h
  7. +2
    -1
      suckless/dwm/rules.h
  8. +2
    -1
      suckless/dwmblocks/config.h
  9. +1
    -1
      xorg/xinitrc

+ 3
- 0
scripts/pacontrol.sh View File

@ -23,6 +23,9 @@ case $1 in
"toggle-mute")
pactl set-sink-mute $latest_sink toggle
;;
"open-mute")
pactl set-sink-mute $latest_sink 1
;;
*) usage ;;
esac


+ 7
- 0
scripts/status-bar/memory View File

@ -0,0 +1,7 @@
#!/bin/bash
MEM=$(free | grep Mem | awk '{printf("%d", $3/$2 * 100.0)}')
echo "^c#a3be8c^ ^d^ $MEM%"

+ 6
- 1
scripts/status-bar/volume View File

@ -2,8 +2,13 @@
SINK=$( pactl list short sinks | grep RUNNING | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 )
NOW=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
MUTE=$(pactl list sinks | grep '^[[:space:]]Mute:' | awk -F ":" '{print $2}'| xargs)
echo "^c#a3be8c^墳 ^d^ $NOW%"
if [ "$MUTE" = "yes" ]; then
echo "^c#a3be8c^婢 ^d^ $NOW%"
else
echo "^c#a3be8c^墳 ^d^ $NOW%"
fi
case $BLOCK_BUTTON in
1) setsid -f st -c stpulse -n stpulse -e ncpamixer ;;


+ 2
- 1
scripts/tedportal View File

@ -6,5 +6,6 @@ echo $selection
IFS="|"
read -ra url <<< "$selection"
url=$(echo ${url[1]} | xargs)
xdg-open ${url[1]}
zoom "${url[1]}"

+ 2
- 2
suckless/dwm/config.h View File

@ -53,12 +53,12 @@ static const Layout layouts[] = {
const char *spcmd1[] = {"st", "-c", "scratchpad", "-n", "spterm", "-g", "120x34", NULL };
const char *spcmd2[] = {"sxiv", "-N", "spsxiv", "-b", "-g","900x300+500+350", "/home/yigit/Pictures/us_keyboard.png", NULL};
const char *spcmd2[] = {"feh", "--title", "scratchpad", "--class", "spfeh", "-g","900x300+500+350", "/home/yigit/Pictures/us_keyboard.png", NULL};
const char *spcmd3[] = {"st", "-c", "scratchpad", "-n", "spmutt", "-g", "180x51", "-e", "neomutt", NULL };
static Sp scratchpads[] = {
{"spterm", spcmd1},
{"spsxiv", spcmd2},
{"spfeh", spcmd2},
{"spmutt", spcmd3},
};


+ 1
- 1
suckless/dwm/keybind.h View File

@ -16,7 +16,7 @@ static const char *dmenucmd[] = { "/home/yigit/.scripts/dmenu_run_history", "-m"
static const char *termcmd[] = { "/usr/local/bin/st","-e", "/home/yigit/.scripts/st_tmux", NULL };
static const char *upvol[] = { "/home/yigit/.scripts/pacontrol.sh", "up", NULL };
static const char *downvol[] = { "/home/yigit/.scripts/pacontrol.sh", "down", NULL };
static const char *mutevol[] = { "/home/yigit/.scripts/pacontrol.sh", "togglemute", NULL };
static const char *mutevol[] = { "/home/yigit/.scripts/pacontrol.sh", "toggle-mute", NULL };
static const char *upbright[] = {"/usr/bin/xbacklight","-inc","10",NULL};
static const char *downbright[] = {"/usr/bin/xbacklight","-dec","10",NULL};


+ 2
- 1
suckless/dwm/rules.h View File

@ -24,7 +24,7 @@ static const Rule rules[] = {
RULE(.class = "Nemo", .tags = 1 << 3)
RULE(.class = "Spotify", .tags = 1 << 9)
RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1)
RULE(.instance = "spsxiv", .tags = SPTAG(1), .isfloating = 1)
RULE(.class = "spfeh", .tags = SPTAG(1), .isfloating = 1)
RULE(.instance = "spmutt", .tags = SPTAG(2), .isfloating = 1)
RULE(.class = "ranger", 0, .isfloating = 1)
RULE(.class = "vim", 0, .isfloating = 1, .floatpos="50% 50% 800W 560H")
@ -32,4 +32,5 @@ static const Rule rules[] = {
RULE(.class = "mpv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H")
RULE(.instance = "sxiv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H")
RULE(.class = "neomutt-send", 0, .isfloating = 1, .floatpos="50% 50% 1000W 700H")
RULE(.class = "neomutt-send", 0, .isfloating = 1, .floatpos="50% 50% 250W 600H")
};

+ 2
- 1
suckless/dwmblocks/config.h View File

@ -4,8 +4,9 @@
static Block blocks[] = {
{ "", PATH("screensaver"), 120, 19},
{ "", PATH("dunst"), 120, 18},
{ "", PATH("mconnect"), 120, 20},
{ "", PATH("mconnect"), 120, 20},
{ "", PATH("cpu-temp"), 30, 17},
{ "", PATH("memory"), 120, 21},
{ "", PATH("weather"), 60, 16},
{ "", PATH("arch"), 120, 15},
{ "", PATH("volume"), 5, 14},


+ 1
- 1
xorg/xinitrc View File

@ -48,7 +48,7 @@ fi
if [ "$MCONNECT" = true ] ; then
/usr/local/bin/mconnect -d > /tmp/mconnect 2> /tmp/mconnect.err &
fi
xss-lock -- betterlockscreen -l -t 'Stay the fuck out!' &
xss-lock -- "/home/yigit/.scripts/pacontrol.sh open-mute && /home/yigit/.scripts/dunst_toggle.sh off && betterlockscreen -l -t 'Stay the fuck out!' && /home/yigit/.scripts/dunst_toggle.sh on"&
# aw-server &
# aw-watcher-window &
# aw-watcher-afk &


Loading…
Cancel
Save