SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-06-22 16:44:10

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Tmux Pimpin'

# change prefix to Ctrl-a (like in gnu-screen)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix


# shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh


# start with window 1 (instead of 0)
set -g base-index 1


# start with pane 1
set -g pane-base-index 1


# screen mode
#set -g default-terminal "screen"
set -g default-terminal "screen-256color"


# source config file
bind r source-file ~/.tmux.conf


# history
set -g history-limit 5000


# allow terminal scrolling
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'


# copy mode
#unbind [
#bind Escape copy-mode
#unbind ]
bind ] paste-buffer


# use vi mode
setw -g mode-keys vi
set -g status-keys vi
setw -g utf8 on
# use mouse in copy mode
setw -g mode-mouse on


# tmux-zoom.sh
bind C-z run "tmux-zoom.sh"


# splitting
unbind %
bind h split-window -h
unbind '"'
bind v split-window -v


# window switching
unbind n
bind = next-window
#unbind p
bind - previous-window
bind -n C-Right next-window
bind -n C-Left previous-window
# with mouse (click on pretty little boxes)
set -g mouse-select-window on


# colon :
bind : command-prompt


# panes
set -g mouse-select-pane on
set -g pane-border-fg black
set -g pane-active-border-fg brightred
#set -g pane-active-border-attr blink
# resize panes with mouse (drag borders)
set -g mouse-select-pane on
set -g mouse-resize-pane on


# status line
set -g status-utf8 on
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2


# messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black


#window mode
setw -g mode-bg colour6
setw -g mode-fg colour0


# window status
#setw -g window-status-format " #F#I:#W#F "
#setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-bg green
setw -g window-status-fg black
setw -g window-status-attr reverse
setw -g window-status-content-bg colour0
setw -g window-status-content-fg colour11
setw -g window-status-content-attr bold,blink,reverse


# Info on right (requires stlarch-terminusmod font)
set -g status-right-length 60
set -g status-right '#[fg=brightblue]ßÜ #[fg=brightyellow]#(tmux_upspeed)/#(tmux_downspeed) #[fg=colour7]| #[fg=brightblue]ª #[fg=brightyellow]#(sensors | grep temp1 | cut -d+ -f2 | cut -d. -f1) #[fg=colour7]| #[fg=brightblue]ï #[fg=brightyellow]#(acpi -b | cut -d" " -f4 | cut -d"%" -f1) #[fg=colour7]| #[fg=brightred]#(cut -d " " -f 1-3 /proc/loadavg) #[fg=colour7]| #[fg=brightgreen]%a %H:%M'


# Info on left (I don't have a session display for now)
set -g status-left ''


# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-content off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-window-option -g monitor-content on
set-option -g bell-action none


# tmux clock
set -g clock-mode-colour blue


# some key-binding changes
bind x kill-pane
bind X next-layout
bind Z previous-layout

Last edited by gutterslob (2013-08-18 15:07:20)


Point & Squirt

Offline

Help fund CrunchBang, donate to the project!

#2 2012-06-22 17:54:42

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: Tmux Pimpin'

Offline

#3 2012-06-22 20:19:48

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: Tmux Pimpin'

nice thread...subscribed.  I don't know what I could contribute, but if I have something I sure will.  Nonetheless though, I'm gonna take some of what you offered up and see where it goes. 

thanks!

Offline

#4 2012-06-23 19:34:08

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Tmux Pimpin'

Thanks for starting this thread. Will have to keep an eye on this one.

Copied your script - and can confirm the blinking in a terminal other that urxvt.

The net speed scripts are a nice bonus.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#5 2012-06-24 18:56:07

ThomasAdam
#! Member
Registered: 2009-10-30
Posts: 74

Re: Tmux Pimpin'

set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix

set-option -g status-bg colour74
set-option -g status-fg black
set-option -s set-clipboard on
setw -g utf8 on
setw -g window-status-bell-attr underscore
setw -g window-status-bell-fg black
setw -g window-status-bell-bg white
set -g lock-server off
set -g lock-after-time 1800
set -g lock-command 'tput civis && read -s -n1'
set -g history-limit 10000
set -g default-terminal "screen-256color"
set -g default-shell /usr/bin/zsh
set -g pane-border-fg white
set -g pane-border-bg default
set -g pane-active-border-fg red
set -g pane-active-border-bg default
set -g repeat-time 100

