Nice tip. (Up until now) I've just been using [ -z $TMUX ] && tmuxHead_on_a_Stick wrote:^ Nice tips, thanks!
I use this stanza in my shell configuration to autostart tmux if it is not already running and to attach to the first available session if it is running:This results in "unkillable" terminal sessions so my work isn't ruined when I accidentally close a windowCode: Select all
if [ -z "$TMUX" ]; then ID="$(tmux ls 2>/dev/null | awk -F':' '!/attached/{print $1}' | sed q)" if [ -z "$ID" ]; then tmux new-session else tmux attach-session -t "$ID" fi fi
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
What does your desktop look like?
Re: What does your desktop look like?
- None1975
- df -h | participant
- Posts: 1404
- Joined: 2015-11-29 18:23
- Location: Russia, Kaliningrad
- Has thanked: 46 times
- Been thanked: 68 times
Re: What does your desktop look like?
Forgive me for a stupid question. How do you close this session? Do you use the exit command?Head_on_a_Stick wrote:^ This results in "unkillable" terminal sessions so my work isn't ruined when I accidentally close a window
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github
Debian Wiki | DontBreakDebian, My config files on github
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: What does your desktop look like?
Yes, either `exit` or <Ctrl>-D will close tmux if it is the only session running or `pkill tmux` will kill everything.None1975 wrote:How do you close this session? Do you use the exit command?
I prefer to keep the session running though, mainly because I don't use a persistent history file with my shell.
deadbang
- None1975
- df -h | participant
- Posts: 1404
- Joined: 2015-11-29 18:23
- Location: Russia, Kaliningrad
- Has thanked: 46 times
- Been thanked: 68 times
Re: What does your desktop look like?
I understood. Thanks for the explanation.Head_on_a_Stick wrote:Yes, either `exit` or <Ctrl>-D will close tmux if it is the only session running or `pkill tmux` will kill everything.
I prefer to keep the session running though, mainly because I don't use a persistent history file with my shell.
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github
Debian Wiki | DontBreakDebian, My config files on github
Re: What does your desktop look like?
The standard tmux control key is ctrl-b if you press that combination, release the keys and then press d that will detatch you from the session, but it keeps running in the background. You can then log back in again later to the same server and run tmux attach ... to get back into that original session, even from a different device (such as a smartphone with ssh that you login to the server with).None1975 wrote:How do you close this session? Do you use the exit command?
Other tmux commands are ctrl-b c to create a new tmux window. ctrl-b n to step between the windows, ctrl-b " and ctrl-b % to split a current window (horizontally/vertically), ctrl-b arrow keys to step between them, ctrl-b z to zoom/unzoom a pane
You can set tmux to start and load a number of windows via a script such as
Code: Select all
#!/bin/sh
# create a tmux session called work, and detach so we can send keys to it
# send keys to rename the first window to diary and load diary
# (as root, as my diary is owned by root)
tmux new -s work -d
tmux rename-window -t work diary
tmux send-keys -t work 'su - root -c "vi /home/user/bin/diary"' C-m
# Add another tmux window, rename it to mc and load mc
tmux new-window -t work
tmux rename-window -t work mc
tmux send-keys -t work 'mc' C-m
# and finally select which window to show first and attach to the tmux work session
tmux select-window -t work:0
tmux attach -t work
Set the console up appropriately and it can be quite colourful (PS1 prompt) and run tmux (so multiple windows, scrolling, cut/paste ...etc.) and if you run mc in one window that has a nice inbuilt editor as well as being a reasonable file manager (I set my left pane to show a tree, right pane to show files and set lynx type navigation so up and down arrows steps you through a directory, left and right arrows takes you up or down through directories). Nice for when working on remote systems.
Personally I don't like the ctrl-b control key sequence so I map that to the backtick (execute) key instead. When I want to type a execute/backtick in a file such as a shell script I have to press it twice ... i.e. my .tmux.conf contains ...
unbind C-b
set-option -g prefix `
bind ` send-prefix
I also set F11 and F12 to create a new tmux window and step through the windows
# mc uses F1 to F10, so moved up to F11 and F12
bind-key -n F12 next-window
bind-key -n F11 new-window
" and % for splitting a window into panes isn't nice IMO either so I map them to the | and - keys ...
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
So for me for instance, I can split a window by pressing the backtick (exec) key (instead of having to key in ctrl-b) and then | for a vertical splitting of the window. F12 to step onto the next tmux window ...etc. Generally I avoid splitting tmux window myself and prefer to run each program full screen i.e. I most create new tmux windows using F11 and step between them using F12.
So you might have one tmux window that you've used to ssh into another box, another tmux window running mc, another running perhaps calcurse (calendar), another running htop (system monitor), irc, email ....etc. and you can detatch, from that ... and return later and reattach back in again. Ctrl-Alt-Fn and you can flip between that console and your X session (browser with tabs ...etc.).
Sorry for the wall of words, hope it was more helpful than annoying.
- Nili
- Posts: 441
- Joined: 2014-04-30 14:04
- Location: $HOME/♫♪
- Has thanked: 5 times
- Been thanked: 3 times
Re: What does your desktop look like?
This thread is turned into tmux config, so I'm posting too this little script found on Arch Wiki years ago.
Note: you may change "x-terminal-emultar" with your terminal name eg: stterm or xterm
Also: you may change "ranger" / "ranger /media" with your apps name like rTorrent, newsbeuter, mutt etc...
I find the above command useful, because, keeps sessions open in tmux even if i close the console window or if the tmux is running on desktop, it open back where i left it.
Code: Select all
exec x-terminal-emulator -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session 'ranger /media' \; split-window -h ranger \; split-window -v \;"
Also: you may change "ranger" / "ranger /media" with your apps name like rTorrent, newsbeuter, mutt etc...
I find the above command useful, because, keeps sessions open in tmux even if i close the console window or if the tmux is running on desktop, it open back where i left it.
openSUSE Tumbleweed KDE/Wayland
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: What does your desktop look like?
Big changes for my Debian desktop: I've slightly reduced the size of the panel font
Also changed from ifupdown to systemd-networkd using systemd's native DHCP server with automatic switching from wireless to wired connections[1] and systemd-resolved providing the DNS via Google:
The resolv.conf file then shows a nameserver of 127.0.0.53, which is a bit weird, but it works:
I really do love the integrated user space provided by all the systemd tools, it is very Unix-like
[1] https://wiki.archlinux.org/index.php/Sy ... me_machine
Also changed from ifupdown to systemd-networkd using systemd's native DHCP server with automatic switching from wireless to wired connections[1] and systemd-resolved providing the DNS via Google:
Code: Select all
# ln -sf /usr/lib/systemd/resolv.conf /etc/resolv.conf
Code: Select all
empty@hegel:~ $ systemd-resolve forums.debian.net
forums.debian.net: 217.196.43.138
-- Information acquired via protocol DNS in 2.6ms.
-- Data is authenticated: no
empty@hegel:~ $
[1] https://wiki.archlinux.org/index.php/Sy ... me_machine
deadbang
- None1975
- df -h | participant
- Posts: 1404
- Joined: 2015-11-29 18:23
- Location: Russia, Kaliningrad
- Has thanked: 46 times
- Been thanked: 68 times
Re: What does your desktop look like?
Thank you, ruffwoof very much for the detailed description of tmux. Very useful information. I will tailor something for my own needs. Thanks again.
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github
Debian Wiki | DontBreakDebian, My config files on github
- Nili
- Posts: 441
- Joined: 2014-04-30 14:04
- Location: $HOME/♫♪
- Has thanked: 5 times
- Been thanked: 3 times
Re: What does your desktop look like?
^Icewm brings back some cool memories playing with it.
openSUSE Tumbleweed KDE/Wayland
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
Re: What does your desktop look like?
Seems like you are using lots of RAM for something without eye candy and only 4 terminal windows open ?
ThinkPad X220: i5-2520M CPU 2.5GHz - 8GB RAM 1333 MHz - SSD 860 EVO 250GB - Debian - ME_cleaned
ThinkPad X230: i5-3320M CPU 3.3GHz - 8GB RAM 1600 MHz - SSD 860 EVO 500GB - Debian - ME_cleaned
ThinkPad X230: i5-3320M CPU 3.3GHz - 8GB RAM 1600 MHz - SSD 860 EVO 500GB - Debian - ME_cleaned
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: What does your desktop look like?
Firefox is open in the "web" tag, here's a clean scrot:esp7 wrote:Seems like you are using lots of RAM for something without eye candy and only 4 terminal windows open ?
I do like systemd-{network,resolve}d but it is a bit of a memory hog...
deadbang
- Nili
- Posts: 441
- Joined: 2014-04-30 14:04
- Location: $HOME/♫♪
- Has thanked: 5 times
- Been thanked: 3 times
Re: What does your desktop look like?
systemd services are multiplied so much that i have to zoom out my eyes then start countingHead_on_a_Stick wrote:I do like systemd-{network,resolve}d but it is a bit of a memory hog...
7 so far, I believe the trend is ever in rising rather than falling.
Well atleast Club 100 is there. So, good job for keeping memory tightened tightly.
openSUSE Tumbleweed KDE/Wayland
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: What does your desktop look like?
Yes, I know what you mean but the functionality on offer is very impressive, for example querying my DNS stats:Nili wrote:systemd services are multiplied so much that i have to zoom out my eyes then start counting
Code: Select all
empty@hegel:~ $ systemd-resolve --statistics
DNSSEC supported by current servers: yes
Transactions
Current Transactions: 0
Total Transactions: 70973
Cache
Current Cache Size: 117
Cache Hits: 27779
Cache Misses: 45791
DNSSEC Verdicts
Secure: 8653
Insecure: 42095
Bogus: 0
Indeterminate: 0
empty@hegel:~ $
It would be possible to run my rig with just `wpa-supplicant` & `ip` but I like the integration of systemd's userland tools.
deadbang
- Nili
- Posts: 441
- Joined: 2014-04-30 14:04
- Location: $HOME/♫♪
- Has thanked: 5 times
- Been thanked: 3 times
Re: What does your desktop look like?
I do not deny that there are many useful features on systemd as long i used it in Debian 8.
openSUSE Tumbleweed KDE/Wayland
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
Re: What does your desktop look like?
Found my old Dell Vostro 1720 laptop and spend some quality time with her ..
New install: Debian testing net-install, some necessaries, some configs from terminalforlife (https://github.com/terminalforlife) and bspwm (love it!)
Just having fun !
New install: Debian testing net-install, some necessaries, some configs from terminalforlife (https://github.com/terminalforlife) and bspwm (love it!)
Just having fun !
there's no business like .. your own business ..
- Nili
- Posts: 441
- Joined: 2014-04-30 14:04
- Location: $HOME/♫♪
- Has thanked: 5 times
- Been thanked: 3 times
Re: What does your desktop look like?
Wallpaper: Pokemon-Trainer-Selene
Edit: I mistakenly posted the image here, though Devuan within the family i see it.
openSUSE Tumbleweed KDE/Wayland
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.
- None1975
- df -h | participant
- Posts: 1404
- Joined: 2015-11-29 18:23
- Location: Russia, Kaliningrad
- Has thanked: 46 times
- Been thanked: 68 times
Re: What does your desktop look like?
After much thought, I decided to try out the window manager-Afterstep. I installed it and was dumbfounded. Desktop of the nineties;) But I liked it. And even very much. After the fuss with Xmonad, constant config file modification, etc. i decided to tear it all to hell, and stay on Afterstep. So far it looks like this (an empty desktop)
Busy:
Busy with menu:
Busy:
Busy with menu:
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github
Debian Wiki | DontBreakDebian, My config files on github