diff --git a/.config/awesome/lanxu/ip.lua b/.config/awesome/lanxu/ip.lua new file mode 100644 index 0000000..0a4fcb2 --- /dev/null +++ b/.config/awesome/lanxu/ip.lua @@ -0,0 +1,53 @@ +local naughty = require("naughty") +local wibox = require("wibox") +local json = require("lanxu/dkjson") +local gears = require("gears") +local focused = require("awful.screen").focused +local easy_async = require("awful.spawn").easy_async + +local function factory(args) + local args = args or {} + local calluri = args.uri or "https://api.ipify.org" + local settings = args.settings or function() end + local homeaddress = args.homeaddress or nil + + local ip = { widget = wibox.widget.textbox() } + ip.widget:set_markup("N/A") + + function ip.attach(obj) + obj:connect_signal("button::press", function() + ip.update() + end) + end + + function ip.update() + local cmd = string.format("curl -s " .. "'" .. calluri .. "'") + + address = "N/A" + settings() + + easy_async(cmd, function(response, stderr, reason, exit_code) + address = response + address = string.gsub(address, "[^0-9.]", "") + if address == homeaddress then + address = "Home" + end + + ip.address = address + widget = ip.widget + + settings() + end) + end + + ip.attach(ip.widget) + + address = "N/A" + settings() + + ip.update() + + return ip +end + +return factory diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 33013d7..fc73210 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -260,8 +260,8 @@ awful.screen.connect_for_each_screen(function(s) spacer, mydpmsstatus, spacer, - mycloudstatus, - spacer, + --mycloudstatus, + --spacer, mycpu, spacer, mymem, @@ -269,11 +269,8 @@ awful.screen.connect_for_each_screen(function(s) myweather, spacer, mycputemp, - spacer, mygputemp, - spacer, mytextclock, - spacer, s.mylayoutbox, } -- Only show everything on the first screen diff --git a/.config/awesome/themes/lanxu/icons/ac.png b/.config/awesome/themes/lanxu/icons/ac.png deleted file mode 100644 index 96efcb4..0000000 Binary files a/.config/awesome/themes/lanxu/icons/ac.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/battery.png b/.config/awesome/themes/lanxu/icons/battery.png deleted file mode 100644 index 8c85596..0000000 Binary files a/.config/awesome/themes/lanxu/icons/battery.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/battery_empty.png b/.config/awesome/themes/lanxu/icons/battery_empty.png deleted file mode 100644 index 00821c9..0000000 Binary files a/.config/awesome/themes/lanxu/icons/battery_empty.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/battery_low.png b/.config/awesome/themes/lanxu/icons/battery_low.png deleted file mode 100644 index 29f3fc5..0000000 Binary files a/.config/awesome/themes/lanxu/icons/battery_low.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/centerfair.png b/.config/awesome/themes/lanxu/icons/centerfair.png deleted file mode 100644 index c4f64b0..0000000 Binary files a/.config/awesome/themes/lanxu/icons/centerfair.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/centerwork.png b/.config/awesome/themes/lanxu/icons/centerwork.png deleted file mode 100644 index 9071516..0000000 Binary files a/.config/awesome/themes/lanxu/icons/centerwork.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/centerworkh.png b/.config/awesome/themes/lanxu/icons/centerworkh.png deleted file mode 100644 index b1d1379..0000000 Binary files a/.config/awesome/themes/lanxu/icons/centerworkh.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/cpu.png b/.config/awesome/themes/lanxu/icons/cpu.png index 35af1c3..b9891e3 100644 Binary files a/.config/awesome/themes/lanxu/icons/cpu.png and b/.config/awesome/themes/lanxu/icons/cpu.png differ diff --git a/.config/awesome/themes/lanxu/icons/dwindle.png b/.config/awesome/themes/lanxu/icons/dwindle.png deleted file mode 100644 index 649ea99..0000000 Binary files a/.config/awesome/themes/lanxu/icons/dwindle.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/fairh.png b/.config/awesome/themes/lanxu/icons/fairh.png deleted file mode 100644 index 62d3d99..0000000 Binary files a/.config/awesome/themes/lanxu/icons/fairh.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/fairv.png b/.config/awesome/themes/lanxu/icons/fairv.png deleted file mode 100644 index 131dd0f..0000000 Binary files a/.config/awesome/themes/lanxu/icons/fairv.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/floating.png b/.config/awesome/themes/lanxu/icons/floating.png deleted file mode 100644 index d25c47b..0000000 Binary files a/.config/awesome/themes/lanxu/icons/floating.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/gpu.png b/.config/awesome/themes/lanxu/icons/gpu.png new file mode 100644 index 0000000..4926699 Binary files /dev/null and b/.config/awesome/themes/lanxu/icons/gpu.png differ diff --git a/.config/awesome/themes/lanxu/icons/hdd.png b/.config/awesome/themes/lanxu/icons/hdd.png deleted file mode 100644 index 0fb6833..0000000 Binary files a/.config/awesome/themes/lanxu/icons/hdd.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/magnifier.png b/.config/awesome/themes/lanxu/icons/magnifier.png deleted file mode 100644 index 60d3e0d..0000000 Binary files a/.config/awesome/themes/lanxu/icons/magnifier.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/mail.png b/.config/awesome/themes/lanxu/icons/mail.png deleted file mode 100644 index 474e602..0000000 Binary files a/.config/awesome/themes/lanxu/icons/mail.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/mail_on.png b/.config/awesome/themes/lanxu/icons/mail_on.png deleted file mode 100644 index 19106d7..0000000 Binary files a/.config/awesome/themes/lanxu/icons/mail_on.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/max.png b/.config/awesome/themes/lanxu/icons/max.png deleted file mode 100644 index 5b0a5b7..0000000 Binary files a/.config/awesome/themes/lanxu/icons/max.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/mem.png b/.config/awesome/themes/lanxu/icons/mem.png deleted file mode 100644 index 7860a1a..0000000 Binary files a/.config/awesome/themes/lanxu/icons/mem.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/net.png b/.config/awesome/themes/lanxu/icons/net.png deleted file mode 100644 index bc42fdc..0000000 Binary files a/.config/awesome/themes/lanxu/icons/net.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/net_wired.png b/.config/awesome/themes/lanxu/icons/net_wired.png deleted file mode 100644 index e8cc2bd..0000000 Binary files a/.config/awesome/themes/lanxu/icons/net_wired.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/note.png b/.config/awesome/themes/lanxu/icons/note.png deleted file mode 100644 index baa29c3..0000000 Binary files a/.config/awesome/themes/lanxu/icons/note.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/note_on.png b/.config/awesome/themes/lanxu/icons/note_on.png deleted file mode 100644 index 1a7ab94..0000000 Binary files a/.config/awesome/themes/lanxu/icons/note_on.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/ram.png b/.config/awesome/themes/lanxu/icons/ram.png new file mode 100644 index 0000000..7f61ac2 Binary files /dev/null and b/.config/awesome/themes/lanxu/icons/ram.png differ diff --git a/.config/awesome/themes/lanxu/icons/scissors.png b/.config/awesome/themes/lanxu/icons/scissors.png deleted file mode 100644 index f8c700d..0000000 Binary files a/.config/awesome/themes/lanxu/icons/scissors.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/spiral.png b/.config/awesome/themes/lanxu/icons/spiral.png deleted file mode 100644 index d9ee0f6..0000000 Binary files a/.config/awesome/themes/lanxu/icons/spiral.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/square_sel.png b/.config/awesome/themes/lanxu/icons/square_sel.png deleted file mode 100644 index 1102a9f..0000000 Binary files a/.config/awesome/themes/lanxu/icons/square_sel.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/square_unsel.png b/.config/awesome/themes/lanxu/icons/square_unsel.png deleted file mode 100644 index 7386b85..0000000 Binary files a/.config/awesome/themes/lanxu/icons/square_unsel.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/submenu.png b/.config/awesome/themes/lanxu/icons/submenu.png deleted file mode 100644 index b55ebce..0000000 Binary files a/.config/awesome/themes/lanxu/icons/submenu.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/task.png b/.config/awesome/themes/lanxu/icons/task.png deleted file mode 100644 index 9701b68..0000000 Binary files a/.config/awesome/themes/lanxu/icons/task.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/temp.png b/.config/awesome/themes/lanxu/icons/temp.png deleted file mode 100644 index 6793a9f..0000000 Binary files a/.config/awesome/themes/lanxu/icons/temp.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/termfair.png b/.config/awesome/themes/lanxu/icons/termfair.png deleted file mode 100644 index 3e06023..0000000 Binary files a/.config/awesome/themes/lanxu/icons/termfair.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/tile.png b/.config/awesome/themes/lanxu/icons/tile.png deleted file mode 100644 index 922c05c..0000000 Binary files a/.config/awesome/themes/lanxu/icons/tile.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/tilebottom.png b/.config/awesome/themes/lanxu/icons/tilebottom.png deleted file mode 100644 index 6ec9cb8..0000000 Binary files a/.config/awesome/themes/lanxu/icons/tilebottom.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/tileleft.png b/.config/awesome/themes/lanxu/icons/tileleft.png deleted file mode 100644 index 8e3d2d6..0000000 Binary files a/.config/awesome/themes/lanxu/icons/tileleft.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/tiletop.png b/.config/awesome/themes/lanxu/icons/tiletop.png deleted file mode 100644 index 3da75a1..0000000 Binary files a/.config/awesome/themes/lanxu/icons/tiletop.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/vol.png b/.config/awesome/themes/lanxu/icons/vol.png deleted file mode 100644 index bbf33d4..0000000 Binary files a/.config/awesome/themes/lanxu/icons/vol.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/vol_low.png b/.config/awesome/themes/lanxu/icons/vol_low.png deleted file mode 100644 index aa3ce4d..0000000 Binary files a/.config/awesome/themes/lanxu/icons/vol_low.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/vol_mute.png b/.config/awesome/themes/lanxu/icons/vol_mute.png deleted file mode 100644 index e855fd2..0000000 Binary files a/.config/awesome/themes/lanxu/icons/vol_mute.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/vol_no.png b/.config/awesome/themes/lanxu/icons/vol_no.png deleted file mode 100644 index bbe917b..0000000 Binary files a/.config/awesome/themes/lanxu/icons/vol_no.png and /dev/null differ diff --git a/.config/awesome/themes/lanxu/icons/wall-clock.png b/.config/awesome/themes/lanxu/icons/wall-clock.png new file mode 100644 index 0000000..6b262ad Binary files /dev/null and b/.config/awesome/themes/lanxu/icons/wall-clock.png differ diff --git a/.config/awesome/themes/lanxu/titlebar/minimize_focus.png b/.config/awesome/themes/lanxu/titlebar/minimize_focus.png new file mode 100644 index 0000000..ff427b3 Binary files /dev/null and b/.config/awesome/themes/lanxu/titlebar/minimize_focus.png differ diff --git a/.config/awesome/themes/lanxu/titlebar/minimize_normal.png b/.config/awesome/themes/lanxu/titlebar/minimize_normal.png new file mode 100644 index 0000000..aa47447 Binary files /dev/null and b/.config/awesome/themes/lanxu/titlebar/minimize_normal.png differ diff --git a/.config/awesome/widgets.lua b/.config/awesome/widgets.lua index 6532dc4..b40f4f6 100644 --- a/.config/awesome/widgets.lua +++ b/.config/awesome/widgets.lua @@ -5,10 +5,16 @@ local lain = require("lain") local vicious = require("vicious") -- Custom local beautiful = require("beautiful") -- CPU temp local wibox = require("wibox") +local gears = require("gears") -- Variables local valuecolor = "white" +icons_dir = os.getenv("HOME") .. "/.config/awesome/themes/lanxu/icons/" +cpuicon = wibox.widget.imagebox() +cpuicon.image = icons_dir .. "cpu.png" +cpuicon.resize = false + -- Helpers function file_exists(name) local f = io.open(name,"r") @@ -39,8 +45,18 @@ mymem = lain.widget.mem({ }) -- GPU -mygputemp = wibox.widget.textbox() -vicious.register(mygputemp, gputemp, create_markup("GPU", "$0", "℃", valuecolor), 15, "AMD") +mygputemp_text = wibox.widget.textbox() +mygputemp_text.align = "center" +vicious.register(mygputemp_text, gputemp, +function(widget, args) + temp = string.format("%.0f", tonumber(args[0])) + return create_markup("", temp, "℃", valuecolor) +end, 15, "AMD") +mygputemp = wibox.container.background() +mygputemp.forced_width = 70 +mygputemp:set_widget(mygputemp_text) +--mytextclock:set_shape(gears.shape.hexagon) +mygputemp:set_bg('#5e35b1') -- Hubic myhubic = wibox.widget.textbox() @@ -62,27 +78,42 @@ volume = lain.widget.pulse({ }) -- Text clock -mytextclock = wibox.widget.textclock(create_markup("Date","%Y-%m-%d %H:%M","", valuecolor)) - -lain.widget.calendar({ +mytextclock_text = wibox.widget.textclock(create_markup("","%Y-%m-%d %H:%M","", valuecolor)) +mytextclock_text.align = "center" +lain.widget.cal({ followtag = true, - attach_to = {mytextclock} + attach_to = {mytextclock_text}, + notification_preset = { + font = "Monospace 11", fg = "#FFFFFF", bg = "#000000" + } }) +mytextclock = wibox.container.background() +mytextclock.forced_width = 130 +mytextclock:set_widget(mytextclock_text) +mytextclock:set_bg('#512da8') + -- CPU temperature -local tempfile = "/sys/bus/pci/drivers/k10temp/0000:00:18.3/hwmon/hwmon2/temp1_input" +local tempfile = "/sys/bus/pci/drivers/k10temp/0000:00:18.3/hwmon/hwmon1/temp1_input" +--local tempfile = "/sys/bus/pci/drivers/k10temp/0000:00:18.3/hwmon/hwmon2/temp1_input" if file_exists(tempfile) == false then tempfile = "/sys/class/thermal/thermal_zone0/temp" end -mycputemp = lain.widget.temp({ +mycputemp_text = lain.widget.temp({ tempfile = tempfile, settings = function() - widget.markup = create_markup("CPU", coretemp_now, "℃", valuecolor) + temp = string.format("%.0f", tonumber(coretemp_now)) + widget.markup = create_markup("", temp, "℃", valuecolor) end }) +mycputemp_text.widget.align = "center" +mycputemp = wibox.container.background() +mycputemp.forced_width = 70 +mycputemp:set_widget(mycputemp_text.widget) +mycputemp:set_bg('#9575cd') -- Weather Widget myweather = lain.widget.weather({ city_id = 634963, @@ -90,11 +121,19 @@ myweather = lain.widget.weather({ followtag = true, settings = function() widget.markup = create_markup("Tampere", weather_now.main.temp, "℃", valuecolor) - end + end, + notification_preset = { + font = "Monospace 11", fg = "#FFFFFF", bg = "#000000" + } }) -- DPMS mydpmsstatus = wibox.widget.textbox() +-- mydpmsstatus.container.background.bg = '#ff0000' +--mydpmsstatus = { +-- widget = wibox.widget.textbox +--} + vicious.register(mydpmsstatus, dpmsstatus, function(widget, args) color = valuecolor if args[0] == "Enabled" then @@ -109,21 +148,21 @@ local notification = { font = "Monospace 10" } -- Servers -local mcstatus = require("lanxu/mcstatus") -myserverstatus = mcstatus({ - notification_preset = notification, - settings = function() - widget.markup = create_markup("PLAYERS", totalplayers, "", valuecolor) - end -}) +--local mcstatus = require("lanxu/mcstatus") +--myserverstatus = mcstatus({ + --notification_preset = notification, + --settings = function() + --widget.markup = create_markup("PLAYERS", totalplayers, "", valuecolor) + --end +--}) -local cloudstatus = require("lanxu/cloudstatus") -mycloudstatus = cloudstatus({ - notification_preset = notification, - settings = function() - widget.markup = create_markup("CLOUD", currentstatus, "", valuecolor) - end -}) +--local cloudstatus = require("lanxu/cloudstatus") +--mycloudstatus = cloudstatus({ + --notification_preset = notification, + --settings = function() + --widget.markup = create_markup("CLOUD", currentstatus, "", valuecolor) + --end +--}) local ip = require("lanxu/ip") ipaddress = ip({ @@ -132,3 +171,4 @@ ipaddress = ip({ widget.markup = create_markup("IP", address, "", valuecolor) end }) + diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index dd8bc42..fafef35 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -1,7 +1,8 @@ # =================================================================== # This file contains the default startup commands for ranger. -# To change them, it is recommended to create the file -# ~/.config/ranger/rc.conf and add your custom commands there. +# To change them, it is recommended to create either /etc/ranger/rc.conf +# (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom +# commands there. # # If you copy this whole file there, you may want to set the environment # variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice. @@ -85,6 +86,10 @@ set preview_images true # width of 8 and height of 11 are used. To use other values, set the options # iterm2_font_width and iterm2_font_height to the desired values. # +# * terminology: +# Previews images in full color in the terminology terminal emulator. +# Supports a wide variety of formats, even vector graphics like svg. +# # * urxvt: # Preview images in full color using urxvt image backgrounds. This # requires using urxvt compiled with pixbuf support. @@ -92,7 +97,28 @@ set preview_images true # * urxvt-full: # The same as urxvt but utilizing not only the preview pane but the # whole terminal window. -set preview_images_method w3m +# +# * kitty: +# Preview images in full color using kitty image protocol. +# Requires python PIL or pillow library. +# If ranger does not share the local filesystem with kitty +# the transfer method is changed to encode the whole image; +# while slower, this allows remote previews, +# for example during an ssh session. +# Tmux is unsupported. +# +# * ueberzug: +# Preview images in full color with the external command "ueberzug". +# Images are shown by using a child window. +# Only for users who run X11 in GNU/Linux. +set preview_images_method ueberzug + +# Delay in seconds before displaying an image with the w3m method. +# Increase it in case of experiencing display corruption. +set w3m_delay 0.02 + +# Manually adjust the w3mimg offset when using a terminal which needs this +set w3m_offset 0 # Default iTerm2 font size (see: preview_images_method: iterm2) set iterm2_font_width 8 @@ -101,6 +127,10 @@ set iterm2_font_height 11 # Use a unicode "..." character to mark cut-off filenames? set unicode_ellipsis false +# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic). +# Requires the python-bidi pip package +set bidi_support false + # Show dotfiles in the bookmark preview box? set show_hidden_bookmarks true @@ -124,8 +154,11 @@ set status_bar_on_top false # currently running tasks which support progress bars? set draw_progress_bar_in_status_bar true -# Draw borders around columns? -set draw_borders false +# Draw borders around columns? (separators, outline, both, or none) +# Separators are vertical lines between columns. +# Outline draws a box around all the columns. +# Both combines the two. +set draw_borders none # Display the directory name in tabs? set dirname_in_tabs false @@ -137,6 +170,9 @@ set mouse_enabled true set display_size_in_main_column true set display_size_in_status_bar true +# Display the free disk space in the status bar? +set display_free_space_in_status_bar true + # Display files tags in all columns or only in main column? set display_tags_in_all_columns true @@ -144,7 +180,7 @@ set display_tags_in_all_columns true set update_title false # Set the title to "ranger" in the tmux program? -set update_tmux_title false +set update_tmux_title true # Shorten the title if it gets long? The number defines how many # directories are displayed at once, 0 turns off this feature. @@ -216,6 +252,10 @@ set cd_tab_fuzzy false # disable this feature. set preview_max_size 0 +# The key hint lists up to this size have their sublists expanded. +# Otherwise the submaps are replaced with "...". +set hint_collapse_threshold 10 + # Add the highlighted file to the path in the titlebar set show_selection_in_titlebar true @@ -232,9 +272,14 @@ set metadata_deep_search false # Clear all existing filters when leaving a directory set clear_filters_on_dir_change false -# Disable displaying line numbers in main column +# Disable displaying line numbers in main column. +# Possible values: false, absolute, relative. set line_numbers false +# When line_numbers=relative show the absolute line number in the +# current line. +set relative_current_zero false + # Start line numbers from 1 instead of 0 set one_indexed false @@ -249,6 +294,13 @@ set wrap_scroll false # directories, files and symlinks respectively. set global_inode_type_filter +# This setting allows to freeze the list of files to save I/O bandwidth. It +# should be 'false' during start-up, but you can toggle it by pressing F. +set freeze_files false + +# Print file sizes in bytes instead of the default human-readable format. +set size_in_bytes false + # =================================================================== # == Local Options # =================================================================== @@ -270,8 +322,8 @@ alias qall quitall alias qall! quitall! alias setl setlocal -alias filter scout -prt -alias find scout -aeit +alias filter scout -prts +alias find scout -aets alias mark scout -mr alias unmark scout -Mr alias search scout -rs @@ -296,6 +348,8 @@ map change_mode normal map ~ set viewmode! map i display_file +map scroll_preview 1 +map scroll_preview -1 map ? help map W display_log map w taskview_open @@ -311,6 +365,8 @@ map r chain draw_possible_programs; console open_with%%space map f console find%space map cd console cd%space +map chain console; eval fm.ui.console.history_move(-1) + # Change the line mode map Mf linemode filename map Mi linemode fileinfo @@ -374,6 +430,7 @@ map L history_go 1 map ] move_parent 1 map [ move_parent -1 map } traverse +map { traverse_backwards map ) jump_non map gh cd ~ @@ -385,9 +442,10 @@ map gL cd -r %f map go cd /opt map gv cd /var map gm cd /media +map gi eval fm.cd('/run/media/' + os.getenv('USER')) map gM cd /mnt map gs cd /srv -map gt cd /tmp +map gp cd /tmp map gr cd / map gR eval fm.cd(ranger.RANGERDIR) map g/ cd / @@ -400,6 +458,7 @@ map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh map yp yank path map yd yank dir map yn yank name +map y. yank name_without_extension # Filesystem Operations map = chmod @@ -474,6 +533,8 @@ map tab_open 6 map tab_open 7 map tab_open 8 map tab_open 9 +map tab_shift 1 +map tab_shift -1 # Sorting map or set sort_reverse! @@ -503,6 +564,8 @@ map zc set collapse_preview! map zd set sort_directories_first! map zh set show_hidden! map set show_hidden! +copymap +copymap map zI set flushinput! map zi set preview_images! map zm set mouse_enabled! @@ -514,6 +577,21 @@ map zv set use_preview_script! map zf console filter%space copymap zf zz +# Filter stack +map .n console filter_stack add name%space +map .m console filter_stack add mime%space +map .d filter_stack add type d +map .f filter_stack add type f +map .l filter_stack add type l +map .| filter_stack add or +map .& filter_stack add and +map .! filter_stack add not +map .r console filter_stack rotate +map .c filter_stack clear +map .* filter_stack decompose +map .p filter_stack pop +map .. filter_stack show + # Bookmarks map ` enter_bookmark %any map ' enter_bookmark %any @@ -558,8 +636,11 @@ cmap eval fm.ui.console.move(left=1) cmap eval fm.ui.console.move(right=1) cmap eval fm.ui.console.move(right=0, absolute=True) cmap eval fm.ui.console.move(right=-1, absolute=True) -cmap eval fm.ui.console.move_word(left=1) -cmap eval fm.ui.console.move_word(right=1) +cmap eval fm.ui.console.move_word(left=1) +cmap eval fm.ui.console.move_word(right=1) + +copycmap +copycmap # Line Editing cmap eval fm.ui.console.delete(-1) @@ -571,6 +652,7 @@ cmap eval fm.ui.console.delete_rest(-1) cmap eval fm.ui.console.paste() # And of course the emacs way +copycmap copycmap copycmap copycmap diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index 5af4370..95718ed 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -31,7 +31,7 @@ IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise. FILE_EXTENSION="${FILE_PATH##*.}" -FILE_EXTENSION_LOWER="${FILE_EXTENSION,,}" +FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')" # Settings HIGHLIGHT_SIZE_MAX=262143 # 256KiB @@ -60,9 +60,10 @@ handle_extension() { # PDF #pdf) # # Preview as text conversion - # pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - && exit 5 + # pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | fmt -w ${PV_WIDTH} && exit 5 + # mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | fmt -w ${PV_WIDTH} && exit 5 # exiftool "${FILE_PATH}" && exit 5 - # exit 1;; + # exit 1;; # BitTorrent torrent) @@ -82,10 +83,20 @@ handle_extension() { lynx -dump -- "${FILE_PATH}" && exit 5 elinks -dump "${FILE_PATH}" && exit 5 ;; # Continue with next handler on failure + + # JSON + json) + jq --color-output . "${FILE_PATH}" && exit 5 + python -m json.tool -- "${FILE_PATH}" && exit 5 +;; esac } handle_image() { + # Size of the preview if there are multiple options or it has to be rendered + # from vector graphics. If the conversion program allows specifying only one + # dimension while keeping the aspect ratio, the width will be used. + local DEFAULT_SIZE="1920x1080" local mimetype="${1}" case "${FILE_EXTENSION_LOWER}" in @@ -98,9 +109,15 @@ handle_image() { case "${mimetype}" in # SVG image/svg+xml) - convert "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6 + convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6 exit 1;; + # DjVu + # image/vnd.djvu) + # ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \ + # - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \ + # && exit 6 || exit 1;; + # Image image/*) local orientation @@ -125,12 +142,80 @@ handle_image() { # PDF application/pdf) pdftoppm -f 1 -l 1 \ - -scale-to-x 1920 \ + -scale-to-x "${DEFAULT_SIZE%x*}" \ -scale-to-y -1 \ -singlefile \ -jpeg -tiffcompression jpeg \ -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \ - && exit 6 || exit 1;; + && exit 6 || exit 1;; + # ePub, MOBI, FB2 (using Calibre) + # application/epub+zip|application/x-mobipocket-ebook|application/x-fictionbook+xml) + # ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FILE_PATH}" > /dev/null \ + # && exit 6 || exit 1;; + + # ePub (using ) + # application/epub+zip) + # epub-thumbnailer \ + # "${FILE_PATH}" "${IMAGE_CACHE_PATH}" "${DEFAULT_SIZE%x*}" \ + # && exit 6 || exit 1;; + + # Font + application/font*|application/*opentype) + preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png" + if fontimage -o "${preview_png}" \ + --pixelsize "120" \ + --fontname \ + --pixelsize "80" \ + --text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \ + --text " abcdefghijklmnopqrstuvwxyz " \ + --text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \ + --text " The quick brown fox jumps over the lazy dog. " \ + "${FILE_PATH}"; + then + convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \ + && rm "${preview_png}" \ + && exit 6 + else + exit 1 + fi + ;; + + # Preview archives using the first image inside. + # (Very useful for comic book collections for example.) + # application/zip|application/x-rar|application/x-7z-compressed|\ + # application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar) + # local fn=""; local fe="" + # local zip=""; local rar=""; local tar=""; local bsd="" + # case "${mimetype}" in + # application/zip) zip=1 ;; + # application/x-rar) rar=1 ;; + # application/x-7z-compressed) ;; + # *) tar=1 ;; + # esac + # { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \ + # { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \ + # { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \ + # { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return + # + # fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \ + # [ print(l, end='') for l in sys.stdin if \ + # (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\ + # sort -V | head -n 1) + # [ "$fn" = "" ] && return + # [ "$bsd" ] && fn=$(printf '%b' "$fn") + # + # [ "$tar" ] && tar --extract --to-stdout \ + # --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6 + # fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g') + # [ "$bsd" ] && bsdtar --extract --to-stdout \ + # --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6 + # [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}" + # [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \ + # "${IMAGE_CACHE_PATH}" && exit 6 + # [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \ + # "${IMAGE_CACHE_PATH}" && exit 6 + # [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}" + # ;; esac } @@ -155,6 +240,13 @@ handle_mime() { # pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5 exit 2;; + # DjVu + image/vnd.djvu) + # Preview as text conversion (requires djvulibre) + djvutxt "${FILE_PATH}" | fmt -w ${PV_WIDTH} && exit 5 + exiftool "${FILE_PATH}" && exit 5 + exit 1;; + # Image image/*) # Preview as text conversion diff --git a/.vimrc b/.vimrc index 3dd16fa..3fd155c 100644 --- a/.vimrc +++ b/.vimrc @@ -38,8 +38,8 @@ Plug 'honza/vim-snippets' "Plug 'tomasr/molokai' "Plug 'flazz/vim-colorschemes' "Plug 'morhetz/gruvbox' -Plug 'chriskempson/base16-vim' - +"Plug 'chriskempson/base16-vim' " Original but not updated +Plug 'danielwe/base16-vim' " Fork. updated. https://github.com/chriskempson/base16-vim/issues/197 " Airline Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' diff --git a/.zprofile b/.zprofile index 3f1e080..63007c7 100644 --- a/.zprofile +++ b/.zprofile @@ -53,3 +53,6 @@ export PATH="$NPM_PACKAGES/bin:$PATH" # Rust export PATH="${HOME}/.cargo/bin:$PATH" + +# Caffe +export CAFFE_DIR="${HOME}/Koodit/github/caffe/build/install" diff --git a/.zshrc b/.zshrc index bfb6bde..35bbe5e 100644 --- a/.zshrc +++ b/.zshrc @@ -44,7 +44,7 @@ alias lp="lastpass.sh" alias ranger="TERMCMD=termite ranger" alias search="search.sh" #alias ls="ls -N --time-style=long-iso --color=auto" -alias ls="ls --time-style=long-iso --color=auto" +alias ls="ls --time-style=long-iso --color=auto --human-readable --group-directories-first --classify" alias rhc='RUBYOPT="-W0" rhc' # Other alias fixsteam='find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete' @@ -52,7 +52,7 @@ alias runsteam="LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /us alias steamgamesdir='cd ~/.local/share/Steam/SteamApps/common' alias emsdksetup='source $EMSDK/emsdk_env.sh' alias runwinesteam="MESA_GL_VERSION_OVERRIDE=3.3COMPAT PULSE_LATENCY_MSEC=60 run-desktop.py ~/.local/share/applications/wine/Programs/Steam/Steam.desktop" -alias rbackup="restic -r rclone:hubic:default/Backups/ChimeraLinux" +alias rbackup="restic -r rclone:hubic:ChimeraLinux" # https://github.com/chriskempson/base16-shell # git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell source $HOME/.config/base16-shell/scripts/base16-default-dark.sh