From 8c9cbeca7b706971ded0281fb71ee1e0df8dc0e7 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 5 Feb 2021 18:03:22 +0100 Subject: [PATCH 1/5] Setup for laptop --- i3-scrot.conf | 2 +- i3/config | 67 +++++++++++++++++++-------- i3/i3exit | 30 ------------ i3/setupZoom | 2 +- i3/workspace-chat.json | 102 ++++++++++++++++++++++++++++++----------- i3blocks/config | 5 -- 6 files changed, 125 insertions(+), 83 deletions(-) delete mode 100755 i3/i3exit diff --git a/i3-scrot.conf b/i3-scrot.conf index 78da6bb..3b6dfd0 100644 --- a/i3-scrot.conf +++ b/i3-scrot.conf @@ -1 +1 @@ -scrot_dir=/home/julian/Pictures +scrot_dir=/home/julian/Pictures/screenshots diff --git a/i3/config b/i3/config index 8c97d63..70e77db 100644 --- a/i3/config +++ b/i3/config @@ -41,7 +41,7 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU floating_modifier $mod # start a terminal -bindsym $mod+Return exec xfce4-terminal +bindsym $mod+Return exec alacritty # kill focused window bindsym $mod+Shift+q kill @@ -57,10 +57,10 @@ bindsym $mod+d exec dmenu_recency -i # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop # change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+odiaeresis focus right +# bindsym $mod+h focus left +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 +69,10 @@ bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+odiaeresis 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 @@ -156,8 +156,8 @@ bindsym $mod+Shift+9 move container to workspace number $ws9; workspace $ws9 bindsym $mod+Shift+0 move container to workspace number $ws10; workspace $ws10 # Monitor config -set $monitor_left DVI-D-0 -set $monitor_right DVI-D-1 +set $monitor_left eDP1 +set $monitor_right HDMI1 workspace $ws1 output $monitor_left workspace $ws2 output $monitor_left @@ -227,16 +227,43 @@ mode "$mode_system" { } bindsym $mod+Shift+e mode "$mode_system" -set $mode_screenshot Screenshot (w) Active window, (s) Selection -mode "$mode_screenshot" { +#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" - bindsym s exec --no-startup-id "flameshot gui", mode "default" - bindsym Return exec --no-startup-id "flameshot gui", mode "default" + bindsym --release s exec --no-startup-id "i3-scrot -s", mode "default" + bindsym d exec --no-startup-id "i3-scrot -d", mode "default" + bindsym --release Return exec --no-startup-id "i3-scrot -s", mode "default" + + #back to normal: Escape + bindsym Escape mode "default" +} +bindsym $mod+Shift+Print mode "$mode_screenshot_file" + +set $mode_screenshot_clipboard Screenshot to clipboard (w) Active window, (s) Selection, (d) Desktop +mode "$mode_screenshot_clipboard" { + bindsym w exec --no-startup-id "i3-scrot -wc", mode "default" + bindsym --release s exec --no-startup-id "i3-scrot -sc", mode "default" + bindsym d exec --no-startup-id "i3-scrot -dc", mode "default" + bindsym --release Return exec --no-startup-id "i3-scrot -sc", mode "default" # back to normal: Escape bindsym Escape mode "default" } -bindsym $mod+Print mode "$mode_screenshot" +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 @@ -258,7 +285,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 @@ -277,7 +304,7 @@ exec --no-startup-id "i3-msg 'workspace 9: Chat; append_layout ~/.config/i3/work exec firefox exec thunderbird -#exec chat.rocket.RocketChat no_focus +exec chat.rocket.RocketChat no_focus exec im.riot.Riot no_focus exec telegram-desktop no_focus @@ -292,6 +319,10 @@ exec --no-startup-id pamac-tray exec --no-startup-id msm_notifier # Audio exec --no-startup-id start-pulseaudio-x11 +# Display setup +exec_always --no-startup-id /home/julian/.screenlayout/defaultlayout.sh +# Background image +exec_always --no-startup-id "sleep 1; feh --bg-fill /home/julian/nextcloud/space.jpg" # Default workspaces at startup (no need because autostart applications get always focused) #exec --no-startup-id i3-msg workspace $ws1 diff --git a/i3/i3exit b/i3/i3exit deleted file mode 100755 index 70ee124..0000000 --- a/i3/i3exit +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -lock() { - i3lock -} - -case "$1" in - lock) - lock - ;; - logout) - i3-msg exit - ;; - suspend) - lock && systemctl suspend - ;; - hibernate) - lock && systemctl hibernate - ;; - reboot) - systemctl reboot - ;; - shutdown) - systemctl poweroff - ;; - *) - echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" - exit 2 -esac - -exit 0 diff --git a/i3/setupZoom b/i3/setupZoom index a41a0a4..68b3a84 100755 --- a/i3/setupZoom +++ b/i3/setupZoom @@ -2,5 +2,5 @@ zoom & -i3-msg "workspace --no-auto-back-and-forth 5; exec mousepad /home/julian/Nextcloud/studium/zoom.txt" +i3-msg "workspace --no-auto-back-and-forth 5; exec mousepad /home/julian/nextcloud/studium/zoom.txt" i3-msg "workspace --no-auto-back-and-forth 5; append_layout ~/.config/i3/workspace-zoom.json" diff --git a/i3/workspace-chat.json b/i3/workspace-chat.json index 4b2e01d..4ddef67 100644 --- a/i3/workspace-chat.json +++ b/i3/workspace-chat.json @@ -1,53 +1,99 @@ // vim:ts=4:sw=4:et { - // splith split container with 2 children + "border": "none", + "current_border_width": 2, + "floating": "auto_off", + "geometry": { + "height": 1026, + "width": 560, + "x": 1680, + "y": 24 + }, + "marks": [], + "name": "Telegram", + "percent": 0.5, + "swallows": [ + { + "class": "^TelegramDesktop$", + "instance": "^telegram\\-desktop$" + // "title": "^Telegram\\ \\(18\\)$" + } + ], + "type": "con" +} + +{ + // splitv split container with 2 children "border": "normal", "floating": "auto_off", - "layout": "splith", + "layout": "splitv", "marks": [], - "percent": 1, + "percent": 0.5, "type": "con", "nodes": [ { - "border": "none", - "current_border_width": 2, + // splith split container with 1 children + "border": "normal", "floating": "auto_off", - "geometry": { - "height": 1026, - "width": 560, - "x": 1680, - "y": 24 - }, + "layout": "splith", "marks": [], - "name": "Telegram", "percent": 0.5, - "swallows": [ - { - "class": "^TelegramDesktop$", - "instance": "^telegram\\-desktop$" - // "title": "^Telegram\\ \\(18\\)$" - } - ], - "type": "con" + "type": "con", + "nodes": [ + { + // splith split container with 1 children + "border": "normal", + "floating": "auto_off", + "layout": "splith", + "marks": [], + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "normal", + "current_border_width": 2, + "floating": "auto_off", + "geometry": { + "height": 1002, + "width": 800, + "x": 2242, + "y": 46 + }, + "marks": [], + "name": "Element", + "percent": 1, + "swallows": [ + { + "class": "^Element$", + "instance": "^element$" + // "title": "^Element\\ \\|\\ Skipper$", + // "window_role": "^browser\\-window$" + } + ], + "type": "con" + } + ] + } + ] }, { "border": "normal", "current_border_width": 2, "floating": "auto_off", "geometry": { - "height": 1002, - "width": 800, - "x": 2242, - "y": 46 + "height": 715, + "width": 1366, + "x": 183, + "y": 396 }, "marks": [], - "name": "Element", + "name": "Rocket Chat", "percent": 0.5, "swallows": [ { - "class": "^Element$", - "instance": "^element$" - // "title": "^Element\\ \\|\\ wmutter$", + "class": "^Rocket\\.Chat$", + "instance": "^rocket\\.chat$" + // "title": "^Chat\\ der\\ Uni\\ Würzburg$", // "window_role": "^browser\\-window$" } ], diff --git a/i3blocks/config b/i3blocks/config index 031b245..117b198 100644 --- a/i3blocks/config +++ b/i3blocks/config @@ -21,11 +21,6 @@ LABEL= interval=10 signal=10 -[keyboard] -command=./keyboard -interval=10 -LABEL= - [calendar] command=./calendar interval=1 From 80211ea764507c6043b7557876459a6e7f8972af Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 5 Feb 2021 22:05:08 +0100 Subject: [PATCH 2/5] 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; +} From adec927d7e7269f514ad6b84dde210bb5c139247 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sat, 6 Feb 2021 21:47:23 +0100 Subject: [PATCH 3/5] Added vim-like moving --- i3/config | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/i3/config b/i3/config index b9916ae..f08a118 100644 --- a/i3/config +++ b/i3/config @@ -59,10 +59,10 @@ bindsym $mod+d exec rofi -show run #dmenu_recency -i # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop # change focus -# bindsym $mod+h focus left -#bindsym $mod+j focus down -#bindsym $mod+k focus up -#bindsym $mod+l focus right +bindsym $mod+h focus left +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 @@ -71,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 @@ -83,7 +83,7 @@ bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right # split in horizontal orientation -bindsym $mod+h split h +bindsym $mod+Shift+v split h # split in vertical orientation bindsym $mod+v split v @@ -173,7 +173,7 @@ workspace $ws9 output $monitor_right workspace $ws10 output $monitor_right # reload the configuration file -bindsym $mod+Shift+c reload +#bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart # exit i3 (logs you out of your X session) @@ -187,10 +187,10 @@ mode "resize" { # Pressing right will grow the window’s width. # Pressing up will shrink the window’s height. # Pressing down will grow the window’s height. - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym odiaeresis resize grow width 10 px or 10 ppt + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt # same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt @@ -259,7 +259,7 @@ bindsym $mod+Ctrl+Left move workspace to output right bindsym $mod+c exec rofi_calc bindsym $mod+p exec xwacomcalibrate bindsym $mod+t exec thunar -bindsym $mod+j exec jupyter-calculator +bindsym $mod+Shift+c exec jupyter-calculator workspace_auto_back_and_forth yes ########## Window settings ########## From eccc7998fe54983056ff419f74deb3c217146a80 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Mon, 15 Feb 2021 11:19:56 +0100 Subject: [PATCH 4/5] Added mc --- .gitignore | 1 + i3/config | 2 + i3blocks/battery-plus | 793 +++++++++++++++++++++++++++++++++++++++ i3blocks/config | 7 + i3blocks/i3b-gate | 462 +++++++++++++++++++++++ mc/hotlist | 0 mc/ini | 174 +++++++++ mc/mc.ext | 847 ++++++++++++++++++++++++++++++++++++++++++ mc/mc.keymap | 497 +++++++++++++++++++++++++ mc/menu | 369 ++++++++++++++++++ mc/panels.ini | 0 11 files changed, 3152 insertions(+) create mode 100755 i3blocks/battery-plus create mode 100755 i3blocks/i3b-gate create mode 100644 mc/hotlist create mode 100644 mc/ini create mode 100644 mc/mc.ext create mode 100644 mc/mc.keymap create mode 100644 mc/menu create mode 100644 mc/panels.ini diff --git a/.gitignore b/.gitignore index 49a9f9e..9cd22a3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ !.gitignore !/i3* !/rofi +!/mc diff --git a/i3/config b/i3/config index f08a118..6d0a65c 100644 --- a/i3/config +++ b/i3/config @@ -312,6 +312,8 @@ exec --no-startup-id start-pulseaudio-x11 exec_always --no-startup-id /home/julian/.screenlayout/defaultlayout.sh # Background image exec_always --no-startup-id "sleep 1; feh --bg-fill /home/julian/nextcloud/space.jpg" +# Notifications +exec --no-startup-id dunst -config /home/julian/.config/dunst/dunstrc # Default workspaces at startup (no need because autostart applications get always focused) #exec --no-startup-id i3-msg workspace $ws1 diff --git a/i3blocks/battery-plus b/i3blocks/battery-plus new file mode 100755 index 0000000..7cf8588 --- /dev/null +++ b/i3blocks/battery-plus @@ -0,0 +1,793 @@ +#!/usr/bin/env bash +# +# battery-plus +# +# An enhanced battery status indicator for i3blocks. +# +# Requires: +# awk (POSIX compatible) +# bc +# upower +# +# Recommended: +# fonts-font-awesome or fonts-hack +# +# Optional: +# notify-send or dunstify -- for notifications +# zenity -- for dialogs +# +# Copyright (c) 2018 Beau Hastings. All rights reserved. +# License: GNU General Public License v2 +# +# Author: Beau Hastings +# URL: https://github.com/hastinbe/i3blocks-battery-plus + +_PERCENT="%" + +# Hide the battery status if fully-charged, +_HIDE_IF_CHARGED=${_HIDE_IF_CHARGED:-false} + +# Color the battery symbol using gradient. +_USE_BATT_GRADIENT=${_USE_BATT_GRADIENT:-false} + +# Only show symbols. +_SYMBOLS_ONLY=${_SYMBOLS_ONLY:-false} + +# Hide the battery percentage +_HIDE_PERCENTAGE=${_HIDE_PERCENTAGE:-false} + +# Hide the battery time remaining +_HIDE_TIME_REMAINING=${_HIDE_TIME_REMAINING:-true} + +# Hide the time to charge the battery to full +_HIDE_TIME_TO_FULL=${_HIDE_TIME_TO_FULL:-true} + +# Show the direction of change for the battery's percentage +_SHOW_CHARGE_DIRECTION=${_SHOW_CHARGE_DIRECTION:-true} + +# Show an alert symbol when the battery capacity drops to the given percent (0=disable). +_CAPACITY_ALERT=${_CAPACITY_ALERT:-75} + +# Action to take when the battery level reaches critical. +_CRITICAL_ACTION=${_CRITICAL_ACTION:-"notify"} + +# Action to take when the battery level reaches low. +_LOW_ACTION=${_LOW_ACTION:-"notify"} + +# Method to use for notifications +_NOTIFY_PROGRAM=${_NOTIFY_PROGRAM:-"notify-send"} + +# The duration, in milliseconds, for the notification to appear on screen. +_NOTIFY_EXPIRES="1500" + +# Minimum time in seconds between notifications to prevent spam. +_NOTIFY_THROTTLE=${_NOTIFY_THROTTLE:-120} + +# Colors +_COLOR_FULLY_CHARGED=${_COLOR_FULLY_CHARGED:-""} +_COLOR_CHARGING=${_COLOR_CHARGING:-"yellow"} +_COLOR_DISCHARGING=${_COLOR_CHARGING:-"yellow"} +_COLOR_PENDING=${_COLOR_PENDING:-"blue"} +_COLOR_ERROR=${_COLOR_ERROR:-"red"} +_COLOR_BATTERY=${_COLOR_BATTERY:-"white"} +_COLOR_ALERT=${_COLOR_ALERT:-"orange"} +_COLOR_DIRECTIONAL_UP=${_COLOR_DIRECTIONAL_UP:-"green"} +_COLOR_DIRECTIONAL_DOWN=${_COLOR_DIRECTIONAL_DOWN:-"red"} +_COLOR_GRADIENT_START=${_COLOR_GRADIENT_START:-"#FF0000"} +_COLOR_GRADIENT_END=${_COLOR_GRADIENT_END:-"#00FF00"} + +# Symbols +_SYMBOL_FULLY_CHARGED=${_SYMBOL_FULLY_CHARGED:-""} +_SYMBOL_CHARGING=${_SYMBOL_CHARGING:-""} +_SYMBOL_DISCHARGING=${_SYMBOL_DISCHARGING:-""} +_SYMBOL_UNKNOWN=${_SYMBOL_UNKNOWN:-""} +_SYMBOL_PENDING=${_SYMBOL_PENDING:-""} +_SYMBOL_ERROR=${_SYMBOL_ERROR:-""} +_SYMBOL_ALERT=${_SYMBOL_ALERT:-""} +_SYMBOL_BATT_100=${_SYMBOL_BATT_100:-""} +_SYMBOL_BATT_75=${_SYMBOL_BATT_75:-""} +_SYMBOL_BATT_50=${_SYMBOL_BATT_50:-""} +_SYMBOL_BATT_25=${_SYMBOL_BATT_25:-""} +_SYMBOL_BATT_0=${_SYMBOL_BATT_0:-""} +_SYMBOL_DIRECTION_UP=${_SYMBOL_DIRECTION_UP:-"↑"} +_SYMBOL_DIRECTION_DOWN=${_SYMBOL_DIRECTION_DOWN:-"↓"} + +# Get a the system's temporary files directory. +# +# Notes: +# Executes a dry-run so we don't create a file. +# Linux doesn't require the template option, but MacOSX does. +# +# Returns: +# The path to the temporary directory. +get_temp_dir() { + echo $(dirname $(mktemp -ut "battery-plus.XXX")) +} + +# Output text wrapped in a span element +# +# Options: +# -c To specify a text color +# +# Arguments: +# $1 or $3 - String to encapsulate within a span +span() { + local -A attribs + local text="$*" + + if [ -n "$FONT" ]; then attribs[font]="$FONT"; fi + + if [ "$1" = "-c" ]; then + attribs[color]="$2" + text="${*:3}" + fi + + echo "$text" +} + +# Builds html element attributes +# +# Arguments: +# $1 - An associative array of attribute-value pairs +build_attribs() { + local -n array=$1 + for k in "${!array[@]}"; do + echo -n " $k='${array[$k]}'" + done + echo +} + +# Interpolate between 2 RGB colors +# +# Arguments: +# $1 - Color to interpolate from, as a hex triplet prefixed with # +# $2 - Color to interpolate to, as a hex triplet prefixed with # +# $3 - Amount of steps needed to get from start to end color +interpolate_rgb() { + local -i steps=$3 + local -a colors + local color1=$1 + local color2=$2 + local reversed=false + + if (( 0x${color1:1:5} > 0x${color2:1:5} )); then + color1=$2 + color2=$1 + reversed=true + fi + + printf -v startR "%d" 0x${color1:1:2} + printf -v startG "%d" 0x${color1:3:2} + printf -v startB "%d" 0x${color1:5:2} + printf -v endR "%d" 0x${color2:1:2} + printf -v endG "%d" 0x${color2:3:2} + printf -v endB "%d" 0x${color2:5:2} + + stepR=$(( ($endR - $startR) / $steps )) + stepG=$(( ($endG - $startG) / $steps )) + stepB=$(( ($endB - $startB) / $steps )) + + for i in $(seq 0 $steps); do + local -i R=$(( $startR + ($stepR * $i) )) + local -i G=$(( $startG + ($stepG * $i) )) + local -i B=$(( $startB + ($stepB * $i) )) + + colors+=( "$(printf "#%02x%02x%02x\n" $R $G $B)" ) + done + colors+=( "$(printf "#%02x%02x%02x\n" $endR $endG $endB)" ) + + if $reversed; then + reverse colors colors_reversed + echo "${colors_reversed[@]}" + else + echo "${colors[@]}" + fi +} + +# Reverse an array +# +# Arguments: +# $1 - Array to reverse +# $2 - Destination array +reverse() { + local -n arr="$1" rev="$2" + for i in "${arr[@]}" + do + rev=("$i" "${rev[@]}") + done +} + +min() { + echo "if ($1 < $2) $1 else $2" | bc +} + +max() { + echo "if ($1 > $2) $1 else $2" | bc +} + +clamp() { + echo $(min $(max $1 $2) $3) +} + +# Retrieve an item from the provided lookup table based on the percentage of a number +# +# Arguments: +# $1 - A number +# $2 - Number to get a percentage of +# $3 - An array of potential values +plookup() { + if [ -z "$2" -o -z "$3" ]; then + return + fi + + local table=( ${@:3} ) + local number2=${2%.*} + local number1=$(min ${1%.*} $number2) + local percent_max=$(( $number1 * $number2 / 100 )) + local index=$(( $percent_max * ${#table[@]} / 100 )) + + index=$(clamp $index 0 $(( ${#table[@]} - 1 )) ) + + echo ${table[$index]} +} + +# Get battery status. +# +# Returns: +# The battery's status or state. +get_battery_status() { + echo "$__UPOWER_INFO" | awk -W posix '$1 == "state:" {print $2}' +} + +# Get battery warning level. +# +# Returns: +# The battery's warning level. +get_battery_warning_level() { + echo "$__UPOWER_INFO" | awk -W posix '$1 == "warning-level:" {print $2}' +} + +# Get battery percentage. +# +# Returns: +# The battery's percentage, without the %. +get_battery_percent() { + echo "$__UPOWER_INFO" | awk -W posix '$1 == "percentage:" { gsub("%","",$2); print $2}' +} + +# Get battery capacity. +# +# Returns: +# The battery's capcity, without the %. +get_battery_capacity() { + echo "$__UPOWER_INFO" | awk -W posix '$1 == "capacity:" { gsub("%","",$2); print $2}' +} + +# Get battery time left. +# +# Returns: +# The battery's time left. +get_time_to_empty() { + echo "$__UPOWER_INFO" | awk -W posix -F':' '/time to empty:/{print $2}' | xargs +} + +# Get the time remaining until the battery is fully charged. +# +# Returns: +# The time remaining until battery is fully charged. +get_time_to_full() { + echo "$__UPOWER_INFO" | awk -W posix -F':' '/time to full:/{print $2}' | xargs +} + +# Get symbol for the given battery percentage. +# +# Arguments: +# $percent (int) Battery percentage. +# +# Returns: +# The battery symbol. +get_battery_charge_symbol() { + local percent="$1" + local symbol + + if [ "$battery_percentage" -ge 90 ]; then symbol="$_SYMBOL_BATT_100" + elif [ "$battery_percentage" -ge 70 ]; then symbol="$_SYMBOL_BATT_75" + elif [ "$battery_percentage" -ge 40 ]; then symbol="$_SYMBOL_BATT_50" + elif [ "$battery_percentage" -ge 20 ]; then symbol="$_SYMBOL_BATT_25" + else symbol="$_SYMBOL_BATT_0" + fi + + echo "$symbol" +} + +# Get battery status symbol. +# +# Returns: +# An symbol name, following the Symbol Naming Specification +get_battery_status_symbol() { + echo "$__UPOWER_INFO" | awk -W posix '$1 == "symbol-name:" {print $2}' +} + +# Get color for the given battery percentage. +# +# Arguments: +# $percent (int) Battery percentage. +# +# Returns: +# The color to use for the given battery percentage. +get_percentage_color() { + local colors=( $(interpolate_rgb "$_COLOR_GRADIENT_START" "$_COLOR_GRADIENT_END" 8) ) + echo $(plookup $1 100 ${colors[@]}) +} + +# Determines whether or not we can send a notification. +# +# Returns: +# 0 on false, 1 on true. +can_notify() { + local -i now=$(date +"%s") + local -i last=$(get_last_notify_time) + + if [ -z "$last" ]; then return 0; fi + + local -i diff=$(($now - $last)) + + [ $diff -gt $_NOTIFY_THROTTLE ] +} + +# Get the last time we sent a notification. +# +# Returns: +# Time in seconds since the Epoch. +get_last_notify_time() { + if [ -f "$TMP_NOTIFY" ]; then + echo $(stat -c '%Y' "$TMP_NOTIFY") + fi +} + +# Save the last time we sent a notification. +save_last_notify_time() { + touch -m "$TMP_NOTIFY" +} + +# Display the charging indicator. +# +# Returns: +# The charging indicator. +display_batt_charging() { + if [ -n "$_SYMBOL_CHARGING" ]; then + echo -n "$(span -c "${_COLOR_CHARGING}" "$_SYMBOL_CHARGING") " + fi + + echo "$colored_battery_symbol" +} + +# Display the discharging indicator. +# +# Returns: +# The discharging indicator. +display_batt_discharging() { + if [ -n "$_SYMBOL_DISCHARGING" ]; then + echo -n "$(span -c "${_COLOR_DISCHARGING}" "$_SYMBOL_DISCHARGING") " + fi + + echo "$battery_charge_symbol" +} + +# Display the pending charge indicator. +# +# Returns: +# The pending charge indicator. +display_batt_pending_charge() { + if [ -n "$_SYMBOL_PENDING" ]; then + echo -n "$(span -c "${_COLOR_PENDING}" "$_SYMBOL_PENDING") " + fi + + if [ -n "$_SYMBOL_CHARGING" ]; then + echo -n "$(span -c "${_COLOR_CHARGING}" "$_SYMBOL_CHARGING") " + fi + + echo "${battery_charge_symbol}" +} + +# Display the pending discharge indicator. +# +# Returns: +# The pending discharge indicator. +display_batt_pending_discharge() { + if [ -n "$_SYMBOL_PENDING" ]; then + echo -n "$(span -c "${_COLOR_PENDING}" "$_SYMBOL_PENDING") " + fi + + if [ -n "$_SYMBOL_DISCHARGING" ]; then + echo -n "$(span -c "${_COLOR_DISCHARGING}" "$_SYMBOL_DISCHARGING") " + fi + + echo "$colored_battery_symbol" +} + +# Display the empty battery indicator. +# +# Returns: +# The empty battery indicator. +display_batt_empty() { + echo "$battery_charge_symbol" +} + +# Display the fully charged indicator. +# +# Returns: +# The fully-charged indicator. +display_batt_fully_charged() { + if [ -n "$_SYMBOL_FULLY_CHARGED" ]; then + echo -n "$(span -c "${_COLOR_FULLY_CHARGED}" "$_SYMBOL_FULLY_CHARGED") " + fi + + echo "$battery_charge_symbol" +} + +# Display the unknown battery indicator. +# +# Returns: +# The unknonw battery indicator. +display_batt_unknown() { + if [ -n "$_SYMBOL_UNKNOWN" ]; then + echo -n "$(span "$_SYMBOL_UNKNOWN") " + fi + + echo "$(get_battery_charge_symbol 0)" +} + +# Display the battery error indicator. +# +# Returns: +# The battery error indicator. +display_batt_error() { + echo "$(span -c "${_COLOR_ERROR}" "$_SYMBOL_ERROR" "$_SYMBOL_BATT_0")" +} + +# Display the battery percentage. +# +# Returns: +# The battery percentage, or nothing if disabled. +display_percentage() { + if ! [ $_SYMBOLS_ONLY = true -o $_HIDE_PERCENTAGE = true ]; then + echo -n " $(span -c "${percentage_color}" "${battery_percentage:---}${_PERCENT}")" + + if [ "$status" = "charging" ] && $_SHOW_CHARGE_DIRECTION; then + echo -n "$(span -c "${_COLOR_DIRECTIONAL_UP}" "${_SYMBOL_DIRECTION_UP}")" + elif [ "$status" = "discharging" ] && $_SHOW_CHARGE_DIRECTION; then + echo -n "$(span -c "${_COLOR_DIRECTIONAL_DOWN}" "${_SYMBOL_DIRECTION_DOWN}")" + fi + + echo + fi +} + +# Display the battery time remaining. +# +# Arguments: +# $force (bool) Force display. +# +# Returns: +# The time remaining, or nothing if disabled. +display_time_remaining() { + local force=${1:-false} + + if [ $force = true ] || ! [ $_SYMBOLS_ONLY = true -o $_HIDE_TIME_REMAINING = true ]; then + time_to_empty=$(get_time_to_empty "$battery_info") + if [ -n "$time_to_empty" ]; then + echo "$time_to_empty" + fi + fi +} + +# Display the battery time to fully charge. +# +# Arguments: +# $force (bool) Force display. +# +# Returns: +# The time to fully charge, or nothing if disabled. +display_time_to_full() { + local force=${1:-false} + + if [ $force = true ] || ! [ $_SYMBOLS_ONLY = true -o $_HIDE_TIME_TO_FULL = true ]; then + time_to_full=$(get_time_to_full "$battery_info") + if [ -n "$time_to_full" ]; then + echo "$time_to_full" + fi + fi +} + +# Displays an array of segments. +# +# Arguments: +# $segments (array) The an array of segments. +# +# Returns: +# Each segment after another, followed by a newline. +display_segments() { + local -a segments="$@" + + for segment in "${segments[@]}"; do + if [ -n "$segment" ]; then + echo -n "$segment" + fi + done + + echo +} + +# Colors text using either the first or second color +# +# Arguments: +# $1 - Text +# $2 - Color to use if toggle is false +# $3 - Color to use if toggle is true +# $4 - A boolean used to toggle between colors +# +# Returns: +# The colored text +multicolor() { + local color="$2" + local toggle=$4 + + if $toggle && [ -n "$3" ]; then + color="$3" + fi + + if [ -n "$color" ]; then + echo "$(span -c "$color" "$1")" + else + echo "$(span "$1")" + fi +} + + +# Display a notification. +# +# Arguments: +# $text (string) The notification text. +# $symbol (string) Name of an symbol. +# $type (string) The type of notification. +# $force (string) Force the notification, ignoring any throttle. +# $rest (string) Any additional options to pass to the command. +notify() { + local text="$1" + local symbol="$2" + local type="$3" + local force="$4" + local rest="${@:5}" + local command + + if [ -z "$text" ] || ! $force && ! $(can_notify); then return; fi + + if [ "$_NOTIFY_PROGRAM" = "dunstify" ]; then + command="dunstify -r 1001" + elif [ "$_NOTIFY_PROGRAM" = "notify-send" ]; then + command="notify-send" + fi + + if [ -n "$_NOTIFY_EXPIRES" ]; then command="$command -t $_NOTIFY_EXPIRES"; fi + if [ -n "$symbol" ]; then command="$command -i $symbol"; fi + if [ -n "$type" ]; then command="$command -u $type"; fi + + command="$command $rest \"$text\"" + if eval $command; then + save_last_notify_time + fi +} + +# Display a dialog. +# +# Arguments: +# $text (string) The dialog text. +# $symbol (string) Name of an symbol. +# $type (string) The type of dialog. +# $rest (string) Any additional options to pass to the command. +dialog() { + local text="$1" + local symbol="$2" + local type="$3" + local rest="${@:4}" + + if [ -z "$text" ]; then + return + fi + + command="zenity" + + if [ -n "$symbol" ]; then command="$command --symbol-name=\"$symbol\""; fi + if [ -n "$type" ]; then command="$command --${type}"; fi + + command="$command --text=\"$text\" $rest" + eval $command +} + +# Display program usage. +usage() { + echo -e "Usage: $0 [options] +Display the battery status using upower for i3blocks.\n +Options: + -a \taction to take when battery is low + -A \t\tcolor of the alert symbol + -B \t\tcolor of the battery symbol + -c \t\tset battery capacity alert percentage (0=disable) + -C \t\tcolor of the charging symbol + -d\t\t\tshow the direction of change for the battery's percentage + -D \t\tcolor of the discharging symbol + -e \texpiration time of notifications (Ubuntu's Notify OSD and GNOME Shell both ignore this parameter.) + -E \t\tcolor of the battery error symbol + -f \t\tfont for text and symbols + -F \t\tcolor of the fully-charged symbol + -G\t\t\tcolor the battery symbol according to battery percentage + -h\t\t\tdisplay this help and exit + -H\t\t\tsuppress displaying if battery is fully-charged + -i \t\tcolor gradient start color + -I\t\t\tonly display symbols + -j \t\tcolor gradient end color + -J \t\tsymbol for a battery 100% charged + -k\t\t\thide the battery percentage + -K \t\tsymbol for a battery 75% charged + -l \taction to take when the battery level reaches critical + -L \t\tsymbol to indicate there is an alert + -M \t\tsymbol for a battery 50% charged + -n \t\ta libnotify compatible notification program + -N \t\tcolor of the battery charge decreasing indicator + -O \t\tsymbol for a battery with no/low charge + -p \t\tsymbol to use for the percent sign + -P \t\tcolor of the pending charge symbol + -Q \t\tsymbol for a battery 25% charged + -r\t\t\thide the battery time remaining + -R \t\tsymbol to indicate the battery state is undefined + -S \t\tsymbol to indicate battery is fully charged + -t \t\tminimum time in seconds between notifications to prevent spam + -T \t\tsymbol to indicate the battery is charging + -u\t\t\thide the time to charge the battery to full + -U \t\tcolor of the battery charge increasing indicator + -V \t\tsymbol to indicate the battery state is unknown + -W \t\tsymbol to indicate battery charge is increasing + -X \t\tsymbol to indicate the battery state is pending + -Y \t\tsymbol to indicate the battery is discharging + -Z \t\tsymbol to indicate battery charge is decreasing +" 1>&2 + exit 1 +} + +############################################################################### + +declare -a long_segments +declare -a short_segments + +__UPOWER_INFO=$(upower --show-info "/org/freedesktop/UPower/devices/battery_${BLOCK_INSTANCE:-BAT0}") +TMP_NOTIFY="$(get_temp_dir)/battery-plus.last_notify" + +while getopts "a:A:B:c:C:dD:e:E:F:GhHi:Ij:J:kK:l:L:M:n:N:O:p:P:Q:rR:S:t:T:uU:V:W:X:Y:Z:" o; do + case "$o" in + a) _LOW_ACTION="${OPTARG}" ;; + A) _COLOR_ALERT="${OPTARG}" ;; + B) _COLOR_BATTERY="${OPTARG}" ;; + c) _CAPACITY_ALERT="${OPTARG}" ;; + C) _COLOR_CHARGING="${OPTARG}" ;; + d) _SHOW_CHARGE_DIRECTION=true ;; + D) _COLOR_DISCHARGING="${OPTARG}" ;; + e) _NOTIFY_EXPIRES="${OPTARG}" ;; + E) _COLOR_ERROR="${OPTARG}" ;; + F) _COLOR_FULLY_CHARGED="${OPTARG}" ;; + G) _USE_BATT_GRADIENT=true ;; + h | *) usage ;; + H) _HIDE_IF_CHARGED=true ;; + i) _COLOR_GRADIENT_START="${OPTARG}" ;; + I) _SYMBOLS_ONLY=true ;; + j) _COLOR_GRADIENT_END="${OPTARG}" ;; + J) _SYMBOL_BATT_100="${OPTARG}" ;; + k) _HIDE_PERCENTAGE=true ;; + K) _SYMBOL_BATT_75="${OPTARG}" ;; + l) _CRITICAL_ACTION="${OPTARG}" ;; + L) _SYMBOL_ALERT="${OPTARG}" ;; + M) _SYMBOL_BATT_50="${OPTARG}" ;; + n) _NOTIFY_PROGRAM="${OPTARG}" ;; + N) _COLOR_DIRECTIONAL_DOWN="${OPTARG}" ;; + O) _SYMBOL_BATT_0="${OPTARG}" ;; + p) _PERCENT="${OPTARG}" ;; + P) _COLOR_PENDING="${OPTARG}" ;; + Q) _SYMBOL_BATT_25="${OPTARG}" ;; + r) _HIDE_TIME_REMAINING=true ;; + R) _SYMBOL_ERROR="${OPTARG}" ;; + S) _SYMBOL_FULLY_CHARGED="${OPTARG}" ;; + t) _NOTIFY_THROTTLE="${OPTARG}" ;; + T) _SYMBOL_CHARGING="${OPTARG}" ;; + u) _HIDE_TIME_TO_FULL=true ;; + U) _COLOR_DIRECTIONAL_UP="${OPTARG}" ;; + V) _SYMBOL_UNKNOWN="${OPTARG}" ;; + W) _SYMBOL_DIRECTION_UP="${OPTARG}" ;; + X) _SYMBOL_PENDING="${OPTARG}" ;; + Y) _SYMBOL_DISCHARGING="${OPTARG}" ;; + Z) _SYMBOL_DIRECTION_DOWN="${OPTARG}" ;; + esac +done +shift $((OPTIND-1)) # Shift off options and optional -- + +battery_percentage=$(get_battery_percent) +percentage_color=$(get_percentage_color "$battery_percentage") +capacity=$(get_battery_capacity) +battery_charge_symbol=$(get_battery_charge_symbol "$battery_percentage") +battery_status_symbol=$(get_battery_status_symbol) +colored_battery_symbol=$(multicolor "$battery_charge_symbol" "$_COLOR_BATTERY" "$percentage_color" $_USE_BATT_GRADIENT) +warning_level=$(get_battery_warning_level) + +# Handle battery warning levels +case "$warning_level" in + critical) + case "$_CRITICAL_ACTION" in + notify) $(notify "$(span "Your battery level is ${warning_level}!")" "$battery_status_symbol" "critical" false "-c device") ;; + esac + ;; + low) + case "$_LOW_ACTION" in + notify) $(notify "$(span "Your battery level is ${warning_level}")" "$battery_status_symbol" "normal" false "-c device") ;; + esac + ;; +esac + +# Displayable alerts +if [ "$_CAPACITY_ALERT" -gt 0 ] && [ "${capacity%.*}" -le $_CAPACITY_ALERT ]; then + CAPACITY_TRIGGERED=true + long_segments+=( "$(span -c "$_COLOR_ALERT" "$_SYMBOL_ALERT") " ) +fi + +# Battery statuses +status=$(get_battery_status) +case "$status" in + charging) long_segments+=( "$(display_batt_charging)" ) ;; + discharging) long_segments+=( "$(display_batt_discharging)" ) ;; + empty) long_segments+=( "$(display_batt_empty)" ) ;; + fully-charged) + if $_HIDE_IF_CHARGED; then + exit 0 + fi + long_segments+=( "$(display_batt_fully_charged)" ) + ;; + pending-charge) long_segments+=( "$(display_batt_pending_charge)" ) ;; + pending-discharge) long_segments+=( "$(display_batt_pending_discharge)" ) ;; + unknown) long_segments+=( "$(display_batt_unknown)" ) ;; + *) long_segments+=( "$(display_batt_error)" ) ;; +esac + +# Since long_segments contains no text at this point, lets use it for the short_text +short_segments=( "${long_segments[@]}" ) + +# Append all text segments +long_segments+=( "$(display_percentage)" ) +if [ -n "$(display_time_remaining)" ]; then + long_segments+=( "($(display_time_remaining))" ) +fi +if [ -n "$(display_time_to_full)" ]; then + long_segments+=( "($(display_time_to_full))" ) +fi + +# Display the block long_text +display_segments ${long_segments[@]} + +# Display the block short_text +display_segments ${short_segments[@]} + +# Handle click events +case $BLOCK_BUTTON in + 1) + if [ -n "$CAPACITY_TRIGGERED" ]; then + $(dialog "$(span "Your battery capacity has reduced to ${capacity%.*}${_PERCENT}!")" "battery-caution" "warning" "--no-wrap") + else + if [ "$status" = "discharging" ]; then + $(notify "$(span "$(display_time_remaining true) remaining")" "alarm-symbolic" "normal" true "-c device") + elif [ "$status" = "charging" ]; then + $(notify "$(span "$(display_time_to_full true) until fully charged")" "alarm-symbolic" "normal" true "-c device") + fi + fi + ;; +esac + +if [ -n "$battery_percentage" ] && [ "$battery_percentage" -le 5 ]; then + exit 33 +fi diff --git a/i3blocks/config b/i3blocks/config index 117b198..fbd40a8 100644 --- a/i3blocks/config +++ b/i3blocks/config @@ -5,6 +5,9 @@ # # https://vivien.github.io/i3blocks +# Sources: +# https://github.com/hastinbe/i3blocks-battery-plus +# https://github.com/zakariaGatter/i3blocks-gate # Global properties separator=true @@ -21,6 +24,10 @@ LABEL= interval=10 signal=10 +[battery] +command=./i3b-gate 6 +interval=120 + [calendar] command=./calendar interval=1 diff --git a/i3blocks/i3b-gate b/i3blocks/i3b-gate new file mode 100755 index 0000000..9a9478f --- /dev/null +++ b/i3blocks/i3b-gate @@ -0,0 +1,462 @@ +#!/usr/bin/env bash +# Zakaria Barkouk ( Zakaria.gatter@gmail.com) + +#---------------------# +# SHOW CPU INFO (TOP) # +#---------------------# +_BLOCK_1_(){ #{{{ + mpstat | awk '/all/{print "'"${1:-} "'"$4}' +} #}}} + +#--------------------# +# SHOW ALL CPUS INFO # +#--------------------# +_BLOCK_2_(){ #{{{ + mpstat -P ALL | awk -v icon=${1:-} 'BEGIN{printf "%s ", icon} { + if($3 ~ /^[0-9]/){ + printf "%s ", $4 + } + }' +} #}}} + +#--------------------------# +# SHOW MEMORY USAGE (FREE) # +#--------------------------# +_BLOCK_3_(){ #{{{ + free -h | awk '/^Mem:/{print "'"${1:-} "'"$3}' +} #}}} + +#------------------------# +# SHOW SWAP USAGE (FREE) # +#------------------------# +_BLOCK_4_(){ #{{{ + free -h | awk '/^Swap:/{print "'"${1:-}"' "$3}' +} #}}} + +#---------------------------# +# SHOW DATE AND TIME (DATE) # +#---------------------------# +_BLOCK_5_(){ #{{{ + date +"${1:-} %R %D" +} #}}} + +#----------------------------# +# SHOW BATTERY STATUS (ACPI) # +#----------------------------# +_BLOCK_6_(){ #{{{ + Bat=$(acpi | awk '{gsub(",|%","",$4); print $4}'); + adapt=$(acpi -a | awk '{print $3}'); + + if [ "$adapt" = "on-line" -a -n "$Bat" ];then + icon0=" " + icon1=" " + icon2=" " + icon3=" " + icon4=" " + elif [ "$adapt" = "on-line" ];then + icon0="" + icon1="" + icon2="" + icon3="" + icon4="" + else + icon0="" + icon1="" + icon2="" + icon3="" + icon4="" + fi + + [ -z "$Bat" ] && echo "$icon0 $adapt" && return + [ "$Bat" -gt "100" ] && echo "$icon4 Full" + [ "$Bat" -gt "90" ] && echo "$icon3 $Bat%" + [ "$Bat" -gt "60" ] && echo "$icon2 $Bat%" + [ "$Bat" -gt "30" ] && echo "$icon1 $Bat%" + [ "$Bat" -lt "30" ] && echo "$icon0 $Bat%" +} #}}} + +#----------------------# +# SHOW DISK USAGE (DF) # +#----------------------# +_BLOCK_7_() { #{{{ + df -h "${1:-/}" | awk '/\/dev\//{print "'"${2:-}"' "$3-G"/"$2}' +} #}}} + +#----------------------# +# SHOW KEYBOARD LAYOUT # +#----------------------# +_BLOCK_8_() { #{{{ + awk -F '"' '/XKBLAYOUT/{print "'"${1:-} "'"$2}' /etc/default/keyboard +} #}}} + +#----------------------# +# SHOW SYSTEM LANGUAGE # +#----------------------# +_BLOCK_9_(){ #{{{ + echo "${1:-} ${LANG/.UTF-8/}" +} #}}} + +#------------------------------# +# SHOW MACHINE UPTIME (UPTIME) # +#------------------------------# +_BLOCK_10_() { #{{{ + uptime | awk '{sub(",","",$4); print "'"${1:- } "'"$3 " " $4}' +} #}}} + +#----------------------# +# SHOW TRASH SIZE (DU) # +#----------------------# +_BLOCK_11_() { #{{{ + [ -d "$HOME/.local/share/Trash/files" ] && { + du -hc $HOME/.local/share/Trash/files | awk '/total$/{print "'"${1:-} "'"$1}' + } || { + echo "${1:-} ---" + } +} #}}} + +#-------------------# +# SHOW WINDOW USAGE # +#-------------------# +_BLOCK_12_() { #{{{ + focus=$(xprop -id `xprop -root | awk '/^_NET_ACTIVE_WINDOW/{print $5}'` | awk -F '"' '/^WM_NAME/{print $2}') + if [ -z "$focus" ];then + echo "${1:-} Welcome" + else + [ "${#focus}" -gt "${2:-30}" ] && echo "${1:-} ${focus::${2:-30}} ..." || echo "${1:-} $focus" + fi +} #}}} + +#-----------------------------------------# +# SHOW MOCP PLAYING SONG AND STATUS (MOC) # +#-----------------------------------------# +_BLOCK_13_() { # {{{ + Title=$(mocp -Q %title) + F_Title=$(basename `mocp -Q %file | tr " " "_"`) + Status=$(mocp -Q %state) + + if [ "$Status" != "PLAY" ];then + echo "${1:-} Pause" + elif [ -z "$Title" ];then + echo "${1:-} ${F_Title::30}" + else + echo "${1:-} $Title" + fi +} #}}} + +#------------------------------------------------------# +# SHOW MPD PLAYING SONG AND STATUS (MPD; NCMPCCP, MPC) # +#------------------------------------------------------# +_BLOCK_14_() { #{{{ +local NCMP=$(mpc | awk '/^\[playing\]/{print $1}') + +if [ "$NCMP" = "[playing]" ];then + echo "${1:-} $(basename $(mpc current)) " +else + echo "${1:-} Pause " +fi +} #}}} + +#-------------------------# +# SHOW CPU TEMP (XSENSER) # +#-------------------------# +_BLOCK_15_() { #{{{ + sensors | awk '/^CPU/{gsub("\+",""); print "'"${1:-} "'"$2}' +} #}}} + +#-------------------------# +# SHOW GPU TEMP (XSENSER) # +#-------------------------# +_BLOCK_16_() { #{{{ + sensors | awk '/^GPU/{gsub("\+",""); print "'"${1:-} "'"$2}' | tail -1 +} #}}} + +#----------------------------------# +# SHOW TOUCHPAD STATUS (SYSCLIENT) # +#----------------------------------# +_BLOCK_17_() { #{{{ + [ "$(synclient -l | awk '/Touchpad/{print $3}')" = "0" ] && echo "${1:-} Enable" || echo "${1:-} Disable" +} #}}} + +#---------------------------# +# SHOW VOLUME STATUS (ALSA) # +#---------------------------# +_BLOCK_18_() { #{{{ +local Vol=$(amixer get Master | awk '/Mono:/{gsub("\[|\%|\]",""); print $4}') +local Mute=$(amixer get Master | awk '/Mono:/{gsub("\[|\]",""); print $6}') + +if [ "$Mute" = "off" ];then + echo -e " --" +else + if [ "$Vol" -gt "60" ];then + echo -e " $Vol%" + elif [ "$Vol" -gt "30" ];then + echo -e " $Vol%" + elif [ "$Vol" -lt "30" ];then + echo -e " $Vol%" + fi +fi +} #}}} + +#----------------------------------------------# +# SHOW WIFI INFO ; IP ; CONNECTED NAME (NMCLI) # +#----------------------------------------------# +_BLOCK_19_() { #{{{ +while read -a W ;do + [ "${W[2]}" = "connected" ] && { + _ip=$(nmcli device show ${W[0]} | awk '/^IP4.ADDRESS/{print $NF}') + _name=$(nmcli device show ${W[0]} | awk '/^GENERAL.CONNECTION:/{$1=""; print $0}') + echo -n "${1:-} ${_ip%/*} (${_name} )" + } || { + echo -n "${1:-} ---" + } +done< <(nmcli d | grep -w "wifi") +echo -e "" +} #}}} + +#-------------------------------------------# +# SHOW ETHERNET INFO ; IP ; CONNECTED NAME # +#-------------------------------------------# +_BLOCK_20_() { #{{{ +while read -a W ;do + [ "${W[2]}" = "connected" ] && { + _ip=$(nmcli device show ${W[0]} | awk '/^IP4.ADDRESS/{print $NF}') + _name=$(nmcli device show ${W[0]} | awk '/^GENERAL.CONNECTION:/{$1=""; print $0}') + echo -n "${1:-} ${_ip%/*} (${_name} ) " + } || { + echo -n "${1:-} ---" + } +done< <(nmcli d | grep "ethernet") +echo -e "" +} #}}} + + +#-----------------------------------------------# +# SHOW WIFI INFO ; IP6 ; CONNECTED NAME (NMCLI) # +#-----------------------------------------------# +_BLOCK_21_() { #{{{ +while read -a W ;do + [ "${W[2]}" = "connected" ] && { + _ip=$(nmcli device show ${W[0]} | awk '/^IP6.ADDRESS/{print $NF}') + _name=$(nmcli device show ${W[0]} | awk '/^GENERAL.CONNECTION:/{$1=""; print $0}') + echo -n "${1:-} ${_ip%/*} (${_name} ) " + } || { + echo -n "${1:-} ---" + } +done< <(nmcli d | grep "wifi") +echo -e "" +} #}}} + +#--------------------------------------------# +# SHOW ETHERNET INFO ; IP6 ; CONNECTED NAME # +#--------------------------------------------# +_BLOCK_22_() { #{{{ +while read -a W ;do + [ "${W[2]}" = "connected" ] && { + _ip=$(nmcli device show ${W[0]} | awk '/^IP6.ADDRESS/{print $NF}') + _name=$(nmcli device show ${W[0]} | awk '/^GENERAL.CONNECTION:/{$1=""; print $0}') + echo -n "${1:-} ${_ip%/*} (${_name} ) " + } || { + echo -n "${1:-} ---" + } +done< <(nmcli d | grep "ethernet") +echo -e "" +} #}}} + +#-------------------------------# +# SHOW PROSSES USE BY THIS USER # +#-------------------------------# +_BLOCK_23_() { #{{{ + echo "${1:-} $(ps -U $USER | wc -l)" +} #}}} + +#---------------------# +# SHOW SYSTEM KERENEL # +#---------------------# +_BLOCK_24_() { #{{{ + echo "${1:-} $(uname -r)" +} #}}} + +#-----------------------------# +# SHOW USB PLUG IN UR COMPUTE # +#-----------------------------# +_BLOCK_25_() { #{{{ + echo "${1:-} $(lsblk -l -o 'TRAN' | grep -c "usb")" +} #}}} + +#---------------------------------------# +# SHOW TOTAL PKGS INSTALL IN YOUR SYSTE # +#---------------------------------------# +_BLOCK_26_() { #{{{ + echo "${1:-} $(dpkg -l | grep -c "^ii")" +} #}}} + +#--------------------------------------------# +# CHECK IF THERE IS ANY UPDATE IN UR SYSTEM # +#--------------------------------------------# +_BLOCK_27_() { #{{{ + local U_PKGS=$(apt-get -s -o APT::Get::Show-User-Simulation-Note=0 dist-upgrade | grep "^\s\s" | wc -w); + echo "${1:-} $U_PKGS" +} #}}} + +#-----------------# +# SHOW UFW STATUS # +#-----------------# +_BLOCK_28_() { #{{{ + [ "$(systemctl status ufw | awk '/Active:/{print $2}')" == "active" ] && echo "${1:-} On" || echo "${1:-} Off" +} #}}} + +#-------------------------# +# SHOW NUMBER LOCK STATUS # +#-------------------------# +_BLOCK_29_() { #{{{ + [ "$(xset -q | awk '/00:/{print $8}')" == "on" ] && echo "${1:-} On" || echo "${1:-} Off" +} #}}} + +#-----------------------# +# SHOW BLUETOOTH STATUS # +#-----------------------# +_BLOCK_30_() { #{{{ + [ "$(systemctl status bluetooth.target | awk '/Active:/{print $2}')" == "active" ] && echo "${1:-} On" || echo "${1:-} Off" +} #}}} + +#------------------------# +# SHOW CAPS LOCK STATUS # +#------------------------# +_BLOCK_31_() { #{{{ + [ "$(xset -q | awk '/00:/{print $4}')" == "on" ] && echo "${1:-} On" || echo "${1:-} Off" +} #}}} + +#-----------------------------# +# DISPLAY X SCREENSAVER STATE # +#-----------------------------# +_BLOCK_32_() { #{{{ + [ "$(xdg-screensaver status)" != "enabled" ] && echo "${1:-} Off" || echo "${1:-} On" +} #}}} + +#--------------------------------# +# CALCULE MOUNT POINTS ON SYSTEM # +#--------------------------------# +_BLOCK_33_() { #{{{ + echo "${1:-} $(cat /proc/mounts | grep -c "^/dev/sd*") " +} #}}} + +#-------------------------# +# SHOW CMUS PLAYING SONG # +#-------------------------# +_BLOCK_34_() { #{{{ + local CMUS_P=$(cmus-remote -Q | awk '/^status/{print $2}') + local CMUS_F=$(cmus-remote -Q | awk '/^file/{$1=""; print $2}') + + if [ "$CMUS_P" = "Playing" ];then + echo "${1:-} $(basename $CMUS_F)" + else + echo "${1:-} Pause" + fi +} #}}} + +#----------------------# +# SHOW APPARMOR STATUS # +#----------------------# +_BLOCK_35_() { #{{{ + [ "$(aa-enabled)" = "Yes" ] && { + echo "${1:-} On" + }||{ + echo "${1:-} Off" + } +} #}}} + +#-----------------------------# +# SHOW TOTAL PACKAGES IN ARCH # +#-----------------------------#{{{ +_BLOCK_36_(){ + echo "${1:-} $(pacman -Q | grep -c "*")" +} +#}}} + +#--------------------# +# SHOW I3 WORKSPACES # +#--------------------# +_BLOCK_37_() { #{{{ +i3-msg -t get_workspaces | awk -F , '{ + for(i=1;i<=NF;i++){ + if($i~"name"){ + gsub("\"name\":|\"","",$i) + WK=$i + } + if($i~"focused"){ + gsub("\"focused\":","",$i) + WKF=$i + } + if($i~"urgent"){ + gsub("\"urgent\":|\]|\}","",$i) + if($i=="false" && WKF=="true"){ + printf "%s ", WK + } + if($i=="false" && WKF=="false"){ + printf"[%s] ", WK + } + if($i=="true" && WKF=="false"){ + printf "[*%s] ", WK + } + if($i=="true" && WKF=="true"){ + printf "*%s ", WK + } + } + } +}' +} #}}} + +#-----------------# +# SHOW USER NAME # +#-----------------# +_BLOCK_38_(){ #{{{ + echo -e "${1:-} $USER" +} #}}} + +#-------------------# +# SHOW VOLUME PULSE # +#-------------------# +_BLOCK_39_(){ +local Vol=$(pactl list sinks | awk '/Volume: front/{print $5-"%"}') +local Mute=$(amixer get Master | awk '/Mono:/{gsub("\[|\]",""); print $6}') + +if [ "$Mute" = "off" ];then + echo -e " --" +else + if [ "$Vol" -gt "60" ];then + echo -e " $Vol%" + elif [ "$Vol" -gt "30" ];then + echo -e " $Vol%" + elif [ "$Vol" -lt "30" ];then + echo -e " $Vol%" + fi +fi +} + +#------------------------# +# USAGE AND HELP DIALOG # +#------------------------# +_USAGE_(){ #{{{ +echo -e " +i3b-gate : is a all in one collaction of small script + show you useful unformation about your system + + There is 39 deffirent script to use + for more information you can see the 'README' file + or visite 'https://gitlab.com/zakariagatter/i3blocks-gate' + +SYNTAX : + i3b-gate [NUMBER] ... +" +} #}}} + +#----------------# +# MAIN ARGUMENT # +#----------------# +if [ "$1" -gt "39" ] || [ -z "$1" ] ;then + _USAGE_ +elif [ "$1" = "-h" ]; then + _USAGE_ +else + eval $(echo "_BLOCK_$1_ $2 $3") +fi diff --git a/mc/hotlist b/mc/hotlist new file mode 100644 index 0000000..e69de29 diff --git a/mc/ini b/mc/ini new file mode 100644 index 0000000..85c7ee4 --- /dev/null +++ b/mc/ini @@ -0,0 +1,174 @@ +[Midnight-Commander] +verbose=true +shell_patterns=true +auto_save_setup=true +preallocate_space=false +auto_menu=false +use_internal_view=true +use_internal_edit=false +clear_before_exec=true +confirm_delete=true +confirm_overwrite=true +confirm_execute=false +confirm_history_cleanup=true +confirm_exit=false +confirm_directory_hotlist_delete=false +confirm_view_dir=false +safe_delete=false +safe_overwrite=false +use_8th_bit_as_meta=false +mouse_move_pages_viewer=true +mouse_close_dialog=false +fast_refresh=false +drop_menus=false +wrap_mode=false +old_esc_mode=true +cd_symlinks=true +show_all_if_ambiguous=false +use_file_to_guess_type=true +alternate_plus_minus=false +only_leading_plus_minus=true +show_output_starts_shell=false +xtree_mode=false +file_op_compute_totals=true +classic_progressbar=true +use_netrc=true +ftpfs_always_use_proxy=false +ftpfs_use_passive_connections=true +ftpfs_use_passive_connections_over_proxy=false +ftpfs_use_unix_list_options=true +ftpfs_first_cd_then_ls=true +ignore_ftp_chattr_errors=true +editor_fill_tabs_with_spaces=false +editor_return_does_auto_indent=true +editor_backspace_through_tabs=false +editor_fake_half_tabs=true +editor_option_save_position=true +editor_option_auto_para_formatting=false +editor_option_typewriter_wrap=false +editor_edit_confirm_save=true +editor_syntax_highlighting=true +editor_persistent_selections=true +editor_drop_selection_on_copy=true +editor_cursor_beyond_eol=false +editor_cursor_after_inserted_block=false +editor_visible_tabs=true +editor_visible_spaces=true +editor_line_state=false +editor_simple_statusbar=false +editor_check_new_line=false +editor_show_right_margin=false +editor_group_undo=false +editor_state_full_filename=false +editor_ask_filename_before_edit=false +nice_rotating_dash=true +mcview_remember_file_position=false +auto_fill_mkdir_name=true +copymove_persistent_attr=true +pause_after_run=1 +mouse_repeat_rate=100 +double_click_speed=250 +old_esc_mode_timeout=1000000 +max_dirt_limit=10 +num_history_items_recorded=60 +vfs_timeout=60 +ftpfs_directory_timeout=900 +ftpfs_retry_seconds=30 +fish_directory_timeout=900 +editor_tab_spacing=8 +editor_word_wrap_line_length=72 +editor_option_save_mode=0 +editor_backup_extension=~ +editor_filesize_threshold=64M +editor_stop_format_chars=-+*\\,.;:&> +mcview_eof= +skin=default + +filepos_max_saved_entries=1024 + +[Layout] +message_visible=true +keybar_visible=true +xterm_title=true +output_lines=0 +command_prompt=true +menubar_visible=true +free_space=true +horizontal_split=false +vertical_equal=true +left_panel_size=33 +horizontal_equal=true +top_panel_size=16 + +[Misc] +timeformat_recent=%b %e %H:%M +timeformat_old=%b %e %Y +ftp_proxy_host=gate +ftpfs_password=anonymous@ +display_codepage=UTF-8 +source_codepage=Other_8_bit +autodetect_codeset= +clipboard_store= +clipboard_paste= + +[Colors] +base_color= +xterm-256color= +color_terminals= + +xterm= + +alacritty= + +[Panels] +simple_swap=false +show_mini_info=true +kilobyte_si=true +mix_all_files=false +show_backups=true +show_dot_files=true +fast_reload=false +fast_reload_msg_shown=false +mark_moves_down=true +reverse_files_only=true +auto_save_setup_panels=false +navigate_with_arrows=true +panel_scroll_pages=true +panel_scroll_center=false +mouse_move_pages=true +filetype_mode=true +permission_mode=false +torben_fj_mode=false +quick_search_mode=2 +select_flags=6 + +[FindFile] +file_case_sens=true +file_shell_pattern=true +file_find_recurs=true +file_skip_hidden=false +file_all_charsets=false +content_case_sens=true +content_regexp=false +content_first_hit=false +content_whole_words=false +content_all_charsets=false +ignore_dirs_enable=true +ignore_dirs= + +[DiffView] +show_symbols=false +show_numbers=false +tab_size=8 +diff_quality=0 +diff_ignore_tws=false +diff_ignore_all_space=false +diff_ignore_space_change=false +diff_tab_expansion=false +diff_ignore_case=false + +[Panelize] +Find *.orig after patching=find . -name \\*.orig -print +Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print +Find rejects after patching=find . -name \\*.rej -print +Modified git files=git ls-files --modified diff --git a/mc/mc.ext b/mc/mc.ext new file mode 100644 index 0000000..716f0a7 --- /dev/null +++ b/mc/mc.ext @@ -0,0 +1,847 @@ +# Midnight Commander 3.0 extension file +# Warning: Structure of this file has changed completely with version 3.0 +# +# All lines starting with # or empty lines are thrown away. +# Lines starting in the first column should have following format: +# +# keyword/descNL, i.e. everything after keyword/ until new line is desc +# +# keyword can be: +# +# shell (desc is, when starting with a dot, any extension (no wildcars), +# i.e. matches all the files *desc . Example: .tar matches *.tar; +# if it doesn't start with a dot, it matches only a file of that name) +# +# shell/i (desc is, when starting with a dot, any extension (no wildcars), +# The same as shell but with case insensitive. +# +# regex (desc is an extended regular expression) +# Please note that we are using the GNU regex library and thus +# \| matches the literal | and | has special meaning (or) and +# () have special meaning and \( \) stand for literal ( ). +# +# regex/i (desc is an extended regular expression) +# The same as regex but with case insensitive. +# +# type (file matches this if `file %f` matches regular expression desc +# (the filename: part from `file %f` is removed)) +# +# type/i (file matches this if `file %f` matches regular expression desc) +# The same as type but with case insensitive. +# +# directory (matches any directory matching regular expression desc) +# +# include (matches an include directive) +# +# default (matches any file no matter what desc is) +# +# Other lines should start with a space or tab and should be in the format: +# +# keyword=commandNL (with no spaces around =), where keyword should be: +# +# Open (if the user presses Enter or doubleclicks it), +# +# View (F3), Edit (F4) +# +# Include is the keyword used to add any further entries from an include/ +# section +# +# command is any one-line shell command, with the following substitutions: +# +# %% -> % character +# %p -> name of the current file (without path, but pwd is its path). +# Also provided to external application as MC_EXT_BASENAME +# global variable +# %f -> name of the current file. Unlike %p, if file is located on a +# non-local virtual filesystem, i.e. either tarfs or ftpfs, +# then the file will be temporarily copied into a local directory +# and %f will be the full path to this local temporal file. +# If you don't want to get a local copy and want to get the +# virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then +# use %d/%p instead of %f. +# Also provided to external application as MC_EXT_FILENAME +# global variable +# %d -> name of the current directory (pwd, without trailing slash) +# Also provided to external application as MC_EXT_CURRENTDIR +# global variable +# %s -> "selected files", i.e. space separated list of tagged files if any +# or name of the current file. +# Also provided to external application as MC_EXT_SELECTED +# global variable +# %t -> list of tagged files +# Also provided to external application as MC_EXT_ONLYTAGGED +# global variable +# %u -> list of tagged files (they'll be untaged after the command) +# +# (If these 6 letters are in uppercase, they refer to the other panel. +# But you shouldn't have to use it in this file.) +# +# +# %cd -> the rest is a path mc should change into (cd won't work, since it's +# a child process). %cd handles even vfs names. +# +# %view -> the command you type will be piped into mc's internal file viewer +# if you type only the %view and no command, viewer will load %f file +# instead (i.e. no piping, so it is different to %view cat %f) +# %view may be directly followed by {} with a list of any of +# ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for +# text using backspace for bold and underscore) and unform +# (no highlighting for nroff sequences) separated by commas. +# +# %var -> You use it like this: %var{VAR:default}. This macro will expand +# to the value of the VAR variable in the environment if it's set +# otherwise the value in default will be used. This is similar to +# the Bourne shell ${VAR-default} construct. +# +# Rules are applied from top to bottom, thus the order is important. +# If some actions are missing, search continues as if this target didn't +# match (i.e. if a file matches the first and second entry and View action +# is missing in the first one, then on pressing F3 the View action from +# the second entry will be used. default should catch all the actions. +# +# Any new entries you develop for you are always welcome if they are +# useful on more than one system. You can post your modifications +# as tickets at www.midnight-commander.org + + +### Changes ### +# +# Reorganization: 2012-03-07 Slava Zanko + + +### GIT Repo ### +# gitfs changeset +regex/^\[git\] + Open=%cd %p/changesetfs:// + View=%cd %p/patchsetfs:// + + +### Archives ### + +# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk, .gem +regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$|\.gem$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.gz + +shell/.tar.bz + # Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.bzip + +regex/\.t(ar\.bz2|bz2?|b2)$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.bzip2 + +# .tar.lzma, .tlz +regex/\.t(ar\.lzma|lz)$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.lzma + +# .tar.lz +shell/.tar.lz + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.lz + +# .tar.lz4, .tlz4 +regex/\.t(ar\.lz4|lz4)$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.lz4 + +# .tar.xz, .txz +regex/\.t(ar\.xz|xz)$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.xz + +# .tar.zst, .tzst +regex/\.t(ar\.zst|zst)$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.zst + +# .tar.F - used in QNX +shell/.tar.F + # Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.F + +# .qpr/.qpk - QNX Neutrino package installer files +regex/\.qp[rk]$ + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.qpr + +# tar +shell/i/.tar + Open=%cd %p/utar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar + +# lha +type/^LHa\ .*archive + Open=%cd %p/ulha:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lha + +# arj +regex/i/\.a(rj|[0-9][0-9])$ + Open=%cd %p/uarj:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view arj + +# cab +shell/i/.cab + Open=%cd %p/ucab:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cab + +# ha +shell/i/.ha + Open=%cd %p/uha:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view ha + +# rar +regex/i/\.r(ar|[0-9][0-9])$ + Open=%cd %p/urar:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view rar + +# ALZip +shell/i/.alz + Open=%cd %p/ualz:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view alz + +# cpio +shell/.cpio.Z + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.z + +shell/.cpio.lz + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.lz + +shell/.cpio.lz4 + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.lz4 + +shell/.cpio.xz + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.xz + +shell/.cpio.zst + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.zst + +shell/.cpio.gz + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio.gz + +shell/i/.cpio + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio + +# initrd +regex/^(initramfs.*\.img|initrd(-.+)?\.img(-.+)?)$ + Open=%cd %p/ucpio:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view cpio + +# 7zip archives (they are not man pages) +shell/i/.7z + Open=%cd %p/u7z:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view 7z + +# patch +regex/\.(diff|patch)(\.bz2)$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bz2 + +regex/\.(diff|patch)(\.(gz|Z))$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz + +regex/\.(diff|patch)(\.xz)$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view xz + +regex/\.(diff|patch)(\.zst)$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zst + +# ls-lR +regex/(^|\.)ls-?lR(\.gz|Z|bz2)$ + Open=%cd %p/lslR:// + +# trpm +shell/.trpm + Open=%cd %p/trpm:// + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view trpm + +# RPM packages (SuSE uses *.spm for source packages) +regex/\.(src\.rpm|spm)$ + Open=%cd %p/rpm:// + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view src.rpm + +shell/.rpm + Open=%cd %p/rpm:// + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view rpm + +# deb +regex/\.u?deb$ + Open=%cd %p/deb:// + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view deb + +# dpkg +shell/.debd + Open=%cd %p/debd:// + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view debd + +# apt +shell/.deba + Open=%cd %p/deba:// + View=%view{ascii} /usr/lib/mc/ext.d/package.sh view deba + +# ISO9660 +shell/i/.iso + Open=%cd %p/iso9660:// + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view iso9660 + + +regex/\.(diff|patch)$ + Open=%cd %p/patchfs:// + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view cat + +# ar library +regex/\.s?a$ + Open=%cd %p/uar:// + #Open=%view{ascii} ar tv %f + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view ar + +# gplib +shell/i/.lib + Open=%cd %p/ulib:// + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view lib + + +# Mailboxes +type/^ASCII\ mail\ text + Open=%cd %p/mailfs:// + + +### Sources ### + +# C/C++ +regex/i/\.(c|cc|cpp)$ + Include=editor + +# C/C++ header +regex/i/\.(h|hh|hpp)$ + Include=editor + +# Fortran +shell/i/.f + Include=editor + +# Assembler +regex/i/\.(s|asm)$ + Include=editor + +# .so libraries +regex/\.(so|so\.[0-9\.]*)$ + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view so + +# Object +type/^ELF + #Open=%var{PAGER:more} %f + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view elf + + +### Documentation ### + +# Texinfo +#regex/\.(te?xi|texinfo)$ + +# GNU Info page +type/^Info\ text + Open=/usr/lib/mc/ext.d/text.sh open info + +shell/.info + Open=/usr/lib/mc/ext.d/text.sh open info + +# Exception: .3gp are video files not manual pages +shell/i/.3gp + Include=video + +# Manual page +regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$ + Open=/usr/lib/mc/ext.d/text.sh open man %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man %var{PAGER:more} + +# Perl pod page +shell/.pod + Open=/usr/lib/mc/ext.d/text.sh open pod %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view pod %var{PAGER:more} + +# Troff with me macros. +# Exception - "read.me" is not a nroff file. +shell/read.me + Open= + View= + +shell/.me + Open=/usr/lib/mc/ext.d/text.sh open nroff.me %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view nroff.me %var{PAGER:more} + +# Troff with ms macros. +shell/.ms + Open=/usr/lib/mc/ext.d/text.sh open nroff.ms %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view nroff.ms %var{PAGER:more} + +# Manual page - compressed +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$ + Open=/usr/lib/mc/ext.d/text.sh open man.gz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.gz %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$ + Open=/usr/lib/mc/ext.d/text.sh open man.bz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.bz %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$ + Open=/usr/lib/mc/ext.d/text.sh open man.bz2 %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.bz2 %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz$ + Open=/usr/lib/mc/ext.d/text.sh open man.lz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.lz %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz4$ + Open=/usr/lib/mc/ext.d/text.sh open man.lz4 %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.lz4 %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$ + Open=/usr/lib/mc/ext.d/text.sh open man.lzma %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.lzma %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.xz$ + Open=/usr/lib/mc/ext.d/text.sh open man.xz %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.xz %var{PAGER:more} + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.zst$ + Open=/usr/lib/mc/ext.d/text.sh open man.zst %var{PAGER:more} + View=%view{ascii,nroff} /usr/lib/mc/ext.d/text.sh view man.zst %var{PAGER:more} + +# CHM +shell/i/.chm + Open=/usr/lib/mc/ext.d/text.sh open chm + + +### Images ### + +type/^GIF + Include=image + +type/^JPEG + View=%view{ascii} /usr/lib/mc/ext.d/image.sh view jpeg + Include=image + +type/^PC\ bitmap + Include=image + +type/^PNG + Include=image + +type/^JNG + Include=image + +type/^MNG + Include=image + +type/^TIFF + Include=image + +type/^PBM + Include=image + +type/^PGM + Include=image + +type/^PPM + Include=image + +type/^Netpbm + Include=image + +shell/.xcf + Open=/usr/lib/mc/ext.d/image.sh open xcf + +shell/.xbm + Open=/usr/lib/mc/ext.d/image.sh open xbm + +shell/.xpm + Include=image + View=/usr/lib/mc/ext.d/image.sh view xpm %f + +shell/.ico + Include=image + +shell/i/.svg + View=%view{ascii} /usr/lib/mc/ext.d/image.sh view svg + Open=/usr/lib/mc/ext.d/image.sh open svg + + +### Sound files ### + +regex/i/\.(wav|snd|voc|au|smp|aiff|snd|m4a|ape|aac|wv)$ + Open=/usr/lib/mc/ext.d/sound.sh open common + +regex/i/\.(mod|s3m|xm|it|mtm|669|stm|ult|far)$ + Open=/usr/lib/mc/ext.d/sound.sh open mod + +shell/i/.waw22 + Open=/usr/lib/mc/ext.d/sound.sh open wav22 + +shell/i/.mp3 + Open=/usr/lib/mc/ext.d/sound.sh open mp3 + View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view mp3 + +regex/i/\.og[gax]$ + Open=/usr/lib/mc/ext.d/sound.sh open ogg + View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view ogg + +shell/i/.opus + Open=/usr/lib/mc/ext.d/sound.sh open opus + View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view opus + +regex/i/\.(spx|flac)$ + Open=/usr/lib/mc/ext.d/sound.sh open common + +regex/i/\.(midi?|rmid?)$ + Open=/usr/lib/mc/ext.d/sound.sh open midi + +shell/i/.wma + Open=/usr/lib/mc/ext.d/sound.sh open wma + View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view wma + + +### Play lists ### + +regex/i/\.(m3u|pls)$ + Open=/usr/lib/mc/ext.d/sound.sh open playlist + + +### Video ### + +shell/i/.avi + Include=video + +regex/i/\.as[fx]$ + Include=video + +shell/i/.divx + Include=video + +shell/i/.mkv + Include=video + +regex/i/\.(mov|qt)$ + Include=video + +regex/i/\.(mp4|m4v|mpe?g)$ + Include=video + +# MPEG-2 TS container + H.264 codec +shell/i/.mts + Include=video + +shell/i/.ts + Include=video + +shell/i/.vob + Include=video + +shell/i/.wmv + Include=video + +regex/i/\.fl[icv]$ + Include=video + +shell/i/.ogv + Include=video + +regex/i/\.ra?m$ + Open=/usr/lib/mc/ext.d/video.sh open ram + +# WebM +shell/i/.webm + Include=video + +type/WebM + Include=video + + +### Documents ### + +# Postscript +type/^PostScript + Open=/usr/lib/mc/ext.d/doc.sh open ps + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view ps + +# PDF +type/^PDF + Open=/usr/lib/mc/ext.d/doc.sh open pdf + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf + +# html +regex/i/\.html?$ + Open=/usr/lib/mc/ext.d/web.sh open html + View=%view{ascii} /usr/lib/mc/ext.d/web.sh view html + +# StarOffice 5.2 +shell/.sdw + Open=/usr/lib/mc/ext.d/doc.sh open ooffice + +# StarOffice 6 and OpenOffice.org formats +regex/i/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$ + Open=/usr/lib/mc/ext.d/doc.sh open ooffice + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view odt + +# AbiWord +shell/.abw + Open=/usr/lib/mc/ext.d/doc.sh open abw + +# Gnumeric +shell/i/.gnumeric + Open=/usr/lib/mc/ext.d/doc.sh open gnumeric + +# Microsoft Word Document +regex/i/\.(do[ct]|wri|docx)$ + Open=/usr/lib/mc/ext.d/doc.sh open msdoc + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msdoc +type/^Microsoft\ Word + Open=/usr/lib/mc/ext.d/doc.sh open msdoc + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msdoc + +# RTF document +shell/i/.rtf + Open=/usr/lib/mc/ext.d/doc.sh open msdoc + +# Microsoft Excel Worksheet +regex/i/\.(xl[sw]|xlsx)$ + Open=/usr/lib/mc/ext.d/doc.sh open msxls + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msxls +type/^Microsoft\ Excel + Open=/usr/lib/mc/ext.d/doc.sh open msxls + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msxls + +# Microsoft PowerPoint Presentation +regex/i/\.(pp[ts]|pptx)$ + Open=/usr/lib/mc/ext.d/doc.sh open msppt + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msppt + +# Use OpenOffice.org/LibreOffice to open any MS Office documents +type/^Microsoft\ Office\ Document + Open=/usr/lib/mc/ext.d/doc.sh open ooffice +type/^Microsoft\ OOXML + Open=/usr/lib/mc/ext.d/doc.sh open ooffice + +# Framemaker +type/^FrameMaker + Open=/usr/lib/mc/ext.d/doc.sh open framemaker + +# DVI +shell/i/.dvi + Open=/usr/lib/mc/ext.d/doc.sh open dvi + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view dvi + +# TeX +shell/i/.tex + Include=editor + +# Markdown +shell/i/.md + Include=editor + +# DjVu +regex/i/\.djvu?$ + Open=/usr/lib/mc/ext.d/doc.sh open djvu + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view djvu + +# Comic Books +regex/i/\.cb[zr]$ + Open=/usr/lib/mc/ext.d/doc.sh open comic + +# Epub & mobi +regex/i/\.(epub|mobi)$ + Open=/usr/lib/mc/ext.d/doc.sh open epub + View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view epub + + +### Miscellaneous ### + +# Compiled Java classes +shell/.class + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view javaclass + +# Makefile +regex/^[Mm]akefile$ + Open=make -f %f %{Enter parameters} + +# Imakefile +shell/Imakefile + Open=xmkmf -a + +# Makefile.PL (MakeMaker) +regex/^Makefile\.(PL|pl)$ + Open=%var{PERL:perl} %f + +# sqlite3.db +type/^SQLite 3.x database + Open=/usr/lib/mc/ext.d/misc.sh open sqlite + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view sqlite + +# dbf +shell/i/.dbf + Open=/usr/lib/mc/ext.d/misc.sh open dbf + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view dbf + +# REXX script +regex/\.(rexx?|cmd)$ + Open=rexx %f %{Enter parameters};echo "Press ENTER";read y + +# Disk images for Commodore computers (VIC20, C64, C128) +shell/i/.d64 + Open=%cd %p/uc1541:// + View=%view{ascii} c1541 %f -list + Extract=c1541 %f -extract + +# Glade, a user interface designer for GTK+ and GNOME +shell/i/.glade + Open=/usr/lib/mc/ext.d/misc.sh open glade + +# Gettext Catalogs +regex/\.g?mo$ + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view mo + +# po +shell/.po + Open=/usr/lib/mc/ext.d/misc.sh open po + +# lyx +shell/i/.lyx + Open=/usr/lib/mc/ext.d/misc.sh open lyx + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view lyx + +# torrent +shell/i/.torrent + View=%view{ascii} /usr/lib/mc/ext.d/misc.sh view torrent + + +### Plain compressed files ### + +# ace +shell/i/.ace + Open=%cd %p/uace:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view ace + Extract=unace x %f + +# arc +shell/i/.arc + Open=%cd %p/uarc:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view arc + Extract=arc x %f '*' + Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi + +# zip +shell/i/.zip + Open=%cd %p/uzip:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zip + +# zip +type/i/^zip\ archive + Open=%cd %p/uzip:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zip + +# jar(zip) +type/i/^Java\ (Jar\ file|archive)\ data\ \((zip|JAR)\) + Open=%cd %p/uzip:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zip + +# zoo +shell/i/.zoo + Open=%cd %p/uzoo:// + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zoo + +# gzip +type/^gzip + Open=/usr/lib/mc/ext.d/archive.sh view gz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz + +regex/\.(gz|Z)$ + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz + +# bzip2 +type/^bzip2 + Open=/usr/lib/mc/ext.d/archive.sh view bzip2 %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bz2 + +regex/\.bz2?$ + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bz2 + +# bzip +type/^bzip + Open=/usr/lib/mc/ext.d/archive.sh view bzip %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view bzip + +# compress +type/^compress + Open=/usr/lib/mc/ext.d/archive.sh view gz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view gz + +# lz +regex/\.lz$ + Open=/usr/lib/mc/ext.d/archive.sh view lz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lz + +# lz +type/^LZIP + Open=/usr/lib/mc/ext.d/archive.sh view lz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lz + +# lz4 +regex/\.lz4$ + Open=/usr/lib/mc/ext.d/archive.sh view lz4 %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lz4 + +# lzma +regex/\.lzma$ + Open=/usr/lib/mc/ext.d/archive.sh view lzma %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view lzma + +# xz +regex/\.xz$ + Open=/usr/lib/mc/ext.d/archive.sh view xz %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view xz + +# zstd +regex/\.zst$ + Open=/usr/lib/mc/ext.d/archive.sh view zst %var{PAGER:more} + View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zst + +# Parity Archive +type/^Parity\ Archive\ Volume\ Set + Open=/usr/lib/mc/ext.d/archive.sh open par2 + + +### Includes +# includes should be at end of bindings + +include/editor + Open=%var{EDITOR:vi} %f + +include/image + Open=/usr/lib/mc/ext.d/image.sh open ALL_FORMATS + View=%view{ascii} /usr/lib/mc/ext.d/image.sh view ALL_FORMATS + +include/video + Open=/usr/lib/mc/ext.d/video.sh open ALL_FORMATS + View=%view{ascii} /usr/lib/mc/ext.d/video.sh view ALL_FORMATS + + +### Default ### + +# Default target for anything not described above +default/* + Open= + View= + + +### EOF ### diff --git a/mc/mc.keymap b/mc/mc.keymap new file mode 100644 index 0000000..72f24c8 --- /dev/null +++ b/mc/mc.keymap @@ -0,0 +1,497 @@ +[main] +ChangePanel = tab +Help = f1 +UserMenu = f2 +View = f3 +# ViewFile = +Edit = f4 +# EditForceInternal = +Copy = f5 +Move = f6 +MakeDir = f7 +Delete = f8 +Menu = f9 +Quit = f10 +MenuLastSelected = f19 +QuitQuiet = f20 +Find = alt-question +CdQuick = alt-c +HotList = alt-backslash; ctrl-b +Reread = ctrl-r +DirSize = ctrl-space +Suspend = ctrl-z +Swap = ctrl-u +History = alt-h +# PanelListing = +# SetupListingFormat = +ShowHidden = alt-dot +SplitVertHoriz = alt-comma +SplitEqual = alt-equal +SplitMore = alt-shift-right +SplitLess = alt-shift-left +Shell = ctrl-o +PutCurrentPath = alt-a +PutOtherPath = alt-shift-a +PutCurrentSelected = alt-enter; ctrl-enter +PutCurrentFullSelected = ctrl-shift-enter +ViewFiltered = alt-exclamation +Select = kpplus +Unselect = kpminus +SelectInvert = kpasterisk +ScreenList = alt-prime +# OptionsLayout = +# OptionsAppearance = +# OptionsPanel = +# OptionsConfirm = +# OptionsDisplayBits = +# OptionsVfs = +# LearnKeys = +# SaveSetup = +# EditExtensionsFile = +# EditFileHighlightFile = +# Filter = +# ConnectFish = +# ConnectFtp = +# ConnectSmb = +# Undelete = +EditorViewerHistory = alt-shift-e +ExtendedKeyMap = ctrl-x + +[main:xmap] +ChangeMode = c +ChangeOwn = o +ChangeAttributes = e +CompareDirs = d +CompareFiles = ctrl-d +HotListAdd = h +LinkSymbolicEdit = ctrl-s +Link = l +LinkSymbolic = s +LinkSymbolicRelative = v +PanelInfo = i +PanelQuickView = q +ExternalPanelize = exclamation +VfsList = a +Jobs = j +PutCurrentPath = p +PutOtherPath = ctrl-p +PutCurrentTagged = t +PutOtherTagged = ctrl-t +PutCurrentLink = r +PutOtherLink = ctrl-r + +[panel] +CycleListingFormat = alt-t +Search = ctrl-s; alt-s +Mark = insert; ctrl-t +MarkUp = shift-up +MarkDown = shift-down +# MarkLeft = +# MarkRight = +Down = down; ctrl-n +Up = up; ctrl-p +Left = left +Right = right +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +PanelOtherCd = alt-o +PanelOtherCdLink = alt-l +ViewRaw = f13 +EditNew = f14 +CopySingle = f15 +MoveSingle = f16 +DeleteSingle = f18 +# SelectExt = +Select = alt-plus +Unselect = alt-minus +SelectInvert = alt-asterisk +CdChild = ctrl-pgdn +CdParent = ctrl-pgup +# CdParentSmart = +# Panelize = +History = alt-shift-h +HistoryNext = alt-u +HistoryPrev = alt-y +BottomOnScreen = alt-j +MiddleOnScreen = alt-r +TopOnScreen = alt-g +PanelOtherSync = alt-i +SelectCodepage = alt-e +Top = alt-lt; home; a1 +Bottom = alt-gt; end; c1 +# Sort = +# SortPrev = +# SortNext = +# SortReverse = +# SortByName = +# SortByExt = +# SortBySize = +# SortByMTime = +# ScrollLeft = +# ScrollRight = + +[dialog] +Ok = enter +Cancel = f10; esc; ctrl-g +Up = left; up +#Left = left; up +Down = right; down +#Right = right; down +Help = f1 +Suspend = ctrl-z +Refresh = ctrl-l +ScreenList = alt-prime +ScreenNext = alt-rbrace +ScreenPrev = alt-lbrace + +[menu] +Help = f1 +Left = left; ctrl-b +Right = right; ctrl-f +Up = up; ctrl-p +Down = down; ctrl-n +Home = home; alt-lt; ctr-a +End = end; alt-gt ctrl-e +Enter = enter +Quit = F10; esc; ctrl-g + +[input] +Home = ctrl-a; alt-lt; home; a1 +End = ctrl-e; alt-gt; end; c1 +Left = left; alt-left; ctrl-b +Right = right; alt-right; ctrl-f +WordLeft = ctrl-left; alt-b +WordRight = ctrl-right; alt-f +Backspace = backspace +Delete = delete; ctrl-d +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +# Mark = +Remove = ctrl-w +# Cut = +Store = alt-w +# Paste = +Yank = ctrl-y +DeleteToEnd = ctrl-k +HistoryPrev = alt-p; ctrl-down +HistoryNext = alt-n; ctrl-up +History = alt-h +Complete = alt-tab +# Clear = +MarkLeft = shift-left +MarkRight = shift-right +MarkToWordBegin = ctrl-shift-left +MarkToWordEnd = ctrl-shift-right +MarkToHome = shift-home +MarkToEnd = shift-end + +[listbox] +Up = up; ctrl-p +Down = down; ctrl-n +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Delete = delete; d +Clear = shift-delete; shift-d +View = f3 +Edit = f4 +Enter = enter + +[radio] +Up = up; ctrl-p +Down = down; ctrl-n +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +Select = space + +[tree] +Help = f1 +Reread = f2; ctrl-r +Forget = f3 +ToggleNavigation = f4 +Copy = f5 +Move = f6 +Up = up; ctrl-p +Down = down; ctrl-n +Left = left +Right = right +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +Search = ctrl-s; alt-s +Delete = f8; delete + +[help] +Help = f1 +Index = f2; c +Back = f3; left; l +Quit = f10; esc +Up = up; ctrl-p +Down = down; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +Enter = right; enter +LinkNext = tab +LinkPrev = alt-tab +NodeNext = n +NodePrev = p + +[chattr] +Up = up; left; ctrl-p +Down = down; right; ctrl-n +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Mark = t; shift-t +MarkAndDown = insert + +[editor] +Store = ctrl-insert +Paste = shift-insert +Cut = shift-delete +Up = up +Down = down +Left = left +Right = right +WordLeft = ctrl-left; ctrl-z +WordRight = ctrl-right; ctrl-x +Enter = enter +Return = shift-enter; ctrl-enter; ctrl-shift-enter +BackSpace = backspace; ctrl-h +Delete = delete; ctrl-d +PageUp = pgup +PageDown = pgdn +Home = home +End = end +Tab = tab; shift-tab; ctrl-tab; ctrl-shift-tab +Undo = ctrl-u +Redo = alt-r +Top = ctrl-home; alt-lt +Bottom = ctrl-end; alt-gt +ScrollUp = ctrl-up +ScrollDown = ctrl-down +TopOnScreen = ctrl-pgup +BottomOnScreen = ctrl-pgdn +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +DeleteLine = ctrl-y +DeleteToEnd = ctrl-k +# DeleteToHome = +# ParagraphUp = +# ParagraphDown = +Save = f2 +# EditFile = +EditNew = ctrl-n +SaveAs = f12; ctrl-f2 +# Close = +History = alt-shift-e +Mark = f3 +Copy = f5 +Move = f6 +Remove = f8 +# MarkLine = +# MarkWord = +# MarkAll = +# Unmark = +Search = f7 +SearchContinue = f17 +# BlockShiftLeft = +# BlockShiftRight = +MarkPageUp = shift-pgup +MarkPageDown = shift-pgdn +MarkLeft = shift-left +MarkRight = shift-right +MarkToWordBegin = ctrl-shift-left +MarkToWordEnd = ctrl-shift-right +MarkUp = shift-up +MarkDown = shift-down +MarkToHome = shift-home +MarkToEnd = shift-end +MarkToFileBegin = ctrl-shift-home +MarkToFileEnd = ctrl-shift-end +MarkToPageBegin = ctrl-shift-pgup +MarkToPageEnd = ctrl-shift-pgdn +MarkScrollUp = ctrl-shift-up +MarkScrollDown = ctrl-shift-down +# MarkParagraphUp = +# MarkParagraphDown = +MarkColumnPageUp = alt-pgup +MarkColumnPageDown = alt-pgdn +MarkColumnLeft = alt-left +MarkColumnRight = alt-right +MarkColumnUp = alt-up +MarkColumnDown = alt-down +# MarkColumnScrollUp = +# MarkColumnScrollDown = +# MarkColumnParagraphUp = +# MarkColumnParagraphDown = +BlockSave = ctrl-f +MarkColumn = f13 +Replace = f4 +ReplaceContinue = f14 +Complete = alt-tab +InsertFile = f15 +Quit = f10; esc +InsertOverwrite = insert +Help = f1 +# Date = +Refresh = ctrl-l +Goto = alt-l +Sort = alt-t +Mail = alt-m +ParagraphFormat = alt-p +MatchBracket = alt-b +ExternalCommand = alt-u +UserMenu = f11 +Menu = f9 +Bookmark = alt-k +BookmarkFlush = alt-o +BookmarkNext = alt-j +BookmarkPrev = alt-i +# History = +Shell = ctrl-o +InsertLiteral = ctrl-q +# MacroStartRecord = +# MacroStopRecord = +MacroStartStopRecord = ctrl-r +# MacroDelete = +ShowNumbers = alt-n +ShowTabTws = alt-underline +SyntaxOnOff = ctrl-s +# SyntaxChoose = +# ShowMargin = +Find = alt-enter +FilePrev = alt-minus +FileNext = alt-plus +# RepeatStartStopRecord = +SelectCodepage = alt-e +# Options = +# OptionsSaveMode = +# SpellCheck = +SpellCheckCurrentWord = ctrl-p +# SpellCheckSelectLang = +# LearnKeys = +# WindowMove = +# WindowResize = +# WindowFullscreen = +# WindowList = +# WindowNext = +# WindowPrev = +# ExtendedKeyMap = + +[viewer] +Help = f1 +WrapMode = f2 +Quit = f3; f10; q; esc +HexMode = f4 +Goto = f5 +Search = f7 +SearchForward = slash +SearchBackward = question +SearchContinue = f17; n +SearchForwardContinue = ctrl-s +SearchBackwardContinue = ctrl-r +SearchOppositeContinue = shift-n +MagicMode = f8 +NroffMode = f9 +Home = ctrl-a +End = ctrl-e +Left = h; left +Right = l; right +LeftQuick = ctrl-left +RightQuick = ctrl-right +Up = k; y; insert; up; ctrl-p +Down = j; e; delete; down; enter; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +BookmarkGoto = m +Bookmark = r +FileNext = ctrl-f +FilePrev = ctrl-b +SelectCodepage = alt-e +Shell = ctrl-o +Ruler = alt-r +History = alt-shift-e + +[viewer:hex] +Help = f1 +HexEditMode = f2 +Quit = f3; f10; q; esc +HexMode = f4 +Goto = f5 +Save = f6 +Search = f7 +SearchForward = slash +SearchBackward = question +SearchContinue = f17; n +SearchForwardContinue = ctrl-s +SearchBackwardContinue = ctrl-r +SearchOppositeContinue = shift-n +MagicMode = f8 +NroffMode = f9 +ToggleNavigation = tab +Home = ctrl-a; home +End = ctrl-e; end +Left = b; left +Right = f; right +Up = k; y; up +Down = j; delete; down +PageDown = pgdn; ctrl-v +PageUp = pgup; alt-v +Top = ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +History = alt-shift-e + +[diffviewer] +ShowSymbols = alt-s; s +ShowNumbers = alt-n; l +SplitFull = f +SplitEqual = equal +SplitMore = gt +SplitLess = lt +Tab2 = 2 +Tab3 = 3 +Tab4 = 4 +Tab8 = 8 +Swap = ctrl-u +Redo = ctrl-r +HunkNext = n; enter; space +HunkPrev = p; backspace +Goto = g; shift-g +Save = f2 +Edit = f4 +EditOther = f14 +Merge = f5 +MergeOther = f15 +Search = f7 +SearchContinue = f17 +Options = f9 +Top = ctrl-home +Bottom = ctrl-end +Down = down +Up = up +LeftQuick = ctrl-left +RightQuick = ctrl-right +Left = left +Right = right +PageDown = pgdn +PageUp = pgup +Home = home +End = end +Help = f1 +Quit = f10; q; shift-q; esc +Shell = ctrl-o +SelectCodepage = alt-e diff --git a/mc/menu b/mc/menu new file mode 100644 index 0000000..134e01b --- /dev/null +++ b/mc/menu @@ -0,0 +1,369 @@ +shell_patterns=0 + +############################################################################## +# %% The % character +# %f The current file (if non-local vfs, file will be copied locally and +# %f will be full path to it) +# %p The current file +# %d The current working directory +# %s "Selected files"; the tagged files if any, otherwise the current file +# %t Tagged files +# %u Tagged files (and they are untagged on return from expand_format) +# %view Runs the commands and pipes standard output to the view command +# If %view is immediately followed by '{', recognize keywords +# ascii, hex, nroff and unform +# +# If the format letter is in uppercase, it refers to the other panel +# +# With a number followed the % character you can turn quoting on (default) +# and off. For example: +# %f quote expanded macro +# %1f ditto +# %0f don't quote expanded macro +############################################################################## + ++ ! t t +@ Do something on the current file + CMD=%{Enter command} + $CMD %f + ++ t t +@ Do something on the tagged files + CMD=%{Enter command} + for i in %t ; do + $CMD "$i" + done + +0 Edit a bug report and send it to root + I=`mktemp "${MC_TMPDIR:-/tmp}/mail.XXXXXX"` || exit 1 + ${EDITOR-vi} "$I" + test -r "$I" && mail root < "$I" + rm -f "$I" + +=+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r +1 Display the file with roff -man + %view{ascii,nroff} roff -c -Tlatin1 -mandoc %f + +2 Call the info hypertext browser + info + += t d +3 Compress the current subdirectory (tar.gz) + Pwd=`basename %d /` + echo -n "Name of the compressed file (without extension) [$Pwd]: " + read tar + [ "$tar"x = x ] && tar="$Pwd" + cd .. && \ + tar cf - "$Pwd" | gzip -f9 > "$tar.tar.gz" && \ + echo "../$tar.tar.gz created." + +4 Compress the current subdirectory (tar.bz2) + Pwd=`basename %d /` + echo -n "Name of the compressed file (without extension) [$Pwd]: " + read tar + [ "$tar"x = x ] && tar="$Pwd" + cd .. && \ + tar cf - "$Pwd" | bzip2 -f > "$tar.tar.bz2" && \ + echo "../$tar.tar.bz2 created." + +5 Compress the current subdirectory (tar.7z) + Pwd=`basename %d /` + echo -n "Name of the compressed file (without extension) [$Pwd]: " + read tar + [ "$tar"x = x ] && tar="$Pwd" + cd .. && \ + tar cf - "$Pwd" | 7za a -si "$tar.tar.7z" && \ + echo "../$tar.tar.7z created." + +6 Compress the current subdirectory (tar.xz) + Pwd=`basename %d /` + echo -n "Name of the compressed file (without extension) [$Pwd]: " + read tar + [ "$tar"x = x ] && tar="$Pwd" + cd .. && \ + tar cf - "$Pwd" | xz -f > "$tar.tar.xz" && \ + echo "../$tar.tar.xz created." + +7 Compress the current subdirectory (tar.zst) + Pwd=`basename %d /` + echo -n "Name of the compressed file (without extension) [$Pwd]: " + read tar + [ "$tar"x = x ] && tar="$Pwd" + cd .. && \ + tar cf - "$Pwd" | zstd -f > "$tar.tar.zst" && \ + echo "../$tar.tar.zst created." + += f \.c$ & t r ++ f \.c$ & t r & ! t t +c Compile and link current .c file + make "`basename %f .c`" 2>/dev/null || cc -O -o "`basename %f .c`" %f + ++ t r & ! t t +a Append file to opposite + cat %f >> %D/%f + ++ t t +A Append files to opposite files + for i in %t ; do + cat "$i" >> %D/"$i" + done + ++ t r & ! t t +d Delete file if a copy exists in the other directory. + if [ %d = %D ]; then + echo "The two directories must be different." + exit 1 + fi + if [ -f %D/%f ]; then # if two of them, then + if cmp -s %D/%f %f; then + rm %f && echo %f": DELETED." + else + echo %f" and "%D/%f" differ: NOT deleted." + echo -n "Press RETURN " + read key + fi + else + echo %f": No copy in "%D/%f": NOT deleted." + fi + ++ t t +D Delete tagged files if a copy exists in the other directory. + if [ %d = %D ]; then + echo "The two directores must be different." + exit 1 + fi + for i in %t ; do + if [ -f %D/"$i" ]; then + SUM1=`sum "$i"` + SUM2=`sum %D/"$i"` + if [ "$SUM1" = "$SUM2" ]; then + rm "$i" && echo "${i}: DELETED." + else + echo "$i and "%D"/$i differ: NOT deleted." + fi + else + echo "$i has no copy in "%D": NOT deleted." + fi + done + +m View manual page + MAN=%{Enter manual name} + %view{ascii,nroff} MANROFFOPT='-c -Tlatin1' MAN_KEEP_FORMATTING=1 man -P cat "$MAN" + += f \.gz$ & t r ++ ! t t +n Inspect gzip'ed newsbatch file + dd if=%f bs=1 skip=12 | zcat | ${PAGER-more} + # assuming the cunbatch header is 12 bytes long. + += t r & ++ ! t t +h Strip headers from current newsarticle + CHECK=`awk '{print $1 ; exit}' %f` 2>/dev/null + case "$CHECK" in + Newsgroups:|Path:) + I=`mktemp "${MC_TMPDIR:-/tmp}/news.XXXXXX"` || exit 1 + cp %f "$I" && sed '/^'"$CHECK"' /,/^$/d' "$I" > %f + [ "$?" = "0" ] && rm "$I" + echo %f": header removed." + ;; + *) + echo %f" is not a news article." + ;; + esac + ++ t t +H Strip headers from the marked newsarticles + for i in %t ; do + CHECK=`awk '{print $1 ; exit}' "$i"` 2>/dev/null + WFILE=`mktemp "${MC_TMPDIR:-/tmp}/news.XXXXXX"` || exit 1 + case "$CHECK" in + Newsgroups:|Path:) + cp "$i" "$WFILE" && sed '/^'"$CHECK"' /,/^$/d' "$WFILE" > "$i" + if [ "$?" = "0" ]; then + rm "$WFILE"; echo "$i header removed. OK." + else + echo "Oops! Please check $i against $WFILE." + fi + ;; + *) + echo "$i skipped: Not a news article." + ;; + esac + done + += t r ++ ! t t +r Copy file to remote host + echo -n "To which host?: " + read Host + echo -n "To which directory on $Host?: " + read Dir + rcp -p %f "${Host}:${Dir}" + ++ t t +R Copy files to remote host (no error checking) + echo -n "Copy files to which host?: " + read Host + echo -n "To which directory on $Host? :" + read Dir + rcp -pr %u "${Host}:${Dir}" + += f \.tex$ & t r ++ f \.tex$ & t r & ! t t +t Run latex on file and show it with xdvi + latex %f && xdvi "`basename %f .tex`".dvi + +=+ f ^part | f ^Part | f uue & t r ++ t t +U Uudecode marked news articles (needs work) + ( + for i in %t ; do # strip headers + FIRST=`awk '{print $1 ; exit}' "$i"` + cat "$i" | sed '/^'"$FIRST"' /,/^$/d' + done + ) | sed '/^$/d' | sed -n '/^begin 6/,/^end$/p' | uudecode + if [ "$?" != "0" ]; then + echo "Cannot decode "%t"." + fi + echo "Please test the output file before deleting anything." + +=+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lz4$ | f \.tar\.lzma$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.tar\.zst | f \.tar\.Z$ | f \.tar\.bz2$ & t rl +x Extract the contents of a compressed tar file + unset PRG + case %f in + *.tar.7z) PRG="7za e -so";; + *.tar.bz2) PRG="bunzip2 -c";; + *.tar.gz|*.tar.z|*.tgz|*.tpz|*.tar.Z) PRG="gzip -dc";; + *.tar.lz) PRG="lzip -dc";; + *.tar.lz4) PRG="lz4 -dc";; + *.tar.lzma) PRG="lzma -dc";; + *.tar.xz) PRG="xz -dc";; + *.tar.zst) PRG="zstd -dc";; + *) exit 1;; + esac + $PRG %f | tar xvf - + += t r ++ ! t t +y Gzip or gunzip current file + unset DECOMP + case %f in + *.gz|*.[zZ]) DECOMP=-d;; + esac + # Do *not* add quotes around $DECOMP! + gzip $DECOMP -v %f + ++ t t +Y Gzip or gunzip tagged files + for i in %t ; do + unset DECOMP + case "$i" in + *.gz|*.[zZ]) DECOMP=-d;; + esac + gzip $DECOMP -v "$i" + done + ++ ! t t +b Bzip2 or bunzip2 current file + unset DECOMP + case %f in + *.bz2) DECOMP=-d;; + esac + bzip2 $DECOMP -v %f + ++ t t +B Bzip2 or bunzip2 tagged files + for i in %t ; do + unset DECOMP + case "$i" in + *.bz2) DECOMP=-d;; + esac + bzip2 $DECOMP -v "$i" + done + ++ f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ | f \.tar.F$ & t r & ! t t +z Extract compressed tar file to subdirectory + unset D + set gzip -cd + case %f in + *.tar.F) D=`basename %f .tar.F`; set freeze -dc;; + *.tar.Z) D=`basename %f .tar.Z`;; + *.tar.bz2) D=`basename %f .tar.bz2`; set bunzip2 -c;; + *.tar.gz) D=`basename %f .tar.gz`;; + *.tar.z) D=`basename %f .tar.z`;; + *.tgz) D=`basename %f .tgz`;; + *.tpz) D=`basename %f .tpz`;; + esac + mkdir "$D"; cd "$D" && ("$1" "$2" ../%f | tar xvf -) + ++ t t +Z Extract compressed tar files to subdirectories + for i in %t ; do + set gzip -dc + unset D + case "$i" in + *.tar.F) D=`basename "$i" .tar.F`; set freeze -dc;; + *.tar.Z) D=`basename "$i" .tar.Z`;; + *.tar.bz2) D=`basename "$i" .tar.bz2`; set bunzip2 -c;; + *.tar.gz) D=`basename "$i" .tar.gz`;; + *.tar.z) D=`basename "$i" .tar.z`;; + *.tgz) D=`basename "$i" .tgz`;; + *.tpz) D=`basename "$i" .tpz`;; + esac + mkdir "$D"; (cd "$D" && "$1" "$2" "../$i" | tar xvf -) + done + ++ f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.bz2$ & t r & ! t t +c Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2 + unset D + unset EXT + case %f in + *.Z) EXT=Z;; + *.bz2) EXT=bz2;; + *.gz) EXT=gz;; + *.tgz) EXT=tgz;; + *.tpz) EXT=tpz;; + *.z) EXT=z;; + esac + case "$EXT" in + bz2|Z|gz|z) D=`basename %f ."$EXT"`;; + tgz|tpz) D=`basename %f ."$EXT"`.tar;; + esac + if [ "$EXT" = "bz2" ]; then + bunzip2 -v %f + gzip -f9 -v "$D" + else + gunzip -v %f + bzip2 -v "$D" + fi + ++ t t +C Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2 + for i in %t ; do + unset D + unset EXT + case "$i" in + *.Z) EXT=Z;; + *.bz2) EXT=bz2;; + *.gz) EXT=gz;; + *.tgz) EXT=tgz;; + *.tpz) EXT=tpz;; + *.z) EXT=z;; + esac + case "$EXT" in + bz2|Z|gz|z) D=`basename "$i" ."$EXT"`;; + tgz|tpz) D=`basename "$i" ."$EXT"`.tar;; + esac + if [ "$EXT" = "bz2" ]; then + bunzip2 -v "$i" + gzip -f9 -v "$D" + else + gunzip -v "$i" + bzip2 -v "$D" + fi + done + ++ x /usr/bin/open | x /usr/local/bin/open & x /bin/sh +o Open next a free console + open -s -- sh diff --git a/mc/panels.ini b/mc/panels.ini new file mode 100644 index 0000000..e69de29 From 32ecead6d2032116ab070fa44ec9e5a4bb69b290 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Thu, 18 Mar 2021 09:50:14 +0100 Subject: [PATCH 5/5] Some changes --- .gitignore | 2 ++ i3/config | 5 +++-- mc/ini | 2 +- mc/mc.ext | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9cd22a3..17fc231 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ !/i3* !/rofi !/mc +/mc/hotlist +/mc/hotlist.bak diff --git a/i3/config b/i3/config index 6d0a65c..462acdc 100644 --- a/i3/config +++ b/i3/config @@ -218,7 +218,7 @@ bar { set $mode_system System (l) lock, (e) logout, (r) reboot, (s) shutdown mode "$mode_system" { - bindsym l exec --no-startup-id i3exit lock, mode "default" + bindsym l exec --no-startup-id i3lock, 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" @@ -259,6 +259,7 @@ bindsym $mod+Ctrl+Left move workspace to output right bindsym $mod+c exec rofi_calc bindsym $mod+p exec xwacomcalibrate bindsym $mod+t exec thunar +bindsym $mod+m exec xfce4-terminal -x mc bindsym $mod+Shift+c exec jupyter-calculator workspace_auto_back_and_forth yes @@ -294,7 +295,7 @@ exec --no-startup-id "i3-msg 'workspace 9: Chat; append_layout ~/.config/i3/work exec firefox exec thunderbird exec chat.rocket.RocketChat no_focus -exec im.riot.Riot no_focus +exec element-desktop no_focus exec telegram-desktop no_focus exec --no-startup-id nm-applet diff --git a/mc/ini b/mc/ini index 85c7ee4..f6f3dbc 100644 --- a/mc/ini +++ b/mc/ini @@ -96,7 +96,7 @@ menubar_visible=true free_space=true horizontal_split=false vertical_equal=true -left_panel_size=33 +left_panel_size=47 horizontal_equal=true top_panel_size=16 diff --git a/mc/mc.ext b/mc/mc.ext index 716f0a7..4fd21cd 100644 --- a/mc/mc.ext +++ b/mc/mc.ext @@ -579,6 +579,10 @@ type/^PostScript type/^PDF Open=/usr/lib/mc/ext.d/doc.sh open pdf View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf +# XOPP +regex/i/\.xopp$ + Open=(nohup xournalpp %f &) + View=(nohup xournalpp %f &) # html regex/i/\.html?$