diff --git a/config/X11/xinitrc b/config/X11/xinitrc index 4663236c..48c0439e 100755 --- a/config/X11/xinitrc +++ b/config/X11/xinitrc @@ -43,7 +43,7 @@ fi mpd & mpd-mpris & touch ~/.cache/nextcloud-track -xss-lock -- /home/yigit/.local/share/bin/lock & +xss-lock -- slock & echo "on" > ~/.cache/screensaver dbus-update-activation-environment --systemd DISPLAY picom --no-fading-openclose & diff --git a/local/bin/pacontrol.sh b/local/bin/pacontrol.sh index c3895d83..51d61236 100755 --- a/local/bin/pacontrol.sh +++ b/local/bin/pacontrol.sh @@ -20,12 +20,15 @@ case $1 in "down") pactl set-sink-volume $latest_sink -$vol_interval% ;; - "toggle-mute") + "toggle-mute") pactl set-sink-mute $latest_sink toggle ;; - "open-mute") + "open-mute") pactl set-sink-mute $latest_sink 1 ;; + "close-mute") + pactl set-sink-mute $latest_sink 0 + ;; *) usage ;; esac diff --git a/suckless/dwm/keybind.h b/suckless/dwm/keybind.h index ad5f8e88..c56a8476 100644 --- a/suckless/dwm/keybind.h +++ b/suckless/dwm/keybind.h @@ -23,7 +23,7 @@ static const char *mutevol[] = { "/home/yigit/.local/bin/pacontrol.sh", "toggl static const char *upbright[] = {"/usr/bin/xbacklight","-inc","10",NULL}; static const char *downbright[] = {"/usr/bin/xbacklight","-dec","10",NULL}; -static const char *lock[] = {"/home/yigit/.local/bin/lock",NULL}; +static const char *lock[] = {"/usr/local/bin/slock",NULL}; static const char *clipmenu[] = {"/usr/bin/clipmenu","-i",NULL}; static const char *play[] = {"/usr/bin/playerctl","play-pause",NULL}; static const char *prev[] = {"/usr/bin/playerctl","previous",NULL}; diff --git a/suckless/slock/config.h b/suckless/slock/config.h index 5e8cdaf9..c7a327af 100644 --- a/suckless/slock/config.h +++ b/suckless/slock/config.h @@ -7,9 +7,11 @@ static const char *lights_on[] = { "/bin/curl", "http://yeetclock/setcolor?R=13 static const char *lights_off[] = { "/bin/curl", "http://yeetclock/setcolor?R=0&G=0&B=0&O=0", NULL }; static const char *notifications_on[] = { "/home/yigit/.local/bin/dunst_toggle.sh", "-e", NULL }; static const char *notifications_off[] = { "/home/yigit/.local/bin/dunst_toggle.sh", "-s", NULL }; +static const char *mute_on[] = { "/home/yigit/.local/bin/pacontrol.sh", "open-mute", NULL }; +static const char *mute_off[] = { "/home/yigit/.local/bin/pacontrol.sh", "close-mute", NULL }; -static const char **prelock[] = {lights_off, notifications_off}; -static const char **postlock[] = {lights_on, notifications_on}; +static const char **prelock[] = {lights_off, notifications_off, mute_on}; +static const char **postlock[] = {lights_on, notifications_on, mute_off}; static const char *colorname[NUMCOLS] = { [INIT] = "black", /* after initialization */ diff --git a/suckless/slock/slock.c b/suckless/slock/slock.c index bcd55102..4281017c 100644 --- a/suckless/slock/slock.c +++ b/suckless/slock/slock.c @@ -415,15 +415,25 @@ usage(void) void runprelock(){ for(int i = 0; i < LENGTH(prelock); i++){ - if(fork() == 0) + if(fork() == 0){ + int fd = open("/dev/null", O_WRONLY); + dup2(fd, 1); + dup2(fd, 2); + close(fd); execvp(prelock[i][0], (char **)prelock[i]); + } } } void runpostlock(){ for(int i = 0; i < LENGTH(prelock); i++){ - if(fork() == 0) + if(fork() == 0){ + int fd = open("/dev/null", O_WRONLY); + dup2(fd, 1); + dup2(fd, 2); + close(fd); execvp(postlock[i][0], (char **)postlock[i]); + } } }