Browse Source

Calendar and status bar

main
Yiğit Çolakoğlu 4 years ago
parent
commit
0b65deb252
9 changed files with 84 additions and 64 deletions
  1. +3
    -3
      config/mpv/mpv.conf
  2. +2
    -2
      local/bin/dmenu-edit
  3. +0
    -2
      local/bin/dmenu_surf
  4. +4
    -8
      local/bin/pacontrol.sh
  5. +19
    -1
      local/bin/status-bar/date
  6. +6
    -0
      local/bin/status-bar/todo
  7. +45
    -45
      local/bin/status-bar/weather
  8. +2
    -0
      suckless/dwmblocks/config.h
  9. +3
    -3
      suckless/st/config.h

+ 3
- 3
config/mpv/mpv.conf View File

@ -91,12 +91,12 @@
# Pretend to be a web browser. Might fix playback with some streaming sites,
# but also will break with shoutcast streams.
#user-agent="Mozilla/5.0"
user-agent="Mozilla/5.0"
# cache settings
#
# Use a large seekable RAM cache even for local input.
#cache=yes
cache=yes
#
# Use extra large RAM cache (needs cache=yes to make it useful).
#demuxer-max-bytes=500M
@ -112,7 +112,7 @@
#cache-on-disk=yes
# Display English subtitles if available.
#slang=en
slang=en
# Play Finnish audio if available, fall back to English otherwise.
#alang=fi,en


+ 2
- 2
local/bin/dmenu-edit View File

@ -1,7 +1,7 @@
#!/bin/sh
DMENU='dmenu -z 1900 -x 10 -y 10 -i'
blacklist="powerlevel10k|secret|gitignore|log|plugins|patch"
blacklist="powerlevel10k|secret|gitignore|log|plugins|patches|config/surf"
whitelist="config.h|keybind.h|colors.h|color.h|rules.h"
declare -A mappings
@ -9,7 +9,7 @@ items=$(find "$HOME/.dotfiles/config" -type f | grep -Ev $blacklist | sed -n "s|
scripts=$(find "$HOME/.dotfiles/local/bin" -type f | grep -Ev $blacklist | sed -n "s|$HOME/.dotfiles/local/bin/|scripts/|p")
suckless=$(find "$HOME/.dotfiles/suckless" -type f | grep -Ev $blacklist | grep -E $whitelist | sed -n "s|$HOME/.dotfiles/suckless/|suckless/|p")
selection=$(echo "$items\n$scripts\n$suckless" | $DMENU)
selection=$(echo -e "$items\n$scripts\n$suckless" | $DMENU)
if [ ! "$selection" = "" ]; then
if [ $(echo $selection | cut -d"/" -f 1) = "scripts" ]; then


+ 0
- 2
local/bin/dmenu_surf View File

@ -3,8 +3,6 @@
lines=12
blacklist='google'
# cat ~/.surf/history.txt | sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *([^ ]*) *(.*)/\2 : \1/g' | sort | uniq
# selection=$(cat ~/.surf/history.txt | grep -Eiv $blacklist| sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *([^ ]*) *(.*)/\2 : \1/g' | sort | uniq | dmenu -l $lines -i -p "Enter URL")
selection=$(echo "" | dmenu -p "Enter URL")
if [ ! -z "$selection" ]


+ 4
- 8
local/bin/pacontrol.sh View File

@ -35,12 +35,8 @@ vol_interval=5
sinks=$(pactl list short sinks | cut -c 1)
latest_sink=${sinks[*]: -1}
SINK=$(pactl list short sinks | grep -n RUNNING | cut -d":" -f1)
if [ "$SINK" = "" ]; then
SINK=1
fi
NOW=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $SINK | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
MUTE=$(pactl list sinks | grep '^[[:space:]]Mute:'| head -n $SINK | tail -n 1 | awk -F ":" '{print $2}'| xargs)
NOW=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $latest_sink | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
MUTE=$(pactl list sinks | grep '^[[:space:]]Mute:'| head -n $latest_sink | tail -n 1 | awk -F ":" '{print $2}'| xargs)
case $1 in
"up")
@ -65,8 +61,8 @@ case $1 in
;;
*) usage ;;
esac
NOW=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $SINK | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
MUTE=$(pactl list sinks | grep '^[[:space:]]Mute:'| head -n $SINK | tail -n 1 | awk -F ":" '{print $2}'| xargs)
NOW=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $latest_sink | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
MUTE=$(pactl list sinks | grep '^[[:space:]]Mute:'| head -n $latest_sink | tail -n 1 | awk -F ":" '{print $2}'| xargs)
kill -48 $(pidof dwmblocks)
send_notification $NOW $MUTE