unbind-key /
unbind-key c 
unbind-key d 
unbind-key f
unbind-key i 
unbind-key l 
unbind-key n 
unbind-key o 
unbind-key p 
unbind-key r 
unbind-key s 
unbind-key t 
unbind-key w
unbind-key x 
unbind-key |
unbind-key -
unbind-key A
unbind-key S
unbind-key .
unbind-key "'"
unbind-key '#'
unbind-key ' '
unbind-key z
unbind-key ^z

# For some additional bindings not in this file.
source-file ~/screen-keys.conf

bind a send-prefix
bind c new-window -a
bind d detach-client
bind "/" command-prompt "find-window '%%'"
bind i display-message
bind a last-window
bind n next-window
bind o select-pane -D
bind p previous-window
bind r respawn-window
bind s choose-tree
bind t clock-mode
bind w choose-window
bind k confirm-before kill-pane
bind x set lock-command '/usr/bin/vlock' \; lock-client \; set lock-command 'tput civis && read -s -n1'
bind "|" split-window -v
bind "-" split-window -h
bind l command-prompt "rename-window '%%'"
bind S command-prompt "rename-session '%%'"
bind . display-panes
bind "'" command-prompt -p "SSH: " "new-window -n %1 'ssh %1'"
bind ' ' choose-window

bind ^a last-window 
bind ^c new-window -a
bind ^d detach-client
bind ^i display-message
bind a last-window
bind ^n next-window
bind ^o select-pane -D
bind ^p previous-window
bind ^r respawn-window
bind ^s choose-session
bind ^t clock-mode
bind ^w choose-window
bind ^k confirm-before kill-pane
bind ^x lock-client
bind ^S command-prompt "rename-session '%%'"

bind -n C-Left previous-window
bind -n C-Right next-window
bind -n C-s set status

bind -r C-Left swapw -t:-
bind -r C-Right swapw -t:+

set -g status-left-fg black
set -g status-left-bg green
set -g status-left-length 30
set -g status-left "[#H] ([#S])"
set -g status-right-length 30
set -g status-right-bg colour74
set -g status-right "[%a %d/%m %H:%M]"

setw -g mode-bg blue
setw -g mode-fg yellow

setw -g window-status-current-fg white
setw -g window-status-current-bg colour34
setw -g mode-keys vi
setw -g mode-fg white

setw -g window-status-separator "| "
setw -g window-status-format "#I:#W:#[fg=pink]#F"
setw -g window-status-current-format "#[fg=black,bg=colour132]#I:#W:#[fg=white]#F"

set-window-option -g clock-mode-colour green

# Sessions
new -d -sspecial
new -d -sirc  -nirc 'exec mosh -- example.org'
new -d -swork -nirc -d -nmutt 'exec mutt'
neww -d
neww -d
neww -d
neww -d -nncmpc "exec ncmpc"

Offline

#6 2012-06-24 20:37:45

thevdude
#! Junkie
From: Pittsburgh, PA
Registered: 2011-09-01
Posts: 469

Re: Tmux Pimpin'

Woo! Mine is still really basic, I don't have a need for all that extra stuff. It's just my windows basically. hmm Definitely thinking about pimping it out a bit more though.

Offline

#7 2013-03-11 05:05:50

daggoth
Member
From: New Zealand
Registered: 2012-01-18
Posts: 39

Re: Tmux Pimpin'

Offline

#8 2013-03-11 15:48:13

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: Tmux Pimpin'

^ I'll paste em here, daggoth. That way we won't have links expiring in future.
Remember to change the interface (eth0,wlan0,etc), make executable and place in your $PATH.

tmux_upspeed

#!/bin/bash

TXB=$(</sys/class/net/eth0/statistics/tx_bytes)
sleep 2 
TXBN=$(</sys/class/net/eth0/statistics/tx_bytes)
TXDIF=$(echo $((TXBN - TXB)) )

echo -e "$((TXDIF / 1024 / 2))"

tmux_downspeed

#!/bin/bash

