From 57a8d8360c85528fb477e76ef1a5f2eeb151be14 Mon Sep 17 00:00:00 2001 From: McSinyx Date: Wed, 18 May 2016 14:25:25 +0700 Subject: Initial commit --- X/.Xdefaults | 73 + X/.config/gtk-3.0/gtkcss | 4 + X/.config/gtk-3.0/settings.ini | 5 + X/.fonts/DroidSansMonoDotted.ttf | Bin 0 -> 117696 bytes X/.fonts/DroidSansMonoSlashed.ttf | Bin 0 -> 117744 bytes X/.gtkrc-2.0 | 4 + X/.xinitrc | 9 + awesome/.config/awesome/rc.lua | 555 + .../.config/awesome/themes/gruvbox/arrows/0.png | Bin 0 -> 276 bytes .../.config/awesome/themes/gruvbox/arrows/1.png | Bin 0 -> 337 bytes .../.config/awesome/themes/gruvbox/arrows/2.png | Bin 0 -> 274 bytes .../.config/awesome/themes/gruvbox/arrows/3.png | Bin 0 -> 276 bytes .../.config/awesome/themes/gruvbox/arrows/4.png | Bin 0 -> 276 bytes .../.config/awesome/themes/gruvbox/arrows/5.png | Bin 0 -> 277 bytes .../awesome/themes/gruvbox/awesome-icon.png | Bin 0 -> 184 bytes .../awesome/themes/gruvbox/background-1280x800.png | Bin 0 -> 6232 bytes .../themes/gruvbox/background-2048x1152.png | Bin 0 -> 12473 bytes .../themes/gruvbox/background-2048x1280.png | Bin 0 -> 13752 bytes .../themes/gruvbox/background-2048x1536.png | Bin 0 -> 16391 bytes .../awesome/themes/gruvbox/gradient-debian-big.png | Bin 0 -> 352996 bytes .../awesome/themes/gruvbox/gradient-debian.png | Bin 0 -> 305404 bytes .../awesome/themes/gruvbox/layouts/dwindle.png | Bin 0 -> 228 bytes .../awesome/themes/gruvbox/layouts/fairh.png | Bin 0 -> 217 bytes .../awesome/themes/gruvbox/layouts/fairv.png | Bin 0 -> 223 bytes .../awesome/themes/gruvbox/layouts/floating.png | Bin 0 -> 231 bytes .../awesome/themes/gruvbox/layouts/fullscreen.png | Bin 0 -> 245 bytes .../awesome/themes/gruvbox/layouts/magnifier.png | Bin 0 -> 222 bytes .../.config/awesome/themes/gruvbox/layouts/max.png | Bin 0 -> 290 bytes .../awesome/themes/gruvbox/layouts/spiral.png | Bin 0 -> 225 bytes .../awesome/themes/gruvbox/layouts/tile.png | Bin 0 -> 213 bytes .../awesome/themes/gruvbox/layouts/tilebottom.png | Bin 0 -> 208 bytes .../awesome/themes/gruvbox/layouts/tileleft.png | Bin 0 -> 209 bytes .../awesome/themes/gruvbox/layouts/tiletop.png | Bin 0 -> 206 bytes awesome/.config/awesome/themes/gruvbox/submenu.png | Bin 0 -> 184 bytes .../awesome/themes/gruvbox/taglist/squarefz.png | Bin 0 -> 166 bytes .../awesome/themes/gruvbox/taglist/squarez.png | Bin 0 -> 162 bytes awesome/.config/awesome/themes/gruvbox/theme.lua | 153 + .../themes/gruvbox/titlebar/close_focus.png | Bin 0 -> 272 bytes .../gruvbox/titlebar/floating_focus_active.png | Bin 0 -> 273 bytes .../gruvbox/titlebar/floating_focus_inactive.png | Bin 0 -> 273 bytes .../gruvbox/titlebar/maximized_focus_active.png | Bin 0 -> 271 bytes .../gruvbox/titlebar/maximized_focus_inactive.png | Bin 0 -> 269 bytes .../awesome/themes/gruvbox/titlebar/normal.png | Bin 0 -> 272 bytes .../themes/gruvbox/titlebar/ontop_focus_active.png | Bin 0 -> 272 bytes .../gruvbox/titlebar/ontop_focus_inactive.png | Bin 0 -> 272 bytes .../gruvbox/titlebar/sticky_focus_active.png | Bin 0 -> 273 bytes .../gruvbox/titlebar/sticky_focus_inactive.png | Bin 0 -> 272 bytes bash/.bash_logout | 7 + bash/.bashrc | 129 + bash/.profile | 22 + bin/.local/bin/2048.c | 11 + bin/.local/bin/scot.sh | 3 + ranger/.config/ranger/commands.py | 58 + ranger/.config/ranger/commands_full.py | 1504 + ranger/.config/ranger/rc.conf | 580 + ranger/.config/ranger/rifle.conf | 198 + ranger/.config/ranger/scope.sh | 89 + ranger/.config/ranger/tagged | 0 vim/.gvimrc | 5 + vim/.vim/.netrwhist | 7 + vim/.vim/bundle/gruvbox | 1 + vim/.vim/bundle/stime/LICENSE | 339 + vim/.vim/bundle/stime/README-vi.md | 120 + vim/.vim/bundle/stime/README-vi.pdf | Bin 0 -> 162657 bytes vim/.vim/bundle/stime/README.md | 18 + vim/.vim/bundle/stime/autoload/stime.vim | 75 + vim/.vim/bundle/stime/plugin/stime.vim | 2 + vim/.vim/bundle/stime/tables/cns11643 | 92484 +++++++++++++++++++ vim/.vim/bundle/stime/tables/compose | 550 + vim/.vim/bundle/stime/tables/cyrillic | 194 + vim/.vim/bundle/stime/tables/diacritics | 143 + vim/.vim/bundle/stime/tables/greek | 387 + vim/.vim/bundle/stime/tables/ipa-x-sampa | 310 + vim/.vim/bundle/stime/tables/latex | 532 + vim/.vim/bundle/stime/tables/rusle | 202 + vim/.vim/bundle/stime/tables/rustrad | 180 + vim/.vim/bundle/stime/tables/telex | 164 + vim/.vim/bundle/stime/tables/templete | 140 + vim/.vim/bundle/stime/tables/translit | 220 + vim/.vim/bundle/stime/tables/translit-ua | 212 + vim/.vim/bundle/stime/tables/turkish | 143 + vim/.vim/bundle/stime/tables/viqr | 264 + vim/.vim/bundle/stime/tables/vni | 164 + vim/.vim/bundle/stime/tables/yawerty | 180 + vim/.vim/keymap/vietnamese-telex_utf-8.vim | 171 + vim/.vim/keymap/vietnamese-vni_utf-8.vim | 160 + vim/.vim/syntax/pascal.vim | 373 + vim/.vim/syntax/python.vim | 327 + vim/.vimrc | 29 + vimperator/.vimperator/colors/g.vimp | 136 + vimperator/.vimperator/colors/gruvbox.vimp | 100 + vimperator/.vimperator/colors/style.js | 842 + vimperator/.vimperator/info/default/ignored-keys | 1 + vimperator/.vimperator/info/default/local-marks | 1 + vimperator/.vimperator/info/default/macros | 1 + vimperator/.vimperator/info/default/quickmarks | 1 + vimperator/.vimperatorrc | 8 + 97 files changed, 102590 insertions(+) create mode 100644 X/.Xdefaults create mode 100644 X/.config/gtk-3.0/gtkcss create mode 100644 X/.config/gtk-3.0/settings.ini create mode 100755 X/.fonts/DroidSansMonoDotted.ttf create mode 100755 X/.fonts/DroidSansMonoSlashed.ttf create mode 100644 X/.gtkrc-2.0 create mode 100644 X/.xinitrc create mode 100644 awesome/.config/awesome/rc.lua create mode 100644 awesome/.config/awesome/themes/gruvbox/arrows/0.png create mode 100644 awesome/.config/awesome/themes/gruvbox/arrows/1.png create mode 100644 awesome/.config/awesome/themes/gruvbox/arrows/2.png create mode 100644 awesome/.config/awesome/themes/gruvbox/arrows/3.png create mode 100644 awesome/.config/awesome/themes/gruvbox/arrows/4.png create mode 100644 awesome/.config/awesome/themes/gruvbox/arrows/5.png create mode 100644 awesome/.config/awesome/themes/gruvbox/awesome-icon.png create mode 100644 awesome/.config/awesome/themes/gruvbox/background-1280x800.png create mode 100644 awesome/.config/awesome/themes/gruvbox/background-2048x1152.png create mode 100644 awesome/.config/awesome/themes/gruvbox/background-2048x1280.png create mode 100644 awesome/.config/awesome/themes/gruvbox/background-2048x1536.png create mode 100644 awesome/.config/awesome/themes/gruvbox/gradient-debian-big.png create mode 100644 awesome/.config/awesome/themes/gruvbox/gradient-debian.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/dwindle.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/fairh.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/fairv.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/floating.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/fullscreen.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/magnifier.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/max.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/spiral.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/tile.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/tilebottom.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/tileleft.png create mode 100644 awesome/.config/awesome/themes/gruvbox/layouts/tiletop.png create mode 100644 awesome/.config/awesome/themes/gruvbox/submenu.png create mode 100644 awesome/.config/awesome/themes/gruvbox/taglist/squarefz.png create mode 100644 awesome/.config/awesome/themes/gruvbox/taglist/squarez.png create mode 100644 awesome/.config/awesome/themes/gruvbox/theme.lua create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/close_focus.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_active.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_inactive.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_active.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_inactive.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/normal.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_active.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_inactive.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_active.png create mode 100644 awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_inactive.png create mode 100644 bash/.bash_logout create mode 100644 bash/.bashrc create mode 100644 bash/.profile create mode 100644 bin/.local/bin/2048.c create mode 100755 bin/.local/bin/scot.sh create mode 100644 ranger/.config/ranger/commands.py create mode 100644 ranger/.config/ranger/commands_full.py create mode 100644 ranger/.config/ranger/rc.conf create mode 100644 ranger/.config/ranger/rifle.conf create mode 100755 ranger/.config/ranger/scope.sh create mode 100644 ranger/.config/ranger/tagged create mode 100755 vim/.gvimrc create mode 100644 vim/.vim/.netrwhist create mode 160000 vim/.vim/bundle/gruvbox create mode 100644 vim/.vim/bundle/stime/LICENSE create mode 100644 vim/.vim/bundle/stime/README-vi.md create mode 100644 vim/.vim/bundle/stime/README-vi.pdf create mode 100644 vim/.vim/bundle/stime/README.md create mode 100644 vim/.vim/bundle/stime/autoload/stime.vim create mode 100644 vim/.vim/bundle/stime/plugin/stime.vim create mode 100644 vim/.vim/bundle/stime/tables/cns11643 create mode 100644 vim/.vim/bundle/stime/tables/compose create mode 100644 vim/.vim/bundle/stime/tables/cyrillic create mode 100644 vim/.vim/bundle/stime/tables/diacritics create mode 100644 vim/.vim/bundle/stime/tables/greek create mode 100644 vim/.vim/bundle/stime/tables/ipa-x-sampa create mode 100644 vim/.vim/bundle/stime/tables/latex create mode 100644 vim/.vim/bundle/stime/tables/rusle create mode 100644 vim/.vim/bundle/stime/tables/rustrad create mode 100644 vim/.vim/bundle/stime/tables/telex create mode 100644 vim/.vim/bundle/stime/tables/templete create mode 100644 vim/.vim/bundle/stime/tables/translit create mode 100644 vim/.vim/bundle/stime/tables/translit-ua create mode 100644 vim/.vim/bundle/stime/tables/turkish create mode 100644 vim/.vim/bundle/stime/tables/viqr create mode 100644 vim/.vim/bundle/stime/tables/vni create mode 100644 vim/.vim/bundle/stime/tables/yawerty create mode 100644 vim/.vim/keymap/vietnamese-telex_utf-8.vim create mode 100644 vim/.vim/keymap/vietnamese-vni_utf-8.vim create mode 100644 vim/.vim/syntax/pascal.vim create mode 100644 vim/.vim/syntax/python.vim create mode 100755 vim/.vimrc create mode 100644 vimperator/.vimperator/colors/g.vimp create mode 100644 vimperator/.vimperator/colors/gruvbox.vimp create mode 100755 vimperator/.vimperator/colors/style.js create mode 100644 vimperator/.vimperator/info/default/ignored-keys create mode 100644 vimperator/.vimperator/info/default/local-marks create mode 100644 vimperator/.vimperator/info/default/macros create mode 100644 vimperator/.vimperator/info/default/quickmarks create mode 100644 vimperator/.vimperatorrc diff --git a/X/.Xdefaults b/X/.Xdefaults new file mode 100644 index 0000000..9afcfd6 --- /dev/null +++ b/X/.Xdefaults @@ -0,0 +1,73 @@ +! URxvt configs +! General +!urxvt*termName: rxvt-256color +urxvt*loginShell: true +urxvt*scrollBar: false +urxvt*secondaryScroll: true +urxvt*saveLines: 65535 +urxvt*cursorBlink: false +urxvt*urgentOnBell: true +!urxvt*override-redirect:false +!urxvt*borderLess: false +!urxvt*internalBorder: 0 +!urxvt*externalBorder: 0 + +! Extensions +urxvt*perl-lib: /usr/lib/urxvt/perl/ +urxvt*perl-ext-common: default,matcher,searchable-scrollback +urxvt*urlLauncher: /usr/bin/firefox +urxvt*matcher.button: 1 +! - catch ugly URLs +urxvt.cutchars: `()'*<>[]{|}" + +! Appearance +! - use xft for drawing fonts +urxvt.font: xft:Droid Sans Mono Slashed:size=11 +urxvt.letterSpace: -1 +! - cursor +!urxvt*cursorColor: #DCDCCC +! - color scheme +urxvt.background: #282828 +urxvt.foreground: #ebdbb2 +urxvt*color0: #282828 +urxvt*color1: #cc241d +urxvt*color2: #98971a +urxvt*color3: #d79921 +urxvt*color4: #458588 +urxvt*color5: #b16286 +urxvt*color6: #689d6a +urxvt*color7: #a89984 +urxvt*color8: #928374 +urxvt*color9: #fb4934 +urxvt*color10: #b8bb26 +urxvt*color11: #fabd2f +urxvt*color12: #83a598 +urxvt*color13: #d3869b +urxvt*color14: #8ec07c +urxvt*color15: #ebdbb2 + +! XTerm configs +UXTerm*faceName: Droid Sans Mono Slashed:size=11 +UXTerm*background: #282828 +UXTerm*foreground: #ebdbb2 +UXTerm*color0: #282828 +UXTerm*color1: #cc241d +UXTerm*color2: #98971a +UXTerm*color3: #d79921 +UXTerm*color4: #458588 +UXTerm*color5: #b16286 +UXTerm*color6: #689d6a +UXTerm*color7: #a89984 +UXTerm*color8: #928374 +UXTerm*color9: #fb4934 +UXTerm*color10: #b8bb26 +UXTerm*color11: #fabd2f +UXTerm*color12: #83a598 +UXTerm*color13: #d3869b +UXTerm*color14: #8ec07c +UXTerm*color15: #ebdbb2 +UXTerm*loginShell: true +UXTerm*scrollBar: false +UXTerm*saveLines: 65535 +UXTerm*cursorBlink: false +UXTerm*jumpScroll: true diff --git a/X/.config/gtk-3.0/gtkcss b/X/.config/gtk-3.0/gtkcss new file mode 100644 index 0000000..e7ff883 --- /dev/null +++ b/X/.config/gtk-3.0/gtkcss @@ -0,0 +1,4 @@ +.window-frame { + box-shadow: none; + margin: 0; +} diff --git a/X/.config/gtk-3.0/settings.ini b/X/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..a057cce --- /dev/null +++ b/X/.config/gtk-3.0/settings.ini @@ -0,0 +1,5 @@ +[Settings] +gtk-icon-theme-name = Numix-Circle +gtk-cursor-theme-name = Adwaita +gtk-application-prefer-dark-theme = true +gtk-font-name = Noto Sans 10 diff --git a/X/.fonts/DroidSansMonoDotted.ttf b/X/.fonts/DroidSansMonoDotted.ttf new file mode 100755 index 0000000..e56a5ca Binary files /dev/null and b/X/.fonts/DroidSansMonoDotted.ttf differ diff --git a/X/.fonts/DroidSansMonoSlashed.ttf b/X/.fonts/DroidSansMonoSlashed.ttf new file mode 100755 index 0000000..8c44b47 Binary files /dev/null and b/X/.fonts/DroidSansMonoSlashed.ttf differ diff --git a/X/.gtkrc-2.0 b/X/.gtkrc-2.0 new file mode 100644 index 0000000..6035b2f --- /dev/null +++ b/X/.gtkrc-2.0 @@ -0,0 +1,4 @@ +gtk-theme-name = "gruvnox" +gtk-icon-theme-name = "Numix-Circle" +gtk-cursor-theme-name = "Adwaita" +gtk-font-name = "Noto Sans 10" diff --git a/X/.xinitrc b/X/.xinitrc new file mode 100644 index 0000000..176a3ba --- /dev/null +++ b/X/.xinitrc @@ -0,0 +1,9 @@ +#!/bin/sh +setxkbmap -option caps:swapescape +xrandr --output VGA-0 --mode 1600x900 --primary --right-of LVDS +synclient TapButton1=1 VertEdgeScroll=1 HorizEdgeScroll=1 VertTwoFingerScroll=0 +ibus-daemon -drx +nm-applet & +clipit & +mate-power-manager & +exec awesome diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua new file mode 100644 index 0000000..7b41742 --- /dev/null +++ b/awesome/.config/awesome/rc.lua @@ -0,0 +1,555 @@ +-- Standard awesome library +local gears = require("gears") +local awful = require("awful") +awful.rules = require("awful.rules") +require("awful.autofocus") +-- Widget and layout library +local wibox = require("wibox") +-- Theme handling library +local beautiful = require("beautiful") +-- Notification library +local naughty = require("naughty") +local menubar = require("menubar") +-- Vicious and Lain +local vicious = require("vicious") + +-- Load Debian menu entries +require("debian.menu") + +-- Launch a composting manager +--awful.util.spawn_with_shell("compton -r 6 -o .50 -l -9 -t -9 -c -C &") + +-- {{{ Error handling +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + -- Make sure we don't go into an endless error loop + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = err }) + in_error = false + end) +end +-- }}} + +-- {{{ Variable definitions +-- Themes define colours, icons, font and wallpapers. +beautiful.init("~/.config/awesome/themes/gruvbox/theme.lua") + +modkey = "Mod4" + +-- Table of layouts to cover with awful.layout.inc, order matters. +local layouts = +{ + --lain.layout.uselessfair, + --lain.layout.uselessfair.horizontal, + awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, + awful.layout.suit.magnifier, + awful.layout.suit.max.fullscreen, + awful.layout.suit.tile.bottom, + awful.layout.suit.tile, + --lain.layout.uselesstile.bottom, + --lain.layout.uselesstile +} +-- }}} + +-- {{{ Wallpaper +awful.util.spawn_with_shell("hsetroot -solid '#282828'") +--if beautiful.wallpaper then +-- for s = 1, screen.count() do +-- gears.wallpaper.maximized(beautiful.wallpaper, s, true) +-- end +--end +-- }}} + +-- {{{ Tags +-- Define a tag table which hold all screen tags. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1]) +end +-- }}} + +-- {{{ Menu +-- Create a laucher widget and a main menu +mymainmenu = awful.menu( debian.menu.Debian_menu.Debian ) + +-- Menubar configuration +--menubar.utils.terminal = "uxterm" -- Set the terminal for applications that require it +-- }}} + +-- {{{ Wibox +-- Create a wibox for each screen and add it +mywibox = {} +mypromptbox = {} +mylayoutbox = {} +mytaglist = {} +mytaglist.buttons = awful.util.table.join( + awful.button({ }, 1, awful.tag.viewonly), + awful.button({ modkey }, 1, awful.client.movetotag), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, awful.client.toggletag), + awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) + ) + +-- Create a textclock widget +myclock_text = awful.widget.textclock( + " #%u %FT%R", + 60) +myclock = wibox.widget.background() +myclock:set_widget(myclock_text) +myclock:set_bg("#d65d0e") + +-- Create a CPU usage widget +mycpuwidget_text = wibox.widget.textbox() +vicious.register( + mycpuwidget_text, + vicious.widgets.cpu, + function(widget, args) + return(" CPU%03d%%"):format(args[1]) + end, + 5) +mycpuwidget = wibox.widget.background() +mycpuwidget:set_widget(mycpuwidget_text) +mycpuwidget:set_bg("#d79921") + +-- Create a memory usage widget +mymemwidget_text = wibox.widget.textbox() +vicious.register( + mymemwidget_text, + vicious.widgets.mem, + function(widget, args) + return(" MEM%03d%%"):format(args[1]) + end, + 5) +mymemwidget = wibox.widget.background() +mymemwidget:set_widget(mymemwidget_text) +mymemwidget:set_bg("#98971a") + +-- Create a battery widget +mybatwidget_text = wibox.widget.textbox() +vicious.register( + mybatwidget_text, + vicious.widgets.bat, + function(widget, args) + return(" %s%03d%%"):format(args[1], + args[2]) + end, + 5, + "C11F") +mybatwidget = wibox.widget.background() +mybatwidget:set_widget(mybatwidget_text) +mybatwidget:set_bg("#689d6a") + +-- Create a volume widget +--function update_volume(widget) +-- local fd = io.popen("amixer sget Master") +-- local status = fd:read("*all") +-- fd:close() +-- -- local volume = tonumber(string.match(status, "(%d?%d?%d)%%")) / 100 +-- local volume = string.match(status, "(%d?%d?%d)%%") +-- volume = string.format("VOL%03d", volume) +-- status = string.match(status, "%[(o[^%]]*)%]") +-- if string.find(status, "on", 1, true) then +-- volume = volume .. "%" +-- else +-- volume = volume .. "M" +-- end +-- widget:set_markup(" " .. volume .. "") +--end + +myvolwidget_text = wibox.widget.textbox() +--update_volume(myvolwidget_text) +vicious.register( + myvolwidget_text, + vicious.widgets.volume, + function(widget, args) + return(" %s%03d%%"):format(args[2], + args[1]) + end, + 1, + "Master") +myvolwidget = wibox.widget.background() +myvolwidget:set_widget(myvolwidget_text) +myvolwidget:set_bg("#458588") + +-- Create network usage widgets +--myupwidget_text = wibox.widget.textbox() +--vicious.register( +-- myupwidget_text, +-- vicious.widgets.net, +-- function (widget, args) +-- return (" ↑%04.0fkB"):format(args["{wlp2s2 up_kb}"]) +-- end, +-- 1) +--myupwidget = wibox.widget.background() +--myupwidget:set_widget(myupwidget_text) +--myupwidget:set_bg("#689d6a") +-- +--mydownwidget_text = wibox.widget.textbox() +--vicious.register( +-- mydownwidget_text, +-- vicious.widgets.net, +-- function (widget, args) +-- return (" ↓%04.0fkB"):format(args["{wlp2s2 down_kb}"]) +-- end, +-- 1) +--mydownwidget = wibox.widget.background() +--mydownwidget:set_widget(mydownwidget_text) +--mydownwidget:set_bg("#458588") + +-- Arrows +myarrow0 = wibox.widget.imagebox() +myarrow0:set_image(beautiful.arrow0) +myarrow1 = wibox.widget.imagebox() +myarrow1:set_image(beautiful.arrow1) +myarrow2 = wibox.widget.imagebox() +myarrow2:set_image(beautiful.arrow2) +myarrow3 = wibox.widget.imagebox() +myarrow3:set_image(beautiful.arrow3) +myarrow4 = wibox.widget.imagebox() +myarrow4:set_image(beautiful.arrow4) +myarrow5 = wibox.widget.imagebox() +myarrow5:set_image(beautiful.arrow5) + +for s = 1, screen.count() do + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({prompt = " "}) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = awful.widget.layoutbox(s) + mylayoutbox[s]:buttons(awful.util.table.join( + awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), + awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) + -- Create a taglist widget + mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) + + -- Create the wibox + mywibox[s] = awful.wibox({ position = "top", height = "24", screen = s }) + + -- Widgets that are aligned to the left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(myclock) + --left_layout:add(myarrow0) + left_layout:add(myarrow1) + left_layout:add(mycpuwidget) + left_layout:add(myarrow2) + left_layout:add(mymemwidget) + left_layout:add(myarrow3) + --left_layout:add(myupwidget) + left_layout:add(mybatwidget) + left_layout:add(myarrow4) + left_layout:add(myvolwidget) + --left_layout:add(mydownwidget) + left_layout:add(myarrow5) + left_layout:add(mypromptbox[s]) + + -- Widgets that are aligned to the right + local right_layout = wibox.layout.fixed.horizontal() + if s == 1 then right_layout:add(wibox.widget.systray()) end + right_layout:add(mytaglist[s]) + right_layout:add(mylayoutbox[s]) + + -- Now bring it all together (with the tasklist in the middle) + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + layout:set_right(right_layout) + + mywibox[s]:set_widget(layout) +end +-- }}} + +-- {{{ Mouse bindings +root.buttons(awful.util.table.join( + awful.button({ }, 3, function () mymainmenu:toggle() end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +)) +-- }}} + +-- {{{ Key bindings +globalkeys = awful.util.table.join( + awful.key({ modkey, }, "Left", awful.tag.viewprev ), + awful.key({ modkey, }, "Right", awful.tag.viewnext ), + awful.key({ modkey, }, "Escape", awful.tag.history.restore), + + awful.key({ modkey, }, "0", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, }, "j", + function () + awful.client.focus.byidx( 1) + if client.focus then client.focus:raise() end + end), + awful.key({ modkey, }, "k", + function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end), + awful.key({ modkey, "Shift" }, "w", function () mymainmenu:show() end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + + -- Standard program + awful.key({ modkey, }, "t", function () awful.util.spawn("uxterm") end), + awful.key({ modkey, "Shift" }, "t", function () awful.util.spawn("uxterm -e su -") end), + awful.key({ modkey, }, "b", function () awful.util.spawn("x-www-browser") end), + awful.key({ modkey, }, "v", function () awful.util.spawn("gvim") end), + awful.key({ modkey, }, "f", function () awful.util.spawn("spacefm") end), + awful.key({ modkey, }, "p", function () awful.util.spawn("uxterm -e python3") end), + awful.key({ modkey, }, "m", function () awful.util.spawn("uxterm -e mutt") end), + awful.key({ modkey, }, "r", function () awful.util.spawn("uxterm -e ranger") end), + awful.key({ modkey, }, "c", function () awful.util.spawn("uxterm -e cmus") end), + awful.key({ modkey, }, "w", function () awful.util.spawn("uxterm -e weechat") end), + awful.key({ modkey, }, "s", function () awful.util.spawn("slock xset dpms force off") end), + awful.key({ modkey, "Shift" }, "s", function () awful.util.spawn("slock systemctl suspend -i") end), + awful.key({ modkey, "Shift" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, }, "Return", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "Return", function () awful.layout.inc(layouts, -1) end), + + awful.key({ modkey, "Shift" }, "n", awful.client.restore), + + -- Prompt + awful.key({ modkey, "Shift" }, ";", function () mypromptbox[mouse.screen]:run() end), + + awful.key({ modkey }, "x", + function () + awful.prompt.run({ prompt = "Run Lua code: " }, + mypromptbox[mouse.screen].widget, + awful.util.eval, nil, + awful.util.getdir("cache") .. "/history_eval") + end) + -- Menubar + -- awful.key({ modkey }, "p", function() menubar.show() end) +) + +-- Adjusting volumes +globalkeys = awful.util.table.join(globalkeys, awful.key({ }, "XF86AudioRaiseVolume", function() + awful.util.spawn("amixer sset Master 5%+", false) + --update_volume(myvolwidget_text) +end)) +globalkeys = awful.util.table.join(globalkeys, awful.key({ }, "XF86AudioLowerVolume", function() + awful.util.spawn("amixer sset Master 5%-", false) + --update_volume(myvolwidget_text) +end)) +globalkeys = awful.util.table.join(globalkeys, awful.key({ }, "XF86AudioMute", function() + awful.util.spawn("amixer sset Master toggle", false) + -- The 2 following lines were needed at least on my configuration, otherwise it would get stuck muted + -- However, if the channel you're using is "Speaker" or "Headpphone" + -- instead of "Master", you'll have to comment out their corresponding line below. + awful.util.spawn("amixer sset Speaker unmute", false) + awful.util.spawn("amixer sset Headphone unmute", false) + --update_volume(myvolwidget_text) +end)) + +clientkeys = awful.util.table.join( + awful.key({ modkey, "Shift" }, "f", function (c) c.fullscreen = not c.fullscreen end), + awful.key({ modkey, }, "q", function (c) c:kill() end), + --awful.key({ modkey, "Control" }, "Return", awful.client.floating.toggle ), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), + awful.key({ modkey, "Shift" }, "0", awful.client.movetoscreen ), + --awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), + --awful.key({ modkey, }, "m", + -- function (c) + -- c.maximized_horizontal = not c.maximized_horizontal + -- c.maximized_vertical = not c.maximized_vertical + -- end), + awful.key({ modkey, }, "n", + function (c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end) +) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + globalkeys = awful.util.table.join(globalkeys, + -- View tag only. + awful.key({ modkey }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewonly(tag) + end + end), + -- Toggle tag. + awful.key({ modkey, "Control" }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewtoggle(tag) + end + end), + -- Move client to tag. + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = awful.tag.gettags(client.focus.screen)[i] + if tag then + awful.client.movetotag(tag) + end + end + end), + -- Toggle tag. + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = awful.tag.gettags(client.focus.screen)[i] + if tag then + awful.client.toggletag(tag) + end + end + end)) +end + +clientbuttons = awful.util.table.join( + awful.button({ }, 1, function (c) client.focus = c; c:raise() end), + awful.button({ modkey }, 1, awful.mouse.client.move), + awful.button({ modkey }, 3, awful.mouse.client.resize)) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = { + -- All clients will match this rule. + { rule = { }, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + size_hints_honor = false, + raise = true, + keys = clientkeys, + buttons = clientbuttons } }, + --{ rule = { class = "X-terminal-emulator" }, + -- properties = { size_hints_honor = false } }, + --{ rule = { class = "Gvim" }, + -- properties = { size_hints_honor = false } }, + { rule = { class = "Volti-mixer" }, + properties = { floating = true } }, + { rule = { class = "vlc" }, + properties = { floating = true } }, + { rule = { class = "Gcolor2" }, + properties = { floating = true } }, + { rule = { class = "pinentry" }, + properties = { floating = true } }, + { rule = { class = "Twf" }, + properties = { floating = true } }, + { rule = { class = "Galculator" }, + properties = { floating = true } }, + -- Set Firefox to always map on tags number 2 of screen 1. + -- { rule = { class = "Firefox" }, + -- properties = { tag = tags[1][2] } }, +} +-- }}} + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function (c, startup) + -- Enable sloppy focus + c:connect_signal("mouse::enter", function(c) + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end + end) + + if not startup then + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- awful.client.setslave(c) + + -- Put windows in a smart way, only if they does not set an initial position. + if not c.size_hints.user_position and not c.size_hints.program_position then + awful.placement.no_overlap(c) + awful.placement.no_offscreen(c) + end + elseif not c.size_hints.user_position and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count change + awful.placement.no_offscreen(c) + end + + --local titlebars_enabled = true + --if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then + if awful.client.floating.get(c) then + -- buttons for the titlebar + local buttons = awful.util.table.join( + awful.button({ }, 1, function() + client.focus = c + c:raise() + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + client.focus = c + c:raise() + awful.mouse.client.resize(c) + end) + ) + + -- Widgets that are aligned to the left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(awful.titlebar.widget.closebutton(c)) + left_layout:add(awful.titlebar.widget.ontopbutton(c)) + left_layout:add(awful.titlebar.widget.stickybutton(c)) + left_layout:add(awful.titlebar.widget.maximizedbutton(c)) + left_layout:add(awful.titlebar.widget.floatingbutton(c)) + + -- The title goes in the middle + local middle_layout = wibox.layout.flex.horizontal() + local title = awful.titlebar.widget.titlewidget(c) + title:set_align("center") + middle_layout:add(title) + middle_layout:buttons(buttons) + + -- Now bring it all together + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + layout:set_middle(middle_layout) + + awful.titlebar(c):set_widget(layout) + end +end) + +client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- }}} diff --git a/awesome/.config/awesome/themes/gruvbox/arrows/0.png b/awesome/.config/awesome/themes/gruvbox/arrows/0.png new file mode 100644 index 0000000..9acbc37 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/arrows/0.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/arrows/1.png b/awesome/.config/awesome/themes/gruvbox/arrows/1.png new file mode 100644 index 0000000..29ad5b0 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/arrows/1.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/arrows/2.png b/awesome/.config/awesome/themes/gruvbox/arrows/2.png new file mode 100644 index 0000000..4b6a25f Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/arrows/2.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/arrows/3.png b/awesome/.config/awesome/themes/gruvbox/arrows/3.png new file mode 100644 index 0000000..5d40ead Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/arrows/3.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/arrows/4.png b/awesome/.config/awesome/themes/gruvbox/arrows/4.png new file mode 100644 index 0000000..c821055 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/arrows/4.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/arrows/5.png b/awesome/.config/awesome/themes/gruvbox/arrows/5.png new file mode 100644 index 0000000..47c8db0 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/arrows/5.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/awesome-icon.png b/awesome/.config/awesome/themes/gruvbox/awesome-icon.png new file mode 100644 index 0000000..6ce854b Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/awesome-icon.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/background-1280x800.png b/awesome/.config/awesome/themes/gruvbox/background-1280x800.png new file mode 100644 index 0000000..a8d6ff0 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/background-1280x800.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/background-2048x1152.png b/awesome/.config/awesome/themes/gruvbox/background-2048x1152.png new file mode 100644 index 0000000..f138a11 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/background-2048x1152.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/background-2048x1280.png b/awesome/.config/awesome/themes/gruvbox/background-2048x1280.png new file mode 100644 index 0000000..9ad4338 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/background-2048x1280.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/background-2048x1536.png b/awesome/.config/awesome/themes/gruvbox/background-2048x1536.png new file mode 100644 index 0000000..66de69d Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/background-2048x1536.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/gradient-debian-big.png b/awesome/.config/awesome/themes/gruvbox/gradient-debian-big.png new file mode 100644 index 0000000..6c51fff Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/gradient-debian-big.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/gradient-debian.png b/awesome/.config/awesome/themes/gruvbox/gradient-debian.png new file mode 100644 index 0000000..6e3928f Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/gradient-debian.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/dwindle.png b/awesome/.config/awesome/themes/gruvbox/layouts/dwindle.png new file mode 100644 index 0000000..914b0da Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/dwindle.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/fairh.png b/awesome/.config/awesome/themes/gruvbox/layouts/fairh.png new file mode 100644 index 0000000..c68b04c Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/fairh.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/fairv.png b/awesome/.config/awesome/themes/gruvbox/layouts/fairv.png new file mode 100644 index 0000000..f71d011 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/fairv.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/floating.png b/awesome/.config/awesome/themes/gruvbox/layouts/floating.png new file mode 100644 index 0000000..fbebe75 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/floating.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/fullscreen.png b/awesome/.config/awesome/themes/gruvbox/layouts/fullscreen.png new file mode 100644 index 0000000..d7b5615 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/fullscreen.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/magnifier.png b/awesome/.config/awesome/themes/gruvbox/layouts/magnifier.png new file mode 100644 index 0000000..cfaa4be Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/magnifier.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/max.png b/awesome/.config/awesome/themes/gruvbox/layouts/max.png new file mode 100644 index 0000000..c975785 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/max.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/spiral.png b/awesome/.config/awesome/themes/gruvbox/layouts/spiral.png new file mode 100644 index 0000000..873cd18 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/spiral.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/tile.png b/awesome/.config/awesome/themes/gruvbox/layouts/tile.png new file mode 100644 index 0000000..731cdef Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/tile.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/tilebottom.png b/awesome/.config/awesome/themes/gruvbox/layouts/tilebottom.png new file mode 100644 index 0000000..064e429 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/tilebottom.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/tileleft.png b/awesome/.config/awesome/themes/gruvbox/layouts/tileleft.png new file mode 100644 index 0000000..0bf6785 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/tileleft.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/layouts/tiletop.png b/awesome/.config/awesome/themes/gruvbox/layouts/tiletop.png new file mode 100644 index 0000000..781f2ee Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/layouts/tiletop.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/submenu.png b/awesome/.config/awesome/themes/gruvbox/submenu.png new file mode 100644 index 0000000..6f9e9c5 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/submenu.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/taglist/squarefz.png b/awesome/.config/awesome/themes/gruvbox/taglist/squarefz.png new file mode 100644 index 0000000..a780e55 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/taglist/squarefz.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/taglist/squarez.png b/awesome/.config/awesome/themes/gruvbox/taglist/squarez.png new file mode 100644 index 0000000..f49944e Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/taglist/squarez.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/theme.lua b/awesome/.config/awesome/themes/gruvbox/theme.lua new file mode 100644 index 0000000..4f1bceb --- /dev/null +++ b/awesome/.config/awesome/themes/gruvbox/theme.lua @@ -0,0 +1,153 @@ +------------------------------- +-- "gruvbox" awesome theme -- +-- By McSinyx (cnx) -- +------------------------------- + +-- Alternative icon sets and widget icons: +-- * http://awesome.naquadah.org/wiki/Nice_Icons + +-- {{{ Main +theme = {} +--theme.wallpaper = mythemedir .. "gradient-debian-big.png" +theme.wallpaper_cmd = { "hsetroot -solid '#282828'" } +-- }}} + +-- {{{ Styles +theme.font = "Droid Sans Mono Slashed 11" +mybg = "#282828" +mybg_alt = "#3c3836" +myfg = "#ebdbb2" +myred = "#cc241d" +mypurple = "#b16286" + +-- {{{ Colors +theme.fg_normal = myfg +theme.fg_focus = myfg +theme.fg_urgent = "#d3869b" +theme.bg_normal = mybg +theme.bg_focus = mybg_alt +theme.bg_urgent = theme.bg_normal +theme.bg_systray = theme.bg_normal +-- }}} + +-- {{{ Borders +theme.border_width = 1 +theme.border_normal = "#3c3836" +theme.border_focus = "#b16286" +theme.border_marked = "#d3869b" +-- }}} + +-- {{{ Titlebars +theme.titlebar_bg_focus = "#282828" +theme.titlebar_bg_normal = "#282828" +-- }}} + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- [taglist|tasklist]_[bg|fg]_[focus|urgent] +-- titlebar_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- Example: +--theme.taglist_bg_focus = "#d3869b" +-- }}} + +-- {{{ Widgets +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.fg_widget = "#AECF96" +--theme.fg_center_widget = "#88A175" +--theme.fg_end_widget = "#FF5656" +--theme.bg_widget = "#494B4F" +--theme.border_widget = "#282828" +-- }}} + +-- {{{ Mouse finder +theme.mouse_finder_color = "#d3869b" +-- mouse_finder_[timeout|animate_timeout|radius|factor] +-- }}} + +-- {{{ Menu +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_height = 20 +theme.menu_width = 160 +-- }}} + +-- {{{ Icons +mythemedir = "~/.config/awesome/themes/gruvbox/" +-- {{{ Taglist +theme.taglist_squares_sel = mythemedir .. "taglist/squarefz.png" +theme.taglist_squares_unsel = mythemedir .. "taglist/squarez.png" +--theme.taglist_squares_resize = "false" +-- }}} + +-- {{{ Misc +theme.awesome_icon = mythemedir .. "awesome-icon.png" +theme.menu_submenu_icon = mythemedir .. "submenu.png" +-- }}} + +-- {{{ Layout +theme.layout_tile = mythemedir .. "layouts/tile.png" +theme.layout_tileleft = mythemedir .. "layouts/tileleft.png" +theme.layout_tilebottom = mythemedir .. "layouts/tilebottom.png" +theme.layout_tiletop = mythemedir .. "layouts/tiletop.png" +theme.layout_fairv = mythemedir .. "layouts/fairv.png" +theme.layout_fairh = mythemedir .. "layouts/fairh.png" +theme.layout_spiral = mythemedir .. "layouts/spiral.png" +theme.layout_dwindle = mythemedir .. "layouts/dwindle.png" +theme.layout_max = mythemedir .. "layouts/max.png" +theme.layout_fullscreen = mythemedir .. "layouts/fullscreen.png" +theme.layout_magnifier = mythemedir .. "layouts/magnifier.png" +theme.layout_floating = mythemedir .. "layouts/floating.png" + +-- Lain's useless layouts +theme.layout_uselesstile = theme.layout_tile +theme.layout_uselesstileleft = theme.layout_tileleft +theme.layout_uselesstilebottom = theme.layout_tilebottom +theme.layout_uselesstiletop = theme.layout_tiletop +theme.layout_uselessfair = theme.layout_fairv +theme.layout_uselessfairh = theme.layout_fairh +theme.layout_uselesspiral = theme.layout_spiral +theme.layout_uselessdwindle = theme.layout_dwindle +theme.useless_gap_width = 12 +-- }}} + +-- {{{ Titlebar +theme.titlebar_close_button_focus = mythemedir .. "titlebar/close_focus.png" +theme.titlebar_close_button_normal = mythemedir .. "titlebar/normal.png" + +theme.titlebar_ontop_button_focus_active = mythemedir .. "titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = mythemedir .. "titlebar/normal.png" +theme.titlebar_ontop_button_focus_inactive = mythemedir .. "titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = mythemedir .. "titlebar/normal.png" + +theme.titlebar_sticky_button_focus_active = mythemedir .. "titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = mythemedir .. "titlebar/normal.png" +theme.titlebar_sticky_button_focus_inactive = mythemedir .. "titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = mythemedir .. "titlebar/normal.png" + +theme.titlebar_floating_button_focus_active = mythemedir .. "titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = mythemedir .. "titlebar/normal.png" +theme.titlebar_floating_button_focus_inactive = mythemedir .. "titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = mythemedir .. "titlebar/normal.png" + +theme.titlebar_maximized_button_focus_active = mythemedir .. "titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = mythemedir .. "titlebar/normal.png" +theme.titlebar_maximized_button_focus_inactive = mythemedir .. "titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_inactive = mythemedir .. "titlebar/normal.png" +-- }}} + +-- {{{ Arrows +theme.arrow0 = mythemedir .. "arrows/0.png" +theme.arrow1 = mythemedir .. "arrows/1.png" +theme.arrow2 = mythemedir .. "arrows/2.png" +theme.arrow3 = mythemedir .. "arrows/3.png" +theme.arrow4 = mythemedir .. "arrows/4.png" +theme.arrow5 = mythemedir .. "arrows/5.png" +-- }}} +-- }}} + +return theme diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/close_focus.png b/awesome/.config/awesome/themes/gruvbox/titlebar/close_focus.png new file mode 100644 index 0000000..e100e4a Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/close_focus.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_active.png b/awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_active.png new file mode 100644 index 0000000..a6f0042 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_active.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_inactive.png b/awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..f70fa67 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/floating_focus_inactive.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_active.png b/awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..0a73987 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_active.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_inactive.png b/awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..802061a Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/maximized_focus_inactive.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/normal.png b/awesome/.config/awesome/themes/gruvbox/titlebar/normal.png new file mode 100644 index 0000000..89f68b4 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/normal.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_active.png b/awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..efd96c6 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_active.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_inactive.png b/awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..bb85b1c Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/ontop_focus_inactive.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_active.png b/awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..53b1394 Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_active.png differ diff --git a/awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_inactive.png b/awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..2787cbe Binary files /dev/null and b/awesome/.config/awesome/themes/gruvbox/titlebar/sticky_focus_inactive.png differ diff --git a/bash/.bash_logout b/bash/.bash_logout new file mode 100644 index 0000000..de4f5f7 --- /dev/null +++ b/bash/.bash_logout @@ -0,0 +1,7 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..ef26b22 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,129 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +#alias ll='ls -l' +#alias la='ls -A' +#alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. +alias x='cd ~ && startx' +alias wduck='w3m duckduckgo.com' +TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1)); history -r' + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +function dct { + while true + do + dict $1 | less + done +} + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +# vi mode input +set -o vi + +export RTV_EDITOR=vim +export BROWSER=w3m diff --git a/bash/.profile b/bash/.profile new file mode 100644 index 0000000..f870533 --- /dev/null +++ b/bash/.profile @@ -0,0 +1,22 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +# if running bash +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi diff --git a/bin/.local/bin/2048.c b/bin/.local/bin/2048.c new file mode 100644 index 0000000..197b66f --- /dev/null +++ b/bin/.local/bin/2048.c @@ -0,0 +1,11 @@ +M[16],X=16,W,k;main(){T(system("stty cbreak") +);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i +,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M +[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<< +(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k) +]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d +-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X] +*i;i--);i?M[i%X]=2<>X)%4]));}//[2048] diff --git a/bin/.local/bin/scot.sh b/bin/.local/bin/scot.sh new file mode 100755 index 0000000..8e9dc1c --- /dev/null +++ b/bin/.local/bin/scot.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd ~/Pictures/Screenshots +scrot '%F_%T.png' diff --git a/ranger/.config/ranger/commands.py b/ranger/.config/ranger/commands.py new file mode 100644 index 0000000..2df405f --- /dev/null +++ b/ranger/.config/ranger/commands.py @@ -0,0 +1,58 @@ +# This is a sample commands.py. You can add your own commands here. +# +# Please refer to commands_full.py for all the default commands and a complete +# documentation. Do NOT add them all here, or you may end up with defunct +# commands when upgrading ranger. + +# You always need to import ranger.api.commands here to get the Command class: +from ranger.api.commands import * + +# A simple command for demonstration purposes follows. +#------------------------------------------------------------------------------ + +# You can import any python module as needed. +import os + +# Any class that is a subclass of "Command" will be integrated into ranger as a +# command. Try typing ":my_edit" in ranger! +class my_edit(Command): + # The so-called doc-string of the class will be visible in the built-in + # help that is accessible by typing "?c" inside ranger. + """:my_edit + + A sample command for demonstration purposes that opens a file in an editor. + """ + + # The execute method is called when you run this command in ranger. + def execute(self): + # self.arg(1) is the first (space-separated) argument to the function. + # This way you can write ":my_edit somefilename". + if self.arg(1): + # self.rest(1) contains self.arg(1) and everything that follows + target_filename = self.rest(1) + else: + # self.fm is a ranger.core.filemanager.FileManager object and gives + # you access to internals of ranger. + # self.fm.thisfile is a ranger.container.file.File object and is a + # reference to the currently selected file. + target_filename = self.fm.thisfile.path + + # This is a generic function to print text in ranger. + self.fm.notify("Let's edit the file " + target_filename + "!") + + # Using bad=True in fm.notify allows you to print error messages: + if not os.path.exists(target_filename): + self.fm.notify("The given file does not exist!", bad=True) + return + + # This executes a function from ranger.core.acitons, a module with a + # variety of subroutines that can help you construct commands. + # Check out the source, or run "pydoc ranger.core.actions" for a list. + self.fm.edit_file(target_filename) + + # The tab method is called when you press tab, and should return a list of + # suggestions that the user will tab through. + def tab(self): + # This is a generic tab-completion function that iterates through the + # content of the current directory. + return self._tab_directory_content() diff --git a/ranger/.config/ranger/commands_full.py b/ranger/.config/ranger/commands_full.py new file mode 100644 index 0000000..cb62a62 --- /dev/null +++ b/ranger/.config/ranger/commands_full.py @@ -0,0 +1,1504 @@ +# -*- coding: utf-8 -*- +# This file is part of ranger, the console file manager. +# This configuration file is licensed under the same terms as ranger. +# =================================================================== +# +# NOTE: If you copied this file to ~/.config/ranger/commands_full.py, +# then it will NOT be loaded by ranger, and only serve as a reference. +# +# =================================================================== +# This file contains ranger's commands. +# It's all in python; lines beginning with # are comments. +# +# Note that additional commands are automatically generated from the methods +# of the class ranger.core.actions.Actions. +# +# You can customize commands in the file ~/.config/ranger/commands.py. +# It has the same syntax as this file. In fact, you can just copy this +# file there with `ranger --copy-config=commands' and make your modifications. +# But make sure you update your configs when you update ranger. +# +# =================================================================== +# Every class defined here which is a subclass of `Command' will be used as a +# command in ranger. Several methods are defined to interface with ranger: +# execute(): called when the command is executed. +# cancel(): called when closing the console. +# tab(): called when is pressed. +# quick(): called after each keypress. +# +# The return values for tab() can be either: +# None: There is no tab completion +# A string: Change the console to this string +# A list/tuple/generator: cycle through every item in it +# +# The return value for quick() can be: +# False: Nothing happens +# True: Execute the command afterwards +# +# The return value for execute() and cancel() doesn't matter. +# +# =================================================================== +# Commands have certain attributes and methods that facilitate parsing of +# the arguments: +# +# self.line: The whole line that was written in the console. +# self.args: A list of all (space-separated) arguments to the command. +# self.quantifier: If this command was mapped to the key "X" and +# the user pressed 6X, self.quantifier will be 6. +# self.arg(n): The n-th argument, or an empty string if it doesn't exist. +# self.rest(n): The n-th argument plus everything that followed. For example, +# if the command was "search foo bar a b c", rest(2) will be "bar a b c" +# self.start(n): Anything before the n-th argument. For example, if the +# command was "search foo bar a b c", start(2) will be "search foo" +# +# =================================================================== +# And this is a little reference for common ranger functions and objects: +# +# self.fm: A reference to the "fm" object which contains most information +# about ranger. +# self.fm.notify(string): Print the given string on the screen. +# self.fm.notify(string, bad=True): Print the given string in RED. +# self.fm.reload_cwd(): Reload the current working directory. +# self.fm.thisdir: The current working directory. (A File object.) +# self.fm.thisfile: The current file. (A File object too.) +# self.fm.thistab.get_selection(): A list of all selected files. +# self.fm.execute_console(string): Execute the string as a ranger command. +# self.fm.open_console(string): Open the console with the given string +# already typed in for you. +# self.fm.move(direction): Moves the cursor in the given direction, which +# can be something like down=3, up=5, right=1, left=1, to=6, ... +# +# File objects (for example self.fm.thisfile) have these useful attributes and +# methods: +# +# cf.path: The path to the file. +# cf.basename: The base name only. +# cf.load_content(): Force a loading of the directories content (which +# obviously works with directories only) +# cf.is_directory: True/False depending on whether it's a directory. +# +# For advanced commands it is unavoidable to dive a bit into the source code +# of ranger. +# =================================================================== + +from ranger.api.commands import * + +class alias(Command): + """:alias + + Copies the oldcommand as newcommand. + """ + + context = 'browser' + resolve_macros = False + + def execute(self): + if not self.arg(1) or not self.arg(2): + self.fm.notify('Syntax: alias ', bad=True) + else: + self.fm.commands.alias(self.arg(1), self.rest(2)) + +class cd(Command): + """:cd [-r] + + The cd command changes the directory. + The command 'cd -' is equivalent to typing ``. + Using the option "-r" will get you to the real path. + """ + + def execute(self): + import os.path + if self.arg(1) == '-r': + self.shift() + destination = os.path.realpath(self.rest(1)) + if os.path.isfile(destination): + self.fm.select_file(destination) + return + else: + destination = self.rest(1) + + if not destination: + destination = '~' + + if destination == '-': + self.fm.enter_bookmark('`') + else: + self.fm.cd(destination) + + def tab(self): + import os + from os.path import dirname, basename, expanduser, join + + cwd = self.fm.thisdir.path + rel_dest = self.rest(1) + + bookmarks = [v.path for v in self.fm.bookmarks.dct.values() + if rel_dest in v.path ] + + # expand the tilde into the user directory + if rel_dest.startswith('~'): + rel_dest = expanduser(rel_dest) + + # define some shortcuts + abs_dest = join(cwd, rel_dest) + abs_dirname = dirname(abs_dest) + rel_basename = basename(rel_dest) + rel_dirname = dirname(rel_dest) + + try: + # are we at the end of a directory? + if rel_dest.endswith('/') or rel_dest == '': + _, dirnames, _ = next(os.walk(abs_dest)) + + # are we in the middle of the filename? + else: + _, dirnames, _ = next(os.walk(abs_dirname)) + dirnames = [dn for dn in dirnames \ + if dn.startswith(rel_basename)] + except (OSError, StopIteration): + # os.walk found nothing + pass + else: + dirnames.sort() + if self.fm.settings.cd_bookmarks: + dirnames = bookmarks + dirnames + + # no results, return None + if len(dirnames) == 0: + return + + # one result. since it must be a directory, append a slash. + if len(dirnames) == 1: + return self.start(1) + join(rel_dirname, dirnames[0]) + '/' + + # more than one result. append no slash, so the user can + # manually type in the slash to advance into that directory + return (self.start(1) + join(rel_dirname, dirname) for dirname in dirnames) + + +class chain(Command): + """:chain ; ; ... + + Calls multiple commands at once, separated by semicolons. + """ + def execute(self): + for command in self.rest(1).split(";"): + self.fm.execute_console(command) + + +class shell(Command): + escape_macros_for_shell = True + + def execute(self): + if self.arg(1) and self.arg(1)[0] == '-': + flags = self.arg(1)[1:] + command = self.rest(2) + else: + flags = '' + command = self.rest(1) + + if not command and 'p' in flags: + command = 'cat %f' + if command: + if '%' in command: + command = self.fm.substitute_macros(command, escape=True) + self.fm.execute_command(command, flags=flags) + + def tab(self): + from ranger.ext.get_executables import get_executables + if self.arg(1) and self.arg(1)[0] == '-': + command = self.rest(2) + else: + command = self.rest(1) + start = self.line[0:len(self.line) - len(command)] + + try: + position_of_last_space = command.rindex(" ") + except ValueError: + return (start + program + ' ' for program \ + in get_executables() if program.startswith(command)) + if position_of_last_space == len(command) - 1: + selection = self.fm.thistab.get_selection() + if len(selection) == 1: + return self.line + selection[0].shell_escaped_basename + ' ' + else: + return self.line + '%s ' + else: + before_word, start_of_word = self.line.rsplit(' ', 1) + return (before_word + ' ' + file.shell_escaped_basename \ + for file in self.fm.thisdir.files \ + if file.shell_escaped_basename.startswith(start_of_word)) + +class open_with(Command): + def execute(self): + app, flags, mode = self._get_app_flags_mode(self.rest(1)) + self.fm.execute_file( + files = [f for f in self.fm.thistab.get_selection()], + app = app, + flags = flags, + mode = mode) + + def tab(self): + return self._tab_through_executables() + + def _get_app_flags_mode(self, string): + """Extracts the application, flags and mode from a string. + + examples: + "mplayer f 1" => ("mplayer", "f", 1) + "aunpack 4" => ("aunpack", "", 4) + "p" => ("", "p", 0) + "" => None + """ + + app = '' + flags = '' + mode = 0 + split = string.split() + + if len(split) == 0: + pass + + elif len(split) == 1: + part = split[0] + if self._is_app(part): + app = part + elif self._is_flags(part): + flags = part + elif self._is_mode(part): + mode = part + + elif len(split) == 2: + part0 = split[0] + part1 = split[1] + + if self._is_app(part0): + app = part0 + if self._is_flags(part1): + flags = part1 + elif self._is_mode(part1): + mode = part1 + elif self._is_flags(part0): + flags = part0 + if self._is_mode(part1): + mode = part1 + elif self._is_mode(part0): + mode = part0 + if self._is_flags(part1): + flags = part1 + + elif len(split) >= 3: + part0 = split[0] + part1 = split[1] + part2 = split[2] + + if self._is_app(part0): + app = part0 + if self._is_flags(part1): + flags = part1 + if self._is_mode(part2): + mode = part2 + elif self._is_mode(part1): + mode = part1 + if self._is_flags(part2): + flags = part2 + elif self._is_flags(part0): + flags = part0 + if self._is_mode(part1): + mode = part1 + elif self._is_mode(part0): + mode = part0 + if self._is_flags(part1): + flags = part1 + + return app, flags, int(mode) + + def _is_app(self, arg): + return not self._is_flags(arg) and not arg.isdigit() + + def _is_flags(self, arg): + from ranger.core.runner import ALLOWED_FLAGS + return all(x in ALLOWED_FLAGS for x in arg) + + def _is_mode(self, arg): + return all(x in '0123456789' for x in arg) + + +class set_(Command): + """:set