tmux new window in new session
This commit is contained in:
@@ -7,6 +7,10 @@ bind-key b setw synchronize-panes
|
|||||||
setw -g monitor-activity on
|
setw -g monitor-activity on
|
||||||
set -g visual-activity on
|
set -g visual-activity on
|
||||||
|
|
||||||
|
# set window and pane index to 1 (0 by default)
|
||||||
|
set-option -g base-index 1
|
||||||
|
setw -g pane-base-index 1
|
||||||
|
|
||||||
#set-window-option -g window-status-current-bg yellow
|
#set-window-option -g window-status-current-bg yellow
|
||||||
#set -ga terminal-overrides ",xterm-termite:Tc"
|
#set -ga terminal-overrides ",xterm-termite:Tc"
|
||||||
set -g default-terminal "screen-256color"
|
set -g default-terminal "screen-256color"
|
||||||
|
|||||||
@@ -119,6 +119,28 @@ mykeyboardlayout = awful.widget.keyboardlayout()
|
|||||||
-- {{{ Wibar
|
-- {{{ Wibar
|
||||||
-- Create a textclock widget
|
-- Create a textclock widget
|
||||||
mytextclock = wibox.widget.textclock()
|
mytextclock = wibox.widget.textclock()
|
||||||
|
local cal_notification
|
||||||
|
mytextclock:connect_signal("button::release",
|
||||||
|
function()
|
||||||
|
if cal_notification == nil then
|
||||||
|
awful.spawn.easy_async([[zsh -c "cal -3 -m --color=always |sed 's#\x1B\[7m\([0-9]\+\)\x1B\[27m#<span foreground=\"red\"><b>\1</b></span>#'"]],
|
||||||
|
function(stdout, stderr, reason, exit_code)
|
||||||
|
cal_notification = naughty.notify{
|
||||||
|
text = stdout,
|
||||||
|
-- text = string.gsub(string.gsub(stdout,
|
||||||
|
-- "+", "<span foreground='red'><b>"),
|
||||||
|
-- "-", "</b></span>"),
|
||||||
|
font = "Source Code Pro",
|
||||||
|
timeout = 0,
|
||||||
|
width = auto,
|
||||||
|
destroy = function() cal_notification = nil end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
)
|
||||||
|
else
|
||||||
|
naughty.destroy(cal_notification)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
-- Create a wibox for each screen and add it
|
-- Create a wibox for each screen and add it
|
||||||
local taglist_buttons = gears.table.join(
|
local taglist_buttons = gears.table.join(
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
if [[ "$TERM" == screen* ]] || [[ -n "$TMUX" ]]; then
|
if [[ "$TERM" == screen-256color ]] || [[ -n "$TMUX" ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if tmux list-sessions && (tmux list-sessions | test -n "$0"); then
|
if tmux list-sessions && (tmux list-sessions | test -n "$0"); then
|
||||||
session_id=`date +%Y%m%d%H%M%S`
|
session_id=`date +%Y%m%d%H%M%S`
|
||||||
tmux new-session -d -t base -s $session_id
|
tmux new-session -d -t base -s $session_id
|
||||||
|
tmux select-window -t "$( tmux new-window -P -F \#{window_index} )"
|
||||||
tmux attach-session -t $session_id \; set-option destroy-unattached
|
tmux attach-session -t $session_id \; set-option destroy-unattached
|
||||||
else
|
else
|
||||||
tmux new-session -s base
|
tmux new-session -s base
|
||||||
|
|||||||
Reference in New Issue
Block a user