RXB=$(</sys/class/net/eth0/statistics/rx_bytes)
sleep 2
RXBN=$(</sys/class/net/eth0/statistics/rx_bytes)
RXDIF=$(echo $((RXBN - RXB)) )

echo -e "$((RXDIF / 1024 / 2))"

Last edited by gutterslob (2013-03-11 16:40:54)


Point & Squirt

Offline

#9 2013-03-11 16:10:59

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Tmux Pimpin'

I have been using ohmyzsh with tmux. I'm still acquainting myself with both, but I'm liking using zsh even more within a tmux environment.

Last edited by dura (2013-03-11 16:12:11)

Offline

#10 2013-03-12 02:32:49

daggoth
Member
From: New Zealand
Registered: 2012-01-18
Posts: 39

Re: Tmux Pimpin'

Thanks for the scripts gutterslob.  smile

Offline

#11 2013-05-03 20:43:19

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: Tmux Pimpin'

Last edited by Unia (2013-05-03 20:47:06)

Offline

#12 2013-05-03 21:09:48

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: Tmux Pimpin'

Another question; what's the actual use of tmux in a tiling wm? tongue

I'm just splitting panes etcetera now to explore its features, but I can do all of this in DWM itself already. Except for having tabs inside one terminal, I'm not seeing any other advantages of Tmux. (I have no use for its sessions, to be honest. I can see that when you do, it can be a feature)

Offline

#13 2013-05-03 21:15:42

DebianJoe
#! Code Whisperer
From: The Bleeding Edge
Registered: 2013-03-13
Posts: 1,207
Website

Re: Tmux Pimpin'

Great thread G-Slob.  Here's mine, which is "semi-Klingon" as it is set to more closely mirror gnuscreen.

#Joe's Tmux Config

# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix

# panes
set -g mouse-select-pane on
set -g pane-border-fg black
set -g pane-active-border-fg brightred
#resize panes with mouse (drag borders)
set -g mouse-select-pane on
set -g mouse-resize-pane on

# screen ^C c 
unbind ^C
bind ^C new-window
unbind c
bind c new-window

# detach ^D d
unbind ^D
bind ^D detach

# displays * 
unbind *
bind * list-clients

# next ^@ ^N sp n 
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window

# title A
unbind A
bind A command-prompt "rename-window %%"

# other ^A
unbind ^A
bind ^A last-window

# prev ^H ^P p ^? 
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window

# windows ^W w 
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows

# quit \ 
unbind '\'
bind '\' confirm-before "kill-server"

# kill K k 
unbind K
bind K confirm-before "kill-window"
unbind k
bind k confirm-before "kill-window"

# redisplay ^L l 
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client

# split -v |
unbind |
bind | split-window

# :kB: focus up
unbind Tab
bind Tab select-pane -t:.+
unbind BTab
bind BTab select-pane -t:.-

# " windowlist -b
unbind '"'
bind '"' choose-window

EDIT: Commented out line 12 (which should have been done from the beginning).  Also, if you use this setup and are thinking "Once Tmux starts, I cannot use my mouse to select text or right-click on the terminal!"  Hold down the shift key to allow the mouse to work with it again.  There's a priority issue with the mouse-draggable panes and how the terminal emulator handles mouse input.  Shift key is the only easy way I've come up with to avoid this totally.

Last edited by DebianJoe (2013-05-06 06:29:03)

Offline

#14 2013-05-03 21:20:22

wuxmedia
wookiee madclaw
From: Back in Blighty
Registered: 2012-03-09
Posts: 1,478
Website

Re: Tmux Pimpin'

@unia - agreed
great on servers (as  windows etc persist via ssh)
great outside of X, makes it like a tiling WM infact. so if in X running a tiler.... not much benefit that i can see.
amazing prog, and i must have a scan through those configs. i run default myself. or byobu  wink

Last edited by wuxmedia (2013-05-03 21:21:11)

Offline

#15 2013-05-03 21:25:57

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: Tmux Pimpin'

Thanks Joe, those mouse-draggable panes make it easier to handle. And I might just prefer it over DWM, or it might be something I'll hack into it if possible...

Offline

#16 2013-05-04 00:49:17

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Tmux Pimpin'


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#17 2013-05-04 09:47:31

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: Tmux Pimpin'