+ 19
- 1
local/bin/status-bar/date View File

@ -10,10 +10,28 @@ fi
cmd=$(date +"%h %e")
#echo "$ifg $icon $tfg$cmd"
echo -n "^c#0f111a^^b#88c0d0^ $icon $events$cmd ^d^"
case $BLOCK_BUTTON in
1) setsid -f st -c center -n center -e calcurse;;
esac
next=$(calcurse -n | tail -1)
if [ ! "$next" = "" ]; then
name=$(echo "$next" | cut -d ' ' -f 5- -)
time_left=$(date --date="$(echo "$next" | cut -d '[' -f2 | cut -d ']' -f1 )" "+%k%M")
if [ "$time_left" -lt 30 ]; then
if [ ! -f "$XDG_CACHE_HOME/calcurse" ];then
touch "$XDG_CACHE_HOME/calcurse"
fi
if [ "$(grep "$name" "$XDG_CACHE_HOME/calcurse")" = "" ]; then
time=$(calcurse -a | grep -E "\s*$name\$" -B 1 | head -n 1 | cut -c4-8)
echo "$name" > "$XDG_CACHE_HOME/calcurse"
canberra-gtk-play -i message
dunstify -a " Event approaching" "[$time] $name"
fi
fi
fi

+ 6
- 0
local/bin/status-bar/todo View File

@ -0,0 +1,6 @@
#!/bin/sh
todos=$(calcurse -t | tail -n +2 | wc -l)
echo -n "^c#81a1c1^ ^d^ $todos"

+ 45
- 45
local/bin/status-bar/weather View File

@ -9,51 +9,51 @@ WCODES=(
["113"]="^c#ebcb8b^ "
["116"]="^c#ebcb8b^杖"
["119"]="^c#ffffff^摒"
["122"]="^c#ffffff^ "
["143"]="^c#ffffff^ "
["176"]="^c#81a1c1^ "
["179"]="^c#81a1c1^ "
["182"]="^c#81a1c1^ "
["185"]="^c#81a1c1^ "
["200"]="^c#81a1c1^ "
["227"]="^c#ffffff^ "
["230"]="^c#ffffff^ "
["248"]="^c#ffffff^ "
["260"]="^c#ffffff^ "
["263"]="^c#81a1c1^ "
["266"]="^c#81a1c1^ "
["281"]="^c#81a1c1^ "
["284"]="^c#81a1c1^ "
["293"]="^c#81a1c1^ "
["296"]="^c#81a1c1^ "
["299"]="^c#81a1c1^ "
["302"]="^c#81a1c1^ "
["305"]="^c#81a1c1^ "
["308"]="^c#81a1c1^ "
["311"]="^c#81a1c1^ "
["314"]="^c#81a1c1^ "
["317"]="^c#81a1c1^ "
["320"]="^c#ffffff^ "
["323"]="^c#81a1c1^ "
["326"]="^c#81a1c1^ "
["329"]="^c#ffffff^ "
["332"]="^c#ffffff^ "
["335"]="^c#81a1c1^ "
["338"]="^c#ffffff^ "
["350"]="^c#81a1c1^ "
["353"]="^c#81a1c1^ "
["356"]="^c#81a1c1^ "
["359"]="^c#81a1c1^ "
["362"]="^c#81a1c1^ "
["365"]="^c#81a1c1^ "
["368"]="^c#81a1c1^ "
["371"]="^c#81a1c1^ "
["374"]="^c#81a1c1^ "
["377"]="^c#81a1c1^ "
["386"]="^c#81a1c1^ "
["389"]="^c#81a1c1^ "
["392"]="^c#81a1c1^ "
["395"]="^c#81a1c1^ "
["122"]="^c#ffffff^ "
["143"]="^c#ffffff^ "
["176"]="^c#81a1c1^ "
["179"]="^c#81a1c1^ "
["182"]="^c#81a1c1^ "
["185"]="^c#81a1c1^ "
["200"]="^c#81a1c1^ "
["227"]="^c#ffffff^ "
["230"]="^c#ffffff^ "
["248"]="^c#ffffff^ "
["260"]="^c#ffffff^ "
["263"]="^c#81a1c1^ "
["266"]="^c#81a1c1^ "
["281"]="^c#81a1c1^ "
["284"]="^c#81a1c1^ "
["293"]="^c#81a1c1^ "
["296"]="^c#81a1c1^ "
["299"]="^c#81a1c1^ "
["302"]="^c#81a1c1^ "
["305"]="^c#81a1c1^ "
["308"]="^c#81a1c1^ "
["311"]="^c#81a1c1^ "
["314"]="^c#81a1c1^ "
["317"]="^c#81a1c1^ "
["320"]="^c#ffffff^ "
["323"]="^c#81a1c1^ "
["326"]="^c#81a1c1^ "
["329"]="^c#ffffff^ "
["332"]="^c#ffffff^ "
["335"]="^c#81a1c1^ "
["338"]="^c#ffffff^ "
["350"]="^c#81a1c1^ "
["353"]="^c#81a1c1^ "
["356"]="^c#81a1c1^ "
["359"]="^c#81a1c1^ "
["362"]="^c#81a1c1^ "
["365"]="^c#81a1c1^ "
["368"]="^c#81a1c1^ "
["371"]="^c#81a1c1^ "
["374"]="^c#81a1c1^ "
["377"]="^c#81a1c1^ "
["386"]="^c#81a1c1^ "
["389"]="^c#81a1c1^ "
["392"]="^c#81a1c1^ "
["395"]="^c#81a1c1^ "
)
getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}


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

@ -2,12 +2,14 @@
#define PATH(name) "/home/yigit/.local/share/bin/status-bar/"name
static Block blocks[] = {
// { "", PATH("clipboard"), 120, 28},
{ "", PATH("screensaver"), 120, 19},
{ "", PATH("dunst"), 120, 18},
{ "", PATH("mail"), 120, 23},
{ "", PATH("keyboard"), 120, 24},
{ "", PATH("bluetooth"), 120, 26},
{ "", PATH("mconnect"), 120, 20},
{ "", PATH("todo"), 120, 27},
{ "", PATH("nextcloud"), 600, 25},
{ "", PATH("cpu-temp"), 30, 17},
{ "", PATH("memory"), 120, 21},


+ 3
- 3
suckless/st/config.h View File

@ -190,9 +190,9 @@ static MouseShortcut mshortcuts[] = {
#define TERMMOD (ControlMask|ShiftMask)
#define ALTMOD (Mod1Mask|ShiftMask)
static char *openurlcmd[] = { "/bin/sh", "-c", "/home/yigit/.scripts/st-urlhandler -o", "externalpipe", NULL };
static char *copyurlcmd[] = { "/bin/sh", "-c", "/home/yigit/.scripts/st-urlhandler -c", "externalpipe", NULL };
static char *copyoutput[] = { "/bin/sh", "-c", "/home/yigit/.scripts/st-copyout", "externalpipe", NULL };
static char *openurlcmd[] = { "/bin/sh", "-c", "/home/yigit/.local/share/bin/st-urlhandler -o", "externalpipe", NULL };
static char *copyurlcmd[] = { "/bin/sh", "-c", "/home/yigit/.local/share/bin/st-urlhandler -c", "externalpipe", NULL };
static char *copyoutput[] = { "/bin/sh", "-c", "/home/yigit/.local/share/bin/st-copyout", "externalpipe", NULL };
static unsigned int cursorstyle = 1;
static Rune stcursor = 0x2603; /* snowman (U+2603) */


Loading…
Cancel
Save