From c9451dd7b6f8e869739da9723ea8cc82a56f2cac Mon Sep 17 00:00:00 2001 From: Harri Lahtinen Date: Thu, 16 May 2019 01:41:44 +0300 Subject: [PATCH] playing with rofi --- .config/Scripts/on | 34 +++++++++++++++++++++++ .config/Scripts/rofi-bangs.sh | 12 ++++---- .config/Scripts/rofi-googler.sh | 2 +- .config/Scripts/rofi-surfraw-websearch.sh | 2 +- .config/i3/config | 2 +- .config/rofi/config | 2 +- 6 files changed, 44 insertions(+), 10 deletions(-) create mode 100755 .config/Scripts/on diff --git a/.config/Scripts/on b/.config/Scripts/on new file mode 100755 index 0000000..a3b67c8 --- /dev/null +++ b/.config/Scripts/on @@ -0,0 +1,34 @@ + #!/usr/bin/env bash + +# to edit themes in place with live reload: +# ag -l | entr -r $HOME/.config/rofi/on +# use -normal-window flag on rofi if you want to not have to close rofi to get +# back to your editor. +# https://www.reddit.com/r/qtools/comments/amswu9/autoloading_rofi_for_quick_themeing_experience/ + +options="  lock +  logout +  sleep +  hibernate +  reboot +  shutdown" +themes_dir=$HOME/.config/rofi +theme=${1:-$themes_dir/colors-rofi-dark.rasi} +selection=$(echo -e "${options}" | rofi -dmenu -config ~/.config/rofi/config $theme -columns 6 -lines 1 -width 800) + +echo "This is your selection: $selection" + +case "${selection}" in + "  lock") + betterlockscreen -l dim;; + "  logout") + i3-msg exit;; + "  sleep") + betterlockscreen -l dim && systemctl suspend;; + "  hibernate") + betterlockscreen -l dim && systemctl hibernate;; + "  reboot") + systemctl reboot;; + "  shutdown") + systemctl poweroff -i;; +esac diff --git a/.config/Scripts/rofi-bangs.sh b/.config/Scripts/rofi-bangs.sh index 538e1dc..efebdf1 100755 --- a/.config/Scripts/rofi-bangs.sh +++ b/.config/Scripts/rofi-bangs.sh @@ -31,12 +31,12 @@ COMMANDS["lock"]="exec betterlockscreen --lock dim" LABELS["lock"]="" # mpd -COMMANDS["mpd"]="~/.config/Scripts/rofi-mpd -a" -LABELS["mpd"]="" +#COMMANDS["mpd"]="~/.config/Scripts/rofi-mpd -a" +#LABELS["mpd"]="" # googler -COMMANDS["googler"]="~/.config/Scripts/rofi-googler.sh" -LABELS["googler"]="" +#COMMANDS["googler"]="~/.config/Scripts/rofi-googler.sh" +#LABELS["googler"]="" # open bookmarks COMMANDS["bookmarks"]="~/.config/Scripts/rofi-surfraw-bookmarks.sh" @@ -56,8 +56,8 @@ LABELS["workspace"]="" # show clipboard history # source: https://github.com/erebe/greenclip -COMMANDS["clipboard"]='rofi -modi "clipboard:greenclip print" -show clipboard' -LABELS["clipboard"]="" +#COMMANDS["clipboard"]='rofi -modi "clipboard:greenclip print" -show clipboard' +#LABELS["clipboard"]="" # references -------------------------- #COMMANDS[";sr2"]="chromium 'wikipedia.org/search-redirect.php?search=\" \${input}\"" diff --git a/.config/Scripts/rofi-googler.sh b/.config/Scripts/rofi-googler.sh index 8df1985..86363b9 100755 --- a/.config/Scripts/rofi-googler.sh +++ b/.config/Scripts/rofi-googler.sh @@ -11,7 +11,7 @@ search () { case $sel in "") exit ;; "More") search $query $(expr $index + 15) ;; - *) chromium --new-tab $sel ;; + *) google-chrome-stable --new-tab $sel ;; esac } diff --git a/.config/Scripts/rofi-surfraw-websearch.sh b/.config/Scripts/rofi-surfraw-websearch.sh index 61929b2..1f9736f 100755 --- a/.config/Scripts/rofi-surfraw-websearch.sh +++ b/.config/Scripts/rofi-surfraw-websearch.sh @@ -17,6 +17,6 @@ # surfraw https://www.youtube.com/playlist?list=PLqv94xWU9zZ2e-lDbmBpdASA6A6JF4Nyz # set your browser (uncomment if needed, some GUI does not detect browser variable) -BROWSER=chromium +BROWSER=google-chrome-stable surfraw -browser=$BROWSER $(sr -elvi | awk -F'-' '{print $1}' | sed '/:/d' | awk '{$1=$1};1' | rofi -kb-row-select "Tab" -kb-row-tab "Control+space" -dmenu -mesg ">>> Tab = Autocomplete" -i -p "rofi-surfraw-websearch: ") diff --git a/.config/i3/config b/.config/i3/config index ccd4576..90a9222 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -135,7 +135,7 @@ bindsym $mod+Escape workspace prev bindsym $mod+Shift+Escape exec --no-startup-id prompt "Exit i3?" "i3-msg exit" bindsym $mod+BackSpace exec $flash -bindsym $mod+Shift+BackSpace exec ~/.config/Scripts/power-menu.sh +bindsym $mod+Shift+BackSpace exec ~/.config/Scripts/on # Show selection: bindsym $mod+Insert exec --no-startup-id showclip diff --git a/.config/rofi/config b/.config/rofi/config index dc6f9e1..db4bed8 100644 --- a/.config/rofi/config +++ b/.config/rofi/config @@ -13,7 +13,7 @@ rofi.hide-scrollbar: true rofi.width: 30 rofi.modi: window,run,ssh,drun,i3:~/.config/Scripts/i3_switch_workspace.sh rofi.sidebar-mode: true -rofi.terminal: urxvt +rofi.terminal: st rofi.levenshtein-sort: true rofi.separator-style: dash rofi.show-icons: true