@Unia
I can see where you're coming from, and if all your work is done locally and inside X, there probably is very little need for tmux in dwm. A lot of it might also have to do with how you've set up your tags in dwm, I suppose. Now, if you do some of your stuff remotely (even on different machines in the same house), tmux does offer advantages that the FAQ (and arch boards, and google) answers. Although I currently run Spectrwm in OS X Mountain Lion, I'll never know when Apple will break compatibility with a new version of Xcode, so for me (aside from zsh) tmux is the only guaranteed constant between my Linux/BSD and OS X boxes.

I don't think tmux brings any additional "difficulty" if you use a tiler, since the modkey is different. Maybe it would for emacs users who're already neck-deep into modal bindings, I dunno.

The ability to maintain sessions outside X is obviously another benefit, though the config in my opening post doesn't quite display the statusbar properly outside X. I'll post a new "double config" shortly, where you'll be able to override one layout for another with a keybind

Last edited by gutterslob (2013-05-04 10:14:14)


Point & Squirt

Offline

#18 2013-05-04 09:54:31

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: Tmux Pimpin'

# change prefix to Ctrl-a (like in gnu-screen)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix


# shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh


# start with window 1 (instead of 0)
set -g base-index 1


# start with pane 1
set -g pane-base-index 1


# screen mode
set -g default-terminal "screen-256color"


# source config file
bind r source-file ~/.tmux.conf
bind R source-file ~/.tmux-no-x.conf

# open man page in new window
bind  / command-prompt "split window 'exec man %%'"

# history
set -g history-limit 5000


# allow terminal scrolling
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'

# to make ctrl + arrows, etc work
set-window-option -g xterm-keys on

# copy mode
#unbind [
#bind Escape copy-mode
#unbind ]
bind ] paste-buffer


# use vi mode
setw -g mode-keys vi
set -g status-keys vi
setw -g utf8 on
# use mouse in copy mode
setw -g mode-mouse on


# tmux-zoom.sh
bind C-z run "tmux-zoom.sh"


# splitting
unbind %
bind h split-window -h
unbind '"'
bind v split-window -v


# window switching
unbind n
bind = next-window
#unbind p
bind - previous-window
bind -n C-Right next-window
bind -n C-Left previous-window
# with mouse (click on pretty little boxes)
set -g mouse-select-window on


# colon :
bind : command-prompt


# panes
set -g mouse-select-pane on
set -g pane-border-fg black
if '[ -z "$DISPLAY" ]' 'set -g pane-border-fg blue'
set -g pane-active-border-fg brightred
#set -g pane-active-border-attr blink
# resize panes with mouse (drag borders)
set -g mouse-select-pane on
set -g mouse-resize-pane on

# status on top
#set -g status-position top

# status line
set -g status-utf8 on
set -g status-justify left
set -g status-bg black
if '[ -z "$DISPLAY" ]' 'set -g status-bg default'
set -g status-fg white
set -g status-interval 4

# messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black


#window mode
setw -g mode-bg colour6
setw -g mode-fg colour0


# window status
if '[ -z "$DISPLAY" ]' 'setw -g window-status-format " #F#I:#W "'
if '[ -z "$DISPLAY" ]' 'setw -g window-status-current-format " #F#I:#W "'
setw -g window-status-format "#[fg=colour8]#[bg=white] #I #[bg=colour8]#[fg=white] #W "
setw -g window-status-current-format "#[fg=black]#[bg=colour7] #I #[fg=black]#[bg=colour15] #W "
setw -g window-status-current-bg black
setw -g window-status-current-fg yellow
setw -g window-status-current-attr bold
setw -g window-status-bg black
setw -g window-status-fg blue
setw -g window-status-attr default
setw -g window-status-content-bg black
setw -g window-status-content-fg blue
setw -g window-status-content-attr bold


# Info on right
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg) #[fg=colour8]// #[fg=cyan]Tmux [#S]'
if '[ -z "$DISPLAY" ]' 'set -g status-right "#[fg=magenta]#(cat /proc/loadavg | cut -d \" \" -f 1-3) #[fg=white]| #[fg=yellow]Tmux:#S #[fg=white]| #[fg=green]%d-%m-%Y #[fg=white]| #[fg=cyan]%A %H:%M"'
set -g status-right-length 35
if '[ -z "$DISPLAY" ]' 'set -g status-right-length 60'

