Browse Source

Configuration

main
Yiğit Çolakoğlu 4 years ago
parent
commit
90fa69854c
8 changed files with 59 additions and 3 deletions
  1. +3
    -0
      scripts/dunst_toggle.sh
  2. +27
    -0
      scripts/screensaver_toggle
  3. +9
    -0
      scripts/status-bar/dunst
  4. +9
    -0
      scripts/status-bar/screensaver
  5. +1
    -1
      scripts/status-bar/weather
  6. +6
    -2
      suckless/dwm/keybind.h
  7. +2
    -0
      suckless/dwmblocks/config.h
  8. +2
    -0
      xorg/xinitrc

+ 3
- 0
scripts/dunst_toggle.sh View File

@ -9,9 +9,11 @@ getargs() {
done
}
start_dnd() {
echo "off" > ~/.cache/dunst
notify-send "DUNST_COMMAND_PAUSE";
}
end_dnd() {
echo "on" > ~/.cache/dunst
notify-send "DUNST_COMMAND_RESUME";
notify-send "Do Not Disturb" "Do Not Disturb mode ended. Notifications will be shown.";
}
@ -19,5 +21,6 @@ main() {
getargs "$@";
[[ "$start" ]] && start_dnd;
[[ "$end" ]] && end_dnd;
kill -52 $(pidof dwmblocks)
}
main "$@"

+ 27
- 0
scripts/screensaver_toggle View File

@ -0,0 +1,27 @@
#!/bin/zsh
getargs() {
while getopts "se" opt
do
case $opt in
s) start="true";;
e) end="true";;
esac
done
}
start_dnd() {
xset -dpms
echo "off" > ~/.cache/screensaver
notify-send "Screensaver off";
}
end_dnd() {
xset +dpms
echo "on" > ~/.cache/screensaver
notify-send "Screensaver on.";
}
main() {
getargs "$@";
[[ "$start" ]] && start_dnd;
[[ "$end" ]] && end_dnd;
kill -53 $(pidof dwmblocks)
}
main "$@"

+ 9
- 0
scripts/status-bar/dunst View File

@ -0,0 +1,9 @@
#!/bin/bash
stats=$(<~/.cache/dunst)
if [ "$stats" = "off" ]; then
echo "^c#88c0d0^ ^d^"
else
echo "^c#88c0d0^ ^d^"
fi

+ 9
- 0
scripts/status-bar/screensaver View File

@ -0,0 +1,9 @@
#!/bin/bash
stats=$(<~/.cache/screensaver)
if [ "$stats" = "off" ]; then
echo "^c#a48ead^ ^d^"
else
echo "^c#a48ead^ ^d^"
fi

+ 1
- 1
scripts/status-bar/weather View File

@ -10,7 +10,7 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
# display them with coresponding emojis.
showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" |
grep -wo "[0-9]*%" | sort -rn | sed "s/^/\^c#81a1c1\^  \^d\^/g;1q" | tr -d '\n')"
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ﰕ " $1 "° 滛 " $2 "°"}' ;}
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ^c#ebcb8b^ 滛^d^ "$2 "°"}' ;}
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;


+ 6
- 2
suckless/dwm/keybind.h View File

@ -31,6 +31,9 @@ static const char *outmenu[] = {"/home/yigit/.scripts/dmenu-logout"};
static const char *notification_off[] = {"/home/yigit/.scripts/dunst_toggle.sh","-s",NULL};
static const char *notification_on[] = {"/home/yigit/.scripts/dunst_toggle.sh", "-e",NULL};
static const char *screensaver_off[] = {"/home/yigit/.scripts/screensaver_toggle","-s",NULL};
static const char *screensaver_on[] = {"/home/yigit/.scripts/screensaver_toggle", "-e",NULL};
static const char *bwmenu[] = {"/home/yigit/.scripts/password_manager", NULL};
@ -42,8 +45,7 @@ static const char *kdeconnect[] = {"/home/yigit/.local/bin/dmenu_kdeconnect.sh",
static const char *bluetooth[] = {"/home/yigit/.scripts/dmenu-bluetooth", NULL};
static const char *screenshot[] = { "scrot","-d","3", "%Y-%m-%d-%s_$wx$h.jpg", "-e","xclip -selection clipboard -t image/jpg < $f; mv $f ~/Pictures/Screenshots/;dunstify --icon='/home/yigit/.icons/Numix-Circle/48/apps/camera.svg' -a 'SNAP' 'Screenshot taken'", NULL };
static const char *windowshot[] = { "scrot", "-u", "-d","3", "%Y-%m-%d-%s_$wx$h.jpg", "-e","xclip -selection clipboard -t image/jpg < $f; mv $f ~/Pictures/Screenshots/;dunstify --icon='/home/yigit/.icons/Numix-Circle/48/apps/camera.svg' -a 'SNAP' 'Screenshot taken'", NULL };
static const char *screenshot[] = { "scrot","-d","3", "%Y-%m-%d-%s_$wx$h.jpg", "-e","xclip -selection clipboard -t image/jpg < $f; mv $f ~/Pictures/Screenshots/;dunstify --icon='/home/yigit/.icons/Numix-Circle/48/apps/camera.svg' -a 'SNAP' 'Screenshot taken'", NULL }; static const char *windowshot[] = { "scrot", "-u", "-d","3", "%Y-%m-%d-%s_$wx$h.jpg", "-e","xclip -selection clipboard -t image/jpg < $f; mv $f ~/Pictures/Screenshots/;dunstify --icon='/home/yigit/.icons/Numix-Circle/48/apps/camera.svg' -a 'SNAP' 'Screenshot taken'", NULL };
static const char *url[] = {"/home/yigit/.scripts/dmenu_surf", NULL};
static const char *surf[] = {"/home/yigit/.scripts/tabbed_surf", NULL};
@ -58,6 +60,8 @@ static Key keys[] = {
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_i, spawn, {.v = screensaver_off} },
{ MODKEY|ShiftMask, XK_i, spawn, {.v = screensaver_on } },
{ MODKEY, XK_n, spawn, {.v = notification_off} },
{ MODKEY|ShiftMask, XK_n, spawn, {.v = notification_on } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },


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

@ -4,6 +4,8 @@
static Block blocks[] = {
// { "", PATH("clipboard"), 30, 18},
{ "", PATH("screensaver"), 120, 19},
{ "", PATH("dunst"), 120, 18},
{ "", PATH("cpu-temp"), 30, 17},
{ "", PATH("weather"), 60, 16},
{ "", PATH("arch"), 120, 15},


+ 2
- 0
xorg/xinitrc View File

@ -47,6 +47,8 @@ xss-lock -- betterlockscreen -l -t 'Stay the fuck out!' &
# aw-server &
# aw-watcher-window &
# aw-watcher-afk &
echo "on" > ~/.cache/dunst
echo "on" > ~/.cache/screensaver
dbus-update-activation-environment --systemd DISPLAY
picom --no-fading-openclose &
firefox-developer-edition app.daily.dev&


Loading…
Cancel
Save