oda: rofi

This commit is contained in:
Meutel 2017-11-21 18:51:47 +01:00
parent f4295e2c52
commit f8a8ca8083
6 changed files with 307 additions and 5 deletions

View File

@ -28,6 +28,8 @@ set $base0D #97bbf7
set $base0E #c0b7f9
set $base0F #fcc09e
set $theme ~/.i3/rofi.theme
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
@ -52,8 +54,11 @@ bindsym $mod+Return exec /usr/local/bin/roxterm
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec /usr/local/bin/dmenu_run
bindsym $mod+u exec rofi -theme $theme -show ssh -ssh-command "{terminal} -e '{ssh-client} {host}'"
bindsym $mod+i exec ~/.i3/menu.sh
bindsym $mod+o exec rofi -modi "browser:~/.i3/rofi-file-browser.sh" -show browser -theme $theme
bindsym $mod+n exec rofi -show run -theme $theme
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.

View File

@ -0,0 +1,3 @@
thunar
vlc
firefox

View File

@ -24,12 +24,12 @@ order += "volume master"
order += "tztime local"
cpu_temperature acpitz0 {
format = " %degrees ⁰C"
format = " %degrees ⁰C"
}
wireless _first_ {
format_up = " (%essid) %ip"
format_down = " down"
format_up = " (%essid) %ip"
format_down = " down"
}
ethernet _first_ {

5
_i3__oda.armorique.lan/menu.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
theme="~/.i3/rofi.theme"
cmd=$( cat ~/.i3/favs | rofi -dmenu -i -theme $theme )
exec $cmd

View File

@ -0,0 +1,98 @@
#!/usr/bin/env bash
# Various options for the file browser script:
ROFI_FB_GENERIC_FO="xdg-open" # command used for opening the selection
ROFI_FB_PREV_LOC_FILE=~/.local/share/rofi/rofi_fb_prevloc
ROFI_FB_HISTORY_FILE=~/.local/share/rofi/rofi_fb_history
ROFI_FB_HISTORY_MAXCOUNT=5 # maximum number of history entries
# Comment the next variable to always start in the last visited directory,
# otherwise rofi_fb will start in the specified directory:
ROFI_FB_START_DIR=$HOME # starting directory
# Uncomment the following line to disable history:
ROFI_FB_NO_HISTORY=1
# Beginning of the script:
# Create the directory for the files of the script
if [ ! -d $(dirname "${ROFI_FB_PREV_LOC_FILE}") ]
then
mkdir -p "$(dirname "${ROFI_FB_PREV_LOC_FILE}")"
fi
if [ ! -d $(dirname "${ROFI_FB_HISTORY_FILE}") ]
then
mkdir -p "$(dirname "${ROFI_FB_HISTORY_FILE}")"
fi
# Initialize $ROFI_FB_CUR_DIR
if [ -d "${ROFI_FB_START_DIR}" ]
then
ROFI_FB_CUR_DIR="${ROFI_FB_START_DIR}"
else
ROFI_FB_CUR_DIR="$PWD"
fi
# Read last location, otherwise we default to $ROFI_FB_START_DIR or $PWD.
if [ -f "${ROFI_FB_PREV_LOC_FILE}" ]
then
ROFI_FB_CUR_DIR=$(cat "${ROFI_FB_PREV_LOC_FILE}")
fi
# Handle argument.
if [ -n "$@" ]
then
if [[ "$@" == /* ]]
then
ROFI_FB_CUR_DIR="$@"
else
ROFI_FB_CUR_DIR="${ROFI_FB_CUR_DIR}/$@"
fi
fi
# If argument is no directory.
if [ ! -d "${ROFI_FB_CUR_DIR}" ]
then
if [ -x "${ROFI_FB_CUR_DIR}" ]
then
coproc ( "${ROFI_FB_CUR_DIR}" > /dev/null 2>&1 )
exec 1>&-
exit;
elif [ -f "${ROFI_FB_CUR_DIR}" ]
then
if [[ "${ROFI_FB_NO_HISTORY}" -ne 1 ]]
then
# Append selected entry to history and remove exceeding entries
sed -i "s|${ROFI_FB_CUR_DIR}|##deleted##|g" "${ROFI_FB_HISTORY_FILE}"
sed -i '/##deleted##/d' "${ROFI_FB_HISTORY_FILE}"
echo "${ROFI_FB_CUR_DIR}" >> "${ROFI_FB_HISTORY_FILE}"
if [ $(cat "${ROFI_FB_HISTORY_FILE}" | wc -l) -gt ${ROFI_FB_HISTORY_MAXCOUNT} ]
then
sed -i 1d "${ROFI_FB_HISTORY_FILE}"
fi
fi
# Open the selected entry with $ROFI_FB_GENERIC_FO
coproc ( "${ROFI_FB_GENERIC_FO}" "${ROFI_FB_CUR_DIR}" > /dev/null 2>&1 )
if [ -d "${ROFI_FB_START_DIR}" ]
then
echo "${ROFI_FB_START_DIR}" > "${ROFI_FB_PREV_LOC_FILE}"
fi
exit;
fi
exit;
fi
# Process current dir.
if [ -n "${ROFI_FB_CUR_DIR}" ]
then
ROFI_FB_CUR_DIR=$(readlink -f "${ROFI_FB_CUR_DIR}")
echo "${ROFI_FB_CUR_DIR}" > "${ROFI_FB_PREV_LOC_FILE}"
pushd "${ROFI_FB_CUR_DIR}" >/dev/null
fi
# Output to rofi
if [[ "${ROFI_FB_NO_HISTORY}" -ne 1 ]]
then
tac "${ROFI_FB_HISTORY_FILE}" | grep "${ROFI_FB_CUR_DIR}"
fi
echo ".."
ls
# vim:sw=4:ts=4:et:

View File

@ -0,0 +1,191 @@
/**
* ROFI Color theme
* User: Qball
* Copyright: Dave Davenport
*/
configuration {
// The display name of this browser
display-ssh: " ";
// The display name of this browser
display-run: "";
// The display name of this browser
display-drun: "";
// The display name of this browser
display-window: "";
display-combi: "";
show-icons: true;
}
/**
* User: Qball
* Copyright: Dave Davenport
*/
* {
// Custom colors (t prefix = transparent)
base00: #101218;
base01: #1f222d;
base02: #252936;
tbase02 :#252936CC;
base03: #7780a1;
base04: #C0C5CE;
base05: #d1d4e0;
base06: #C9CCDB;
base07: #ffffff;
base08: #ee829f;
base09: #f99170;
base0A: #ffefcc;
base0B: #a5ffe1;
base0C: #97e0ff;
base0D: #97bbf7;
base0E: #c0b7f9;
base0F: #fcc09e;
transparent: rgba(0,0,0,0.8);
bgrow: @tbase02;
bordercolor: @base01;
foreground: @base03;
selectedbg: @base05;
selectedfg: @base01;
urgentcolor: @base0F;
inputcolor: @base0E;
tlightblack: @base02;
magenta: @base08;
msgbg: @base05;
msgcolor: @base03;
lightblue: @base03;
backlight: @tbase02;
background-color: transparent;
// Bold, Italic, Underline (base0E)
highlight: underline bold #c0b7f9;
font: "Sauce Code Powerline Medium 16";
}
#window {
location: center;
anchor: center;
transparency: "screenshot";
padding: 10px;
border: 0px;
border-radius: 10px;
color: @magenta;
background-color: @transparent;
spacing: 0;
children: [vertb, mainbox];
orientation: horizontal;
width: 90%;
}
#mainbox {
spacing: 0;
children: [ inputbar, message, listview ];
}
#message {
border-color: @bordercolor;
border: 0px 2px 2px 2px;
padding: 5;
background-color: @msgbg;
}
#message {
font: "Sauce Code Powerline ExtraLight 8";
color: @msgcolor;
}
#inputbar {
color: @inputcolor;
padding: 11px;
background-color: @tlightblack;
border: 2px 2px 2px 2px;
border-radius: 15px 15px 0px 0px;
border-color: @bordercolor;
font: "Sauce Code Pro 18";
}
#entry,prompt,case-indicator {
text-font: inherit;
text-color:inherit;
}
#listview {
padding: 8px;
border-radius: 0px 0px 15px 15px;
border-color: @bordercolor;
border: 0px 2px 2px 2px;
background-color: @bgrow;
dynamic: false;
lines: 10;
columns: 2;
}
#element {
padding: 3px;
vertical-align: 0.5;
border-radius: 4px;
background-color: transparent;
color: @foreground;
font:inherit;
}
#element selected.normal {
background-color: @selectedbg;
}
#element normal active {
foreground: @lightblue;
}
#element normal urgent {
foreground: @urgentcolor;
}
#element alternate normal {
}
#element alternate active {
foreground: @lightblue;
}
#element alternate urgent {
foreground: @urgentcolor;
}
#element selected active {
background-color: @lightblue;
foreground: @selectedfg;
}
#element selected urgent {
background-color: @urgentcolor;
foreground: @selectedfg;
}
#element normal normal {
}
#vertb {
expand: false;
children: [ dummy0, sidebar, dummy1 ];
}
#dummy0, dummy1 {
expand: true;
}
#sidebar {
expand: false;
orientation: vertical;
spacing: 0px;
border: 0px 0px 0px 0px;
}
#button {
font: "FontAwesome 22";
padding: 6px;
border: 2px 0px 2px 2px;
border-radius: 4px 0px 0px 4px;
background-color: @tlightblack;
border-color: @bordercolor;
color: @foreground;
horizontal-align: 0.5;
}
#button selected normal {
color: @selectedfg;
border: 2px 0px 2px 2px;
background-color: @backlight;
border-color: @bordercolor;
}