# Info on left (no session display)
set -g status-left ''


# loud or quiet?
set-option -g visual-activity on
set-option -g visual-bell off
set-option -g visual-content off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-window-option -g monitor-content on
set-option -g bell-action none
#set-option -g bell-on-alert on

# tmux clock
set -g clock-mode-colour blue

# some key-binding changes
bind x kill-pane
bind X next-layout
bind Z previous-layout
#unbind Left
#bind C-Left resize-pane -L 2
#bind h select-pane -L
#unbind Down
#bind C-Down resize-pane -D 2
#bind j select-pane -D
#unbind Up
#bind C-Up resize-pane -U 2
#bind k select-pane -U
#unbind Right
#bind C-Right resize-pane -R 2
#bind l select-pane -R
#unbind C-Left
#bind C-h resize-pane -L 1
#unbind C-Down
#bind C-j resize-pane -D 1
#unbind C-Up
#bind C-k resize-pane -U 1
#unbind C-Right
#bind C-l resize-pane -R 1
#unbind M-Left
#bind C-H resize-pane -L 30
#unbind M-Down
#bind C-J resize-pane -D 30
#unbind M-Up
#bind C-K resize-pane -U 30
#unbind M-Right
#bind C-L resize-pane -R 30

Last edited by gutterslob (2013-05-27 17:36:29)


Point & Squirt

Offline

#19 2013-05-04 17:16:06

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: Tmux Pimpin'

Thanks Gutterslob  wink

Last edited by Unia (2013-05-04 17:16:22)

Offline

#20 2013-05-06 06:54:34

DebianJoe
#! Code Whisperer
From: The Bleeding Edge
Registered: 2013-03-13
Posts: 1,207
Website

Re: Tmux Pimpin'

Went back and fixed an error in my original config (you'd notice it if starting a terminal full-screen in X, and then opening tmux).  Also covered how to regain mouse selection with the mouse-controlled panels.  I sometimes take for granted that the things that I do as 2nd nature because I do them all of the time might not be so easy to figure out the first time through.

As far as the "why" of tmux:  I don't really like tiling WMs for about 75% of the things I do.  On the other hand, I think they're incredibly useful for some of the others (which ironically, are all cli based for me.)  Tmux is the great answer to this issue.  Also, Mr. G-Slob, as long as you rebind C^b to C^a as most configs are done here, emacs doesn't really cause any extra degree of difficulty.  I am considering taking up piano, though, as I'm sure that the using of tmux + emacs is some form of left-hand finger kung-fu.

Offline

#21 2013-05-06 11:43:42

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: Tmux Pimpin'

^ Yeah, look at my configs and you'll know I employ C^a as well.
I don't think even the Tmux devs use C^b. They probably just defaulted it like that for shits and giggles.


Point & Squirt

Offline

#22 2013-08-19 05:50:43

Apathetic
Member
From: Philippines
Registered: 2013-05-25
Posts: 34
Website

Re: Tmux Pimpin'

Offline

#23 2013-08-19 06:19:32

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: Tmux Pimpin'

list-keys -t vi-copy

Last edited by gutterslob (2013-08-19 06:21:45)


Point & Squirt

Offline

#24 2013-10-20 16:43:27

Apathetic
Member
From: Philippines
Registered: 2013-05-25
Posts: 34
Website

Re: Tmux Pimpin'

 $ ls ~/.fonts
fonts.dir
README.terminusmod
SourceCodePro-Black.ttf
SourceCodePro-Bold.ttf
SourceCodePro-ExtraLight.ttf
SourceCodePro-Light.ttf
SourceCodePro-Medium.ttf
SourceCodePro-Regular.ttf
SourceCodePro-Semibold.ttf
terminusmod12b.pcf
terminusmod12r.icons.pcf
terminusmodx12b.pcf
terminusmodx12r.icons.pcf
terminusmodx12r.pcf
terminusmodx12r.psfu

Last edited by Apathetic (2013-10-20 16:47:04)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo