From df72b0227c73cb4e032d1d33c2c64e0e5b216897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Fri, 26 Feb 2021 18:00:49 +0300 Subject: [PATCH] Switching to surf as my main browser --- README.md | 7 +++---- misc/profile | 21 --------------------- scripts/dmenu_surf | 11 ++++++++++- scripts/open_url | 0 scripts/password_manager | 3 +++ scripts/purge_hist | 5 +++++ scripts/status-bar/arch | 6 ++++++ suckless/dwm/config.h | 2 +- suckless/dwm/keybind.h | 3 ++- suckless/tabbed/config.h | 8 ++++---- zsh/zshrc | 19 ++++++++++++++++++- 11 files changed, 52 insertions(+), 33 deletions(-) mode change 100644 => 100755 scripts/open_url create mode 100755 scripts/password_manager create mode 100755 scripts/purge_hist diff --git a/README.md b/README.md index 5cc7c839..7b3e8d36 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Fr1nge's Dotfiles - - Welcome to my dungeon. Here, I keep all my configuration files in case I have a stroke and lose all my memory. You're very welcome to explore and use anything in this repository. Have fun! ## My Setup: @@ -30,5 +28,6 @@ Just run `git clone --recurse-submodules github.com/yigitcolakoglu/dotfiles.git ## TODOs -* Switch to surf & tabbed -* Find more cool stuff to add to your rice \ No newline at end of file +* Improve the go function written in surf +* Improve the way indicators look +* !!! High priority add an indicator for insert mode diff --git a/misc/profile b/misc/profile index 98e69f29..16695b0f 100755 --- a/misc/profile +++ b/misc/profile @@ -1,24 +1,3 @@ #!/bin/bash - -# Set environment variables -export SSH_AUTH_SOCK -export QT_QPA_PLATFORMTHEME="qt5ct" -export _JAVA_AWT_WM_NONREPARENTING=1 -export AWT_TOOLKIT=MToolkit -export SHELL=zsh -export TERMINAL=st -export ANDROID_HOME=~/Android/Sdk -export FLUTTER_HOME=~/flutter -export TMUX_PLUGIN_MANAGER_PATH=~/.tmux/plugins -export BORG_KEYS_DIR=~/.keys/borg -export BROWSER=~/.scripts/tabbed_surf -export EDITOR=vim - -# Setup PATH -export PATH="~/.scripts/:~/.local/bin/:$PATH" -export PATH=$PATH:$ANDROID_HOME/tools -export PATH=$PATH:$ANDROID_HOME/platform-tools -export PATH=$PATH:$FLUTTER_HOME/bin - # Start X window manager startx diff --git a/scripts/dmenu_surf b/scripts/dmenu_surf index 4b192e42..1cf9aaa6 100755 --- a/scripts/dmenu_surf +++ b/scripts/dmenu_surf @@ -1,3 +1,12 @@ #!/bin/bash -~/.scripts/tabbed_surf $(echo "" | dmenu -p "Site URL:") +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") + +if [ ! -z "$selection" ] +then + ~/.scripts/tabbed_surf $(echo $selection | sed -E 's/.* : ([^ ]*)$/\1/g') +fi diff --git a/scripts/open_url b/scripts/open_url old mode 100644 new mode 100755 diff --git a/scripts/password_manager b/scripts/password_manager new file mode 100755 index 00000000..e27e6af8 --- /dev/null +++ b/scripts/password_manager @@ -0,0 +1,3 @@ +#!/bin/bash + +bitwarden-dmenu --dmenu-args='-i' --clear-clipboard 30 --session-timeout 100 --sync-vault-after 3600 --on-error 'xargs notify-send --urgency=low' diff --git a/scripts/purge_hist b/scripts/purge_hist new file mode 100755 index 00000000..8161f606 --- /dev/null +++ b/scripts/purge_hist @@ -0,0 +1,5 @@ +#!/bin/bash + +cat ~/.surf/history.txt > ~/.surf/history.txt +cat ~/.surf/history.txt | sort | uniq >~/.surf/history.txt +rm -f ~/.surf/history.txt diff --git a/scripts/status-bar/arch b/scripts/status-bar/arch index 70f02bdc..3215e199 100755 --- a/scripts/status-bar/arch +++ b/scripts/status-bar/arch @@ -6,7 +6,13 @@ if ! updates=$(checkupdates 2> /dev/null | wc -l ); then updates=0 fi +case $BLOCK_BUTTON in + 1) "$TERMINAL" -e yay -Syu;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + echo $updates > ~/.cache/pacman_updates #echo "$ifg $icon $tfg$(cat ~/.cache/pacman_updates)" echo "^c#a48ead^$icon ^d^ $(cat ~/.cache/pacman_updates)" + diff --git a/suckless/dwm/config.h b/suckless/dwm/config.h index cddbec5d..68dd6d5b 100644 --- a/suckless/dwm/config.h +++ b/suckless/dwm/config.h @@ -8,7 +8,7 @@ static const unsigned int systrayspacing = 2; /* systray spacing */ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ static int showsystray = 1; /* 0 means no systray */ static const int tag_padding = 0; -static const char *layoutmenu_cmd = "layoutmenu.sh"; +static const char *layoutmenu_cmd = "~/.scripts/layoutmenu.sh"; /* systray */ static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE; diff --git a/suckless/dwm/keybind.h b/suckless/dwm/keybind.h index d374cb6e..fb53afb2 100644 --- a/suckless/dwm/keybind.h +++ b/suckless/dwm/keybind.h @@ -30,7 +30,7 @@ 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 *bwmenu[] = {"/usr/bin/bitwarden-dmenu", "--dmenu-args=-i", "--clear-clipboard", "30", "--session-timeout", "100", "--sync-vault-after", "3600", "--on-error", "xargs notify-send --urgency=low", NULL}; +static const char *bwmenu[] = {"/home/yigit/.scripts/password_manager", NULL}; static const char *network_manager[] = {"/home/yigit/.scripts/networkmanager_dmenu"}; @@ -73,6 +73,7 @@ static Key keys[] = { { MODKEY|Mod1Mask, XK_f, setlayout, {.v = &layouts[1]} }, /*Spiral*/ { MODKEY|Mod1Mask, XK_g, setlayout, {.v = &layouts[2]} }, /*Grid*/ { MODKEY|Mod1Mask, XK_c, setlayout, {.v = &layouts[3]} }, /*center*/ + { MODKEY|Mod1Mask, XK_d, setlayout, {.v = &layouts[4]} }, /*monocle*/ { MODKEY|Mod1Mask, XK_m, setlayout, {.v = &layouts[5]} }, /*monocle*/ { MODKEY|Mod1Mask, XK_m, setlayout, {.v = &layouts[6]} }, /*Deck*/ { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, /* [>float<] */ diff --git a/suckless/tabbed/config.h b/suckless/tabbed/config.h index cf396749..d70f3fd9 100644 --- a/suckless/tabbed/config.h +++ b/suckless/tabbed/config.h @@ -39,10 +39,10 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } }, { MODKEY|ShiftMask, XK_Return, spawn, { 0 } }, - { ShiftMask, XK_l, rotate, { .i = +1 } }, - { ShiftMask, XK_h, rotate, { .i = -1 } }, - { ShiftMask, XK_j, movetab, { .i = -1 } }, - { ShiftMask, XK_k, movetab, { .i = +1 } }, + { ShiftMask, XK_k, rotate, { .i = +1 } }, + { ShiftMask, XK_j, rotate, { .i = -1 } }, + { Mod1Mask|ShiftMask, XK_j, movetab, { .i = -1 } }, + { Mod1Mask|ShiftMask, XK_k, movetab, { .i = +1 } }, { MODKEY, XK_Tab, rotate, { .i = 0 } }, { MODKEY, XK_grave, spawn, SETPROP("_TABBED_SELECT_TAB") }, diff --git a/zsh/zshrc b/zsh/zshrc index 6d0c08f8..77d7e8e5 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -10,8 +10,25 @@ fi # Created by kuro for 5.8 source <(antibody init) - +# Environment variables +export QT_QPA_PLATFORMTHEME="qt6ct" export GOPATH=$HOME/go +export _JAVA_AWT_WM_NONREPARENTING=1 +export AWT_TOOLKIT=MToolkit +export SHELL=zsh +export TERMINAL=st +export ANDROID_HOME=~/Android/Sdk +export FLUTTER_HOME=~/flutter +export TMUX_PLUGIN_MANAGER_PATH=~/.tmux/plugins +export BORG_KEYS_DIR=~/.keys/borg +export BROWSER=~/.scripts/tabbed_surf +export EDITOR=vim + +# Setup PATH +export PATH="~/.scripts/:~/.local/bin/:$PATH" +export PATH=$PATH:$ANDROID_HOME/tools +export PATH=$PATH:$ANDROID_HOME/platform-tools +export PATH=$PATH:$FLUTTER_HOME/bin export PATH="$PATH:/home/yigit/.scripts:/home/yigit/.gem/ruby/2.7.0/bin:$GOPATH/bin:$GOPATH/binexport:/home/yigit/.local/bin" HISTFILE=~/.zsh_history