Browse Source

Added wallabag dmenu script

main
Yiğit Çolakoğlu 4 years ago
parent
commit
a81a9a3f2a
6 changed files with 141 additions and 52 deletions
  1. +32
    -0
      misc/calcurse/conf
  2. +47
    -47
      misc/calcurse/keys
  3. +1
    -1
      misc/profile
  4. +52
    -0
      scripts/dmenu-wallabag
  5. +4
    -4
      suckless/dmenu/dmenu.c
  6. +5
    -0
      suckless/dwm/keybind.h

+ 32
- 0
misc/calcurse/conf View File

@ -0,0 +1,32 @@
appearance.calendarview=monthly
appearance.compactpanels=no
appearance.defaultpanel=calendar
appearance.layout=1
appearance.headerline=yes
appearance.eventseparator=yes
appearance.dayseparator=yes
appearance.emptyline=yes
appearance.emptyday=--
appearance.notifybar=yes
appearance.sidebarwidth=0
appearance.theme=red on default
appearance.todoview=hide-completed
appearance.headingpos=right-justified
daemon.enable=no
daemon.log=no
format.inputdate=1
format.notifydate=%a %F
format.notifytime=%T
format.outputdate=%D
format.dayheading=%B %e, %Y
general.autogc=no
general.autosave=yes
general.confirmdelete=yes
general.confirmquit=yes
general.firstdayofweek=monday
general.multipledays=yes
general.periodicsave=0
general.systemevents=yes
notification.command=printf '\a'
notification.notifyall=flagged-only
notification.warning=300

+ 47
- 47
misc/calcurse/keys View File

@ -6,50 +6,50 @@
# via the key configuration menu of the interactive user
# interface. It should not be edited directly.
generic-cancel ESC
generic-select SPC
generic-credits @
generic-help ?
generic-quit q Q
generic-save s S ^S
generic-reload R
generic-copy c
generic-paste p ^V
generic-change-view TAB
generic-import i I
generic-export x X
generic-goto g G
generic-other-cmd o O
generic-config-menu C
generic-redraw ^R
generic-add-appt ^A
generic-add-todo ^T
generic-prev-day T ^H
generic-next-day t ^L
generic-prev-week W ^K
generic-next-week w
generic-prev-month M
generic-next-month m
generic-prev-year Y
generic-next-year y
generic-scroll-down ^N
generic-scroll-up ^P
generic-goto-today ^G
generic-command :
move-right l L RGT
move-left h H LFT
move-down j J DWN
move-up k K UP
start-of-week 0
end-of-week $
add-item a A
del-item d D
edit-item e E
view-item v V RET
pipe-item |
flag-item !
repeat r
edit-note n N
view-note >
raise-priority +
lower-priority -
generic-cancel ESC
generic-select SPC
generic-credits @
generic-help ?
generic-quit q Q
generic-save s S ^S
generic-reload R
generic-copy c
generic-paste p ^V
generic-change-view TAB
generic-import i I
generic-export x X
generic-goto g G
generic-other-cmd o O
generic-config-menu C
generic-redraw ^R
generic-add-appt ^A
generic-add-todo ^T
generic-prev-day T ^H
generic-next-day t ^L
generic-prev-week W ^K
generic-next-week w
generic-prev-month M
generic-next-month m
generic-prev-year Y
generic-next-year y
generic-scroll-down ^N
generic-scroll-up ^P
generic-goto-today ^G
generic-command :
move-right l L RGT
move-left h H LFT
move-down j J DWN
move-up k K UP
start-of-week 0
end-of-week $
add-item a A
del-item d D
edit-item e E
view-item v V RET
pipe-item |
flag-item !
repeat r
edit-note n N
view-note >
raise-priority +
lower-priority -

+ 1
- 1
misc/profile View File

@ -9,7 +9,7 @@ export ANDROID_HOME=~/Android/Sdk
export FLUTTER_HOME=~/flutter
export TMUX_PLUGIN_MANAGER_PATH=~/.tmux/plugins
export BORG_KEYS_DIR=~/.keys/borg
export BROWSER=firefox-developer-edition
export BROWSER="/home/yigit/.scripts/brave-start"
export EDITOR=vim
export GOPATH=$HOME/go
export ANDROID_HOME=/home/yigit/Android


+ 52
- 0
scripts/dmenu-wallabag View File

@ -0,0 +1,52 @@
#!/bin/bash
itemcache="${XDG_DATA_HOME:-$HOME/.cache}/wallabag-dmenu"
DMENU=${DMENU:-dmenu}
usage() {
cat <<-EOF
usage: dmenu-wallabag [-lah]
-l List Entries
-a Add an entry
-h Print help
EOF
}
update_items(){
[ "$(date -r "$itemcache" "+%d-%m-%Y")" = "$(date '+%d-%m-%Y')" ] ||
wallabag list | head -n -1 | tail -n +2 > $itemcache
}
list_entries() {
update_items
items="$(cat $itemcache)"
selection=$(echo -e "$items\n~SYNC~" | dmenu -l 10 -p "Choose an article:")
if [ "$selection" = "~SYNC~" ]; then
wallabag list | head -n -1 | tail -n +2 > $itemcache
items="$(cat $itemcache)"
selection=$(echo "$items" | dmenu -l 10 -p "Choose an article:")
fi
selection=$(echo "$selection" | cut -d" " -f1)
wallabag update --read $selection
wallabag open $selection
wallabag list | head -n -1 | tail -n +2 > $itemcache
}
add_entry() {
url=$(echo -n "" | dmenu -p "Enter URL:")
wallabag add $url
wallabag list | head -n -1 | tail -n +2 > $itemcache
}
while getopts ':lah' opt; do
case "$opt" in
l) list_entries ;;
a) add_entry ;;
h) usage && exit;;
/?) echo "Unrecognized command: $OPTARG";;
esac
done

+ 4
- 4
suckless/dmenu/dmenu.c View File

@ -551,10 +551,10 @@ keypress(XKeyEvent *ev)
case XK_bracketleft:
cleanup();
exit(1);
case XK_h: ksym = XK_Up; break;
case XK_j: ksym = XK_Next; break;
case XK_k: ksym = XK_Prior; break;
case XK_l: ksym = XK_Down; break;
case XK_h: ksym = XK_Prior; break;
case XK_j: ksym = XK_Down; break;
case XK_k: ksym = XK_Up; break;
case XK_l: ksym = XK_Next; break;
default:
return;
}


+ 5
- 0
suckless/dwm/keybind.h View File

@ -48,6 +48,9 @@ static const char *online_class[] = {"/home/yigit/.scripts/tedportal",NULL};
static const char *bwmenu[] = {"/home/yigit/.scripts/password_manager", NULL};
static const char *wallabag_read[] = {"/home/yigit/.scripts/dmenu-wallabag", "-l",NULL};
static const char *wallabag_add[] = {"/home/yigit/.scripts/dmenu-wallabag", "-a", NULL};
static const char *network_manager[] = {"/home/yigit/.scripts/networkmanager_dmenu", NULL};
static const char *killall[] = {"/home/yigit/.scripts/dmenu-killall", NULL};
static const char *mconnect[] = {"/home/yigit/.scripts/dmenu-mconnect"};
@ -135,6 +138,8 @@ static Key keys[] = {
{ MODKEY, XK_Print, spawn, {.v = windowshot } },
{ MODKEY|ShiftMask, XK_e, spawn, {.v = simcrop } },
{ MODKEY, XK_u, spawn, {.v = url} },
{ MODKEY, XK_w, spawn, {.v = wallabag_read} },
{ MODKEY|ShiftMask, XK_w, spawn, {.v = wallabag_add} },
{ MODKEY, XK_g, spawn, {.v = google} },
{ MODKEY|ShiftMask, XK_c, spawn, {.v = online_class} },
{ MODKEY|ShiftMask, XK_m, spawn, {.v = mconnect} },


Loading…
Cancel
Save