From 80211ea764507c6043b7557876459a6e7f8972af Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 5 Feb 2021 22:05:08 +0100 Subject: [PATCH] Added rofi --- .gitignore | 3 +- i3/config | 41 +++---- i3/rofi_calc | 4 + rofi/config.rasi | 277 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 298 insertions(+), 27 deletions(-) create mode 100755 i3/rofi_calc create mode 100644 rofi/config.rasi diff --git a/.gitignore b/.gitignore index 209b517..49a9f9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # write here all files to upload to git /* -.gitignore +!.gitignore !/i3* +!/rofi diff --git a/i3/config b/i3/config index 70e77db..b9916ae 100644 --- a/i3/config +++ b/i3/config @@ -41,16 +41,18 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU floating_modifier $mod # start a terminal -bindsym $mod+Return exec alacritty +bindsym $mod+Return exec xfce4-terminal # kill focused window bindsym $mod+Shift+q kill bindsym $mod+q kill bindsym $mod+Shift+x kill bindsym $mod+x kill +# for x button in laptop (produces alt+f4) +bindsym Mod1+F4 kill # start dmenu (a program launcher) -bindsym $mod+d exec dmenu_recency -i +bindsym $mod+d exec rofi -show run #dmenu_recency -i # 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. @@ -58,9 +60,9 @@ bindsym $mod+d exec dmenu_recency -i # change focus # bindsym $mod+h focus left -bindsym $mod+j focus down -bindsym $mod+k focus up -bindsym $mod+l focus right +#bindsym $mod+j focus down +#bindsym $mod+k focus up +#bindsym $mod+l focus right # alternatively, you can use the cursor keys: bindsym $mod+Left focus left @@ -69,10 +71,10 @@ bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+h move left -bindsym $mod+Shift+j move down -bindsym $mod+Shift+k move up -bindsym $mod+Shift+l move right +#bindsym $mod+Shift+h move left +#bindsym $mod+Shift+j move down +#bindsym $mod+Shift+k move up +#bindsym $mod+Shift+l move right # alternatively, you can use the cursor keys: bindsym $mod+Shift+Left move left @@ -227,20 +229,6 @@ mode "$mode_system" { } bindsym $mod+Shift+e mode "$mode_system" -#set $mode_test System (l) lock, (e) logout, (r) reboot, (s) shutdown -#set $mode_screenshot_file Screenshot to file (w) Active window, (s) Selection, (d) Desktop -#mode "$mode_screenshot_file" { -# bindsym l exec --no-startup-id i3exit lock, mode "default" -# bindsym e exec --no-startup-id i3exit logout, mode "default" -# bindsym r exec --no-startup-id i3exit reboot, mode "default" -# bindsym s exec --no-startup-id i3exit shutdown, mode "default" -# -# # back to normal: Enter or Escape -# bindsym Return mode "default" -# bindsym Escape mode "default" -#} -#bindsym $mod+Shift+Print mode "$mode_screenshot_file" - set $mode_screenshot_file Screenshot to file (w) Active window, (s) Selection, (d) Desktop mode "$mode_screenshot_file" { bindsym w exec --no-startup-id "i3-scrot -w", mode "default" @@ -268,9 +256,10 @@ bindsym $mod+Print mode "$mode_screenshot_clipboard" bindsym $mod+Ctrl+Right move workspace to output right bindsym $mod+Ctrl+Left move workspace to output right -bindsym $mod+c exec jupyter-calculator +bindsym $mod+c exec rofi_calc bindsym $mod+p exec xwacomcalibrate - +bindsym $mod+t exec thunar +bindsym $mod+j exec jupyter-calculator workspace_auto_back_and_forth yes ########## Window settings ########## @@ -285,7 +274,7 @@ assign [class="Element"] workspace $ws9 assign [class="Thunderbird"] workspace $ws10 assign [class="zoom"] workspace $ws5 -#for_window [class="firefox"] focus +for_window [class="firefox"] focus #for_window [class="Thunderbird"] focus for_window [class="TelegramDesktop"] no_focus for_window [class="Rocket.Chat"] no_focus diff --git a/i3/rofi_calc b/i3/rofi_calc new file mode 100755 index 0000000..1897eda --- /dev/null +++ b/i3/rofi_calc @@ -0,0 +1,4 @@ +#!/bin/bash + +LC_NUMERIC=en_US.utf8 +rofi -show calc -modi calc -no-show-match -no-sort -terse -calc-command "echo -n '{result}' | xclip" diff --git a/rofi/config.rasi b/rofi/config.rasi new file mode 100644 index 0000000..aa1b16a --- /dev/null +++ b/rofi/config.rasi @@ -0,0 +1,277 @@ +configuration { + modi: "run,drun"; +/* width: 50;*/ + lines: 10; +/* columns: 1;*/ +/* font: "mono 12";*/ +/* bw: 1;*/ +/* location: 0;*/ +/* padding: 5;*/ +/* yoffset: 0;*/ +/* xoffset: 0;*/ +/* fixed-num-lines: true;*/ + show-icons: true; +/* terminal: "rofi-sensible-terminal";*/ +/* ssh-client: "ssh";*/ +/* ssh-command: "{terminal} -e {ssh-client} {host} [-p {port}]";*/ +/* run-command: "{cmd}";*/ +/* run-list-command: "";*/ +/* run-shell-command: "{terminal} -e {cmd}";*/ +/* window-command: "wmctrl -i -R {window}";*/ +/* window-match-fields: "all";*/ +/* icon-theme: ;*/ +/* drun-match-fields: "name,generic,exec,categories,keywords";*/ +/* drun-categories: ;*/ +/* drun-show-actions: false;*/ +/* drun-display-format: "{name} [({generic})]";*/ +/* drun-url-launcher: "xdg-open";*/ +/* disable-history: false;*/ +/* ignored-prefixes: "";*/ +/* sort: false;*/ +/* sorting-method: "normal";*/ +/* case-sensitive: false;*/ +/* cycle: true;*/ +/* sidebar-mode: false;*/ +/* eh: 1;*/ +/* auto-select: false;*/ +/* parse-hosts: false;*/ +/* parse-known-hosts: true;*/ +/* combi-modi: "window,run";*/ +/* matching: "normal";*/ +/* tokenize: true;*/ +/* m: "-5";*/ +/* line-margin: 2;*/ +/* line-padding: 1;*/ +/* filter: ;*/ +/* separator-style: "dash";*/ +/* hide-scrollbar: false;*/ +/* fullscreen: false;*/ +/* fake-transparency: false;*/ +/* dpi: -1;*/ +/* threads: 0;*/ +/* scrollbar-width: 8;*/ +/* scroll-method: 0;*/ +/* fake-background: "screenshot";*/ +/* window-format: "{w} {c} {t}";*/ +/* click-to-exit: true;*/ +/* show-match: true;*/ +/* theme: ;*/ +/* color-normal: ;*/ +/* color-urgent: ;*/ +/* color-active: ;*/ +/* color-window: ;*/ +/* max-history-size: 25;*/ +/* combi-hide-mode-prefix: false;*/ +/* matching-negate-char: '-' /* unsupported */;*/ +/* cache-dir: ;*/ +/* window-thumbnail: false;*/ +/* drun-use-desktop-cache: false;*/ +/* drun-reload-desktop-cache: false;*/ +/* normalize-match: false;*/ +/* pid: "/run/user/1000/rofi.pid";*/ +/* display-window: ;*/ +/* display-windowcd: ;*/ +/* display-run: ;*/ +/* display-ssh: ;*/ +/* display-drun: ;*/ +/* display-combi: ;*/ +/* display-keys: ;*/ +/* display-file-browser: ;*/ +/* display-calc: ;*/ +/* kb-primary-paste: "Control+V,Shift+Insert";*/ +/* kb-secondary-paste: "Control+v,Insert";*/ +/* kb-clear-line: "Control+w";*/ +/* kb-move-front: "Control+a";*/ +/* kb-move-end: "Control+e";*/ +/* kb-move-word-back: "Alt+b,Control+Left";*/ +/* kb-move-word-forward: "Alt+f,Control+Right";*/ +/* kb-move-char-back: "Left,Control+b";*/ +/* kb-move-char-forward: "Right,Control+f";*/ +/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/ +/* kb-remove-word-forward: "Control+Alt+d";*/ +/* kb-remove-char-forward: "Delete,Control+d";*/ +/* kb-remove-char-back: "BackSpace,Shift+BackSpace,Control+h";*/ +/* kb-remove-to-eol: "Control+k";*/ +/* kb-remove-to-sol: "Control+u";*/ +/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/ + kb-accept-custom: "Control+Return"; +/* kb-accept-alt: "Shift+Return";*/ +/* kb-delete-entry: "Shift+Delete";*/ +/* kb-mode-next: "Shift+Right,Control+Tab";*/ +/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/ +/* kb-row-left: "Control+Page_Up";*/ +/* kb-row-right: "Control+Page_Down";*/ +/* kb-row-up: "Up,Control+p,ISO_Left_Tab";*/ +/* kb-row-down: "Down,Control+n";*/ +/* kb-row-tab: "Tab";*/ +/* kb-page-prev: "Page_Up";*/ +/* kb-page-next: "Page_Down";*/ +/* kb-row-first: "Home,KP_Home";*/ +/* kb-row-last: "End,KP_End";*/ +/* kb-row-select: "Control+space";*/ +/* kb-screenshot: "Alt+S";*/ +/* kb-ellipsize: "Alt+period";*/ +/* kb-toggle-case-sensitivity: "grave,dead_grave";*/ +/* kb-toggle-sort: "Alt+grave";*/ +/* kb-cancel: "Escape,Control+g,Control+bracketleft";*/ +/* kb-custom-1: "Alt+1";*/ +/* kb-custom-2: "Alt+2";*/ +/* kb-custom-3: "Alt+3";*/ +/* kb-custom-4: "Alt+4";*/ +/* kb-custom-5: "Alt+5";*/ +/* kb-custom-6: "Alt+6";*/ +/* kb-custom-7: "Alt+7";*/ +/* kb-custom-8: "Alt+8";*/ +/* kb-custom-9: "Alt+9";*/ +/* kb-custom-10: "Alt+0";*/ +/* kb-custom-11: "Alt+exclam";*/ +/* kb-custom-12: "Alt+at";*/ +/* kb-custom-13: "Alt+numbersign";*/ +/* kb-custom-14: "Alt+dollar";*/ +/* kb-custom-15: "Alt+percent";*/ +/* kb-custom-16: "Alt+dead_circumflex";*/ +/* kb-custom-17: "Alt+ampersand";*/ +/* kb-custom-18: "Alt+asterisk";*/ +/* kb-custom-19: "Alt+parenleft";*/ +/* kb-select-1: "Super+1";*/ +/* kb-select-2: "Super+2";*/ +/* kb-select-3: "Super+3";*/ +/* kb-select-4: "Super+4";*/ +/* kb-select-5: "Super+5";*/ +/* kb-select-6: "Super+6";*/ +/* kb-select-7: "Super+7";*/ +/* kb-select-8: "Super+8";*/ +/* kb-select-9: "Super+9";*/ +/* kb-select-10: "Super+0";*/ +/* ml-row-left: "ScrollLeft";*/ +/* ml-row-right: "ScrollRight";*/ +/* ml-row-up: "ScrollUp";*/ +/* ml-row-down: "ScrollDown";*/ +/* me-select-entry: "MousePrimary";*/ +/* me-accept-entry: "MouseDPrimary";*/ +/* me-accept-custom: "Control+MouseDPrimary";*/ +} + + +/*Dracula theme based on the Purple official rofi theme*/ + +* { + font: "Jetbrains Mono 14"; + foreground: #f8f8f2; + background-color: #282a36; + active-background: #6272a4; + urgent-background: #ff5555; + selected-background: @active-background; + selected-urgent-background: @urgent-background; + selected-active-background: @active-background; + separatorcolor: @active-background; + bordercolor: @active-background; +} + +#window { + background-color: @background; + border: 1; + border-radius: 6; + border-color: @bordercolor; + padding: 5; +} +#mainbox { + border: 0; + padding: 0; +} +#message { + border: 1px dash 0px 0px ; + border-color: @separatorcolor; + padding: 1px ; +} +#textbox { + text-color: @foreground; +} +#listview { + fixed-height: 0; + border: 2px dash 0px 0px ; + border-color: @bordercolor; + spacing: 2px ; + scrollbar: false; + padding: 2px 0px 0px ; +} +#element { + border: 0; + padding: 1px ; +} +#element.normal.normal { + background-color: @background; + text-color: @foreground; +} +#element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +#element.normal.active { + background-color: @active-background; + text-color: @foreground; +} +#element.selected.normal { + background-color: @selected-background; + text-color: @foreground; +} +#element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @foreground; +} +#element.selected.active { + background-color: @selected-active-background; + text-color: @foreground; +} +#element.alternate.normal { + background-color: @background; + text-color: @foreground; +} +#element.alternate.urgent { + background-color: @urgent-background; + text-color: @foreground; +} +#element.alternate.active { + background-color: @active-background; + text-color: @foreground; +} +#scrollbar { + width: 2px ; + border: 0; + handle-width: 8px ; + padding: 0; +} +#sidebar { + border: 2px dash 0px 0px ; + border-color: @separatorcolor; +} +#button.selected { + background-color: @selected-background; + text-color: @foreground; +} +#inputbar { + spacing: 0; + text-color: @foreground; + padding: 1px ; +} +#case-indicator { + spacing: 0; + text-color: @foreground; +} +#entry { + spacing: 0; + text-color: @foreground; +} +#prompt { + spacing: 0; + text-color: @foreground; +} +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +#textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @foreground